String not going out to IP Port
fogled@mizzou
h4x354x0r
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,
Comments
-
Is the Moxa configured properly for the device connected? Does the LED for the Moxa RX port blink when you send a string? How about the TX port? I beleive there's also a diagnostic that lets you see the numbers of packets recieved so check and see if you're getting any traffic.
-
I'm not certain I have the MOXA all configured correctly, but even if it's not talking to the serial device, the controller should still be able to talk to the MOXA over IP, shouldn't it?
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. -
WORKING NOW
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. -
fogled@mizzou wrote: »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. -
I think there is something wiggy about notifications for master-based devices (0:x:x). There is also a known display issue with notifications that makes strings stop displaying if there is a null in them; it is actually going out, but notifications truncates the display at the null (this might have been fixed with the new version of Studio, but I haven't tested for it yet.
Categories
- All Categories
- 2.5K AMX General Discussion
- 922 AMX Technical Discussion
- 514 AMX Hardware
- 502 AMX Control Products
- 3 AMX Video Distribution Products
- 9 AMX Networked AV (SVSI) Products
- AMX Workspace & Collaboration Products
- 3.4K AMX Software
- 151 AMX Resource Management Suite Software
- 386 AMX Design Tools
- 2.4K NetLinx Studio
- 135 Duet/Cafe Duet
- 248 NetLinx Modules & Duet Modules
- 57 AMX RPM Forum
- 228 MODPEDIA - The Public Repository of Modules for Everyone
- 943 AMX Specialty Forums
- 2.6K AMXForums Archive
- 2.6K AMXForums Archive Threads
- 1.5K AMX Hardware
- 432 AMX Applications and Solutions
- 249 Residential Forum
- 182 Tips and Tricks
- 146 AMX Website/Forums
