Sending XML strings using IP_CLIENT_OPEN
Cameron D
Posts: 31
in AMX Hardware
Hi
Iam trying to send an XML string about 220 char long to a device over IP.
But it does not get all of the string.
Is it because the String Length is set within Netlinx.
Can anyone give me any clues.
Iam trying to send an XML string about 220 char long to a device over IP.
But it does not get all of the string.
Is it because the String Length is set within Netlinx.
Can anyone give me any clues.
0
Comments
First of all, after a IP_CLIENT_OPEN() you have to wait until you get the ONLINE event on the corresponding IP device. I would track this with a variable I set to 1 if the ONLINE event is received and send the variable back when OFFLINE is triggered. Sending my data is blocked untiul my variable is 1.
Sending 220 characters in general should be no problem (afaik you can send 2048 characters in one send_string to IP). But I guess an IP device, which only could receive 200 bytes in one message. So if my data was longer, I had to split the data in smaller packets.
Do you put your XML data into a temporary array or something like that? Is this array large enough? Keep in mind that i.e. the VARIABLE_TO_XML() pushes up string size because of the XML tags.
Maybe you can post the related code.
Regards,
The string is - SEND_STRING HYDRA,"'<XML><PACKET MODULE="HYDRA" VERSION="1.0"><TRANSACTION SERIAL="t1" MODE="0"><COMMAND ID="loadlayoutandupdate" SERIAL="s1"><MODULE ID="Hydra1"><LAYOUT ID="Layout1"></LAYOUT></MODULE></COMMAND></TRANSACTION></PACKET></XML>'"
It is to a Barco Hydra which can only be control over TCP/IP and in XML.
I know this string works in a Telnet session but not across the Netlinx IP.
The IP_CLIENT_OPEN session is all ok and i can send the string to the Hydra
but the Hydra disconnects the session if it does not get the whole command.
Hm......
What's happening if you split this long string into 2 or 3 send_string instructions? For the Hydra, a dataset starts with <XML> and ends with </XML>....
Referring to Technote #156, a string sent to IP only could be 131 bytes long...... not sure.... confused..... will ask Tech Support, hoping not to loose my ACE state
No. Spliting the string does not work.
I hope the port number is OK the Hydra Port is 8881.
<SWAG>When you connected via Telnet did you need to login? I?m taking a stab in the dark but is it possible the Barco needs authentication first before it will accept an XML packet? You seem to be implying that the Barco is indeed receiving some data. Maybe it is looking for a login after a connect and that?s why it disconnects after you send your XML packet.</SWAG>
Thanks for trying this out.
It does not need a user/password.
So can if possible send me your program so i can try it here.
cameron@videosouth.co.uk
Thanks
Its me the XML string needed ,$0D" at the end of the String.
Thanks Guys for all the your help.
Tsk, tsk. Way to not support XML right, Barco.
- Chip