String not going out to IP Port
fogled@mizzou
Posts: 549
I'm working with a MOXA N-Port device. I'm connecting to it from the controller over IP OK, but for some reason when I try to send data to that IP connection, nothing happens. The code:
In the DATA_EVENT, I get the debug message that the port is, indeed, open.
In the very last line in the code, if I swap in a spare serial port for the IP port, the string goes out to that serial port OK. But when sending to the dvipproj_12 device, nothing. I can telnet into the controller and send strings directly to any port, and invariably the string will go to any serial port, but not to the IP port.
Can anybody help me out with this one? I'm stumped.
Thanks,
dvipproj_12 = 0:4:0 //Room 12 ip_client_open(dvipproj_12.port,rm[2].moxaip,966,IP_TCP) data_event[dp_all] { //Moxa Proj Port online: { stack_var integer this_did this_did = get_last(dp_all) call 'debug' ("'Moxa Proj RM ID=',itoa(this_did),' RM NUM=',rm[this_did].name,'IP=',rm[this_did].moxaip,' Port Open... '") } } call 'debug' ("'Send_String to Rm ID 2 Name ',rm[2].name,': Type:',itoa(d[2].type),' Cmd ID:',itoa(d[2].lastcmd),' STR:',cmd[d[2].type].str[d[2].lastcmd].dat") send_string dvipproj_12,"cmd[d[2].type].str[d[2].lastcmd].dat,$0D"
In the DATA_EVENT, I get the debug message that the port is, indeed, open.
In the very last line in the code, if I swap in a spare serial port for the IP port, the string goes out to that serial port OK. But when sending to the dvipproj_12 device, nothing. I can telnet into the controller and send strings directly to any port, and invariably the string will go to any serial port, but not to the IP port.
Can anybody help me out with this one? I'm stumped.
Thanks,
0
Comments
I deal with IP communications in controllers quite a bit, and I've never seen a SEND_STRING command to an IP connection appear to not fire off at all. If there's a problem with the port, I'll get an error, otherwise I'll see the string go out to that port in Notifications. In this case, just... nothing.
It's all working now. Turns out our knuclehead installation crew got the RS232 wiring mixed up.
I don't understand why I don't get the "String To / String From [0:4:1] - {DATA}" in Notifications. I swear I get all that stuff in all my other IP communications on other systems, but... I'll have to go back and check again. Maybe I'm mis-remembering.
I've never had this work reliably, so I don't count on it. The nice thing about having the IP-to-RS232 boxes is that you can just use your laptop to telnet to one of them to see if the device is talking.