Writing to sockets with Citect

Hey Marsupilami,

Thanks for the tips. you are correct, i should be able to get this to work but something strange is definitely going on.

In answer to your questions:
1) there is no telnet port however using ssh and netcat i can definately connect to the device through the port i have configured in my citect setup.
2) yes i ran the computer setup wizard
it is all pretty much standard, this pc is an ioserver as far as i can tell
3) i am not running multiprocess
4) i am running citect version 7.1
5) using wireshark i am not seeing any traffic coming from citect only what is expected from the PLC end.
6) looking into the kernal i wasn't able to use the TCPIP debug character for some reason. Not really sure how do use it but i will read up on that next.
7) both sides have TCP for the port that i am talking but the PLC also has a seperate dedicated UDP port used for broadcasting distributed messages. This has no effect on the port i am interested in.
8) no messages in the kernal that point to anything wrong.

THIS IS SO STRANGE .. It's a very simple implementation.

I will comment on the current setup next.
 
Hey Again,

In reference to your point about seeing my comment on the user list.

I have a port setup and always had. In summary i have the following.

single cluster: cluster
single ioserver: server (using localhost network address)
single board: BOARD1 (type: TCPIP, address: 0, io port: n/a all other n/a)
single port: BOARD1_PORT1 (number:1, name:BOARD1, Special Opt -I10.200.60.100 -P50030 -T)
single IO Device: IODevice (number:1, address:1, Protocol: ASCII, Port Name: DISKDRV, MEMORY:False)

I have no variable tags at all. My plan is to at a later stage use the ComOpen to read a bunch of ASCII data from my remote device and then write it into place DISK tags that can store the ASCII read/writes.

The function sits on my page and runs StartSerial("BOARD1_PORT1");

I hope that this string then gets passed into my cicode function StartSerial.

The cicode function is as follows:

******************************************
INT
FUNCTION
StartSerial(STRING sPort);
INT hPort;
hPort = ComOpen(sPort, 0);
IF hPort < 0 THEN
Prompt ("Cannot open port" + sPort);
RETURN -1;
END
Prompt("Port is open");
! other stuff in here
! other stuff in here
ComClose(hPort);
Return 0;
END
*****************************************

On the page all i ever get is "cannot open port 0" so it is either never executing (which i think is more likely) or it somehow isn't getting the port linkage. Do i need to hardcode the port name into the cicode instead of pass it in?
 
Craig,

what strikes me as odd, is that you get the message "cannot open port 0". while in your code you use "Prompt ("Cannot open port" + sPort);"

this would mean that sPort = 0 so you are executing "hPort = ComOpen(0, 0);" while it should be "hPort = ComOpen("Name of the port in the project editor", 0);"

Regards,

Marsi
 

Similar Topics

Hi, I'm having an issue in crimson 3.0 when I create a programme using a case statement referencing a fault word that each bit needs to change the...
Replies
5
Views
298
Hello all, I'm currently working on a servo motor linear positioning system (ball screw). I'm all set up regarding communication between my HMI...
Replies
1
Views
111
Hello All: I have a Windows 10 PC running a FTView ME Station 10.00. I have a .mer file version 6.00. It has been running well on it for a long...
Replies
1
Views
181
My R55 Ingersollrand is tripping on motor overload and im falling to see the trip history it is writing Acquarring texts
Replies
0
Views
140
Hi. Not the fist time I'm saying this but just to give a background. 95% of my PLC programming has used Schneider over the last 10 years on...
Replies
66
Views
5,060
Back
Top Bottom