資源簡介
c# 操作帶Modbus模塊歐姆龍PLC
代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.Linq;
using?System.Text;
using?System.Threading.Tasks;
using?NModbusDemo;???//Modbus?封裝好的類庫
namespace?getValueWithDll
{
????class?Program
????{
????????static?void?Main(string[]?args)
????????{
????????????NModbusDemo.Program?Program?=?new?NModbusDemo.Program();
????????????try
????????????{
????????????????//string?IP?=?“169.254.22.202“;???//?鐳焊設備PLC?IP地址
????????????????string?IP?=?“127.0.0.1“;???//?鐳焊設備PLC?IP地址
????????????????ushort?Port?=?502;?????????//?鐳焊設備PLC?port
????????????????ushort?startAddress?=?60;??//?鐳焊設備PLC?地址
????????????????string?strType?=?““;???????//??返回值類型?=>?“number“則返回PLC取出來的值or““其他返回PLC地址對應的提示信息
????????????????string?plcValue?=?Program.getValue(IP?Port?startAddress?strType)
- 上一篇:NCrawler網絡爬蟲開源代碼
- 下一篇:C# VLC Pla
yer 視頻播放器
評論
共有 條評論