Citect 2016 Winsock ASCII TCP

Hi all

I'm trying to develop communication from SCADA, Citect 2016, to 3-d party device. The protocol is ASCII TCP.

I cannot find a way to open Winsock in the SCADA with cicode.

I found some direction with "ComOpen()" but I receive "-1" as response. plctalk.net/qanda/showthread.php?t=47189

May be someone here can assist with this problem? Thanks in advance!

  • Create a BOARD for your I/O server and name it brdTCPIP for example. Board Type should be TCPIP, Address 0 and Special Opt should be left blank.

    Create a PORT and name it prtTCPdev1 for example. Port Number should be a unique number, Board Name is brdTCPIP (the one you created earlier).

    Special Opt of the PORT should contain -I1.2.3.4 -P502 -T (replace 1.2.3.4 with the IP address of your device and 502 with the TCP port number). the -T option means TCP (use -U for UDP if needed). The options should be separated by spaces and there may be no space between -I and the actual ip address).

    Now you have to be able to open this port from Cicode using ComOpen("prtTCPdev1", 0). Make sure you run the code on your I/O server process, or configure Citect for running in single process mode using the Computer Setup Wizard.

    If you still receive -1 as a return code, consider using IsError() directly behind the ComOpen statement to get the actual error code. There is a list of error codes in the Help file.