问题描述:
Citect连接TCPIP网口设备应该怎么连接,不走任何通信协议?所属产品线:
AVEVA™ Plant SCADA解决方法:
1,此通信必须在Citect服务器上完成,
2,设置计算机设置向导的时候,多处理不能打勾
3,端口和板的设置如下图,无需设置IO设备
4,cicode脚本如下
INT
FUNCTION
My_finger()
INT hPort=-1;
INT len;
STRING TXT = "svend^n";
INT writeerror,readerror;
IF hPort=-1 THEN
hPort = ComOpen("PORT1", 0);
END
SleepMS(200); // give time for port to finish connect
len = StrLength(TXT);
IF hPort<>-1 THEN
writeerror = ComWrite(hPort, TXT, len, 0);
IF writeerror <>0 THEN
Message("","Write failure",0)
ELSE
TXT="";
len=127;
readerror = ComRead(hPort, TXT, len, 0);
IF readerror<>0 THEN
Message("","Read failure",0);
ELSE
Message("read", "#"+TXT+"#", 0);
END
END
END
ComClose(hPort);
RETURN 0
END
效果如下图
是否有帮助?