Home AMX User Forum AMXForums Archive Threads AMX Hardware

Sending XML strings using IP_CLIENT_OPEN

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.

Comments

  • Hm, at this point I only have some general suggestions.

    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,
  • Hi Marc,

    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.
  • Cameron D wrote:
    Hi Marc,

    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>....
    SEND_STRING HYDRA,"'<XML><PACKET MODULE="HYDRA" VERSION="1.0"><TRANSACTION SERIAL="t1" MODE="0">'"
    SEND_STRING HYDRA,"'<COMMAND ID="loadlayoutandupdate" SERIAL="s1"><MODULE ID="Hydra1"><LAYOUT ID="Layout1"></LAYOUT></MODULE></COMMAND>'"
    SEND_STRING HYDRA,"'</TRANSACTION></PACKET></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 :)
  • Hi Marc,

    No. Spliting the string does not work.

    I hope the port number is OK the Hydra Port is 8881.
  • Joe HebertJoe Hebert Posts: 2,159
    Cameron D wrote:
    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>'"
    Cameron D wrote:
    I hope the port number is OK the Hydra Port is 8881
    For what it?s worth - I did a copy and paste of your SEND_STRING HYDRA and put it in a Netlinx test program that IP connects to a VB app that I wrote for my desktop that listens for data coming in on port 8881. All 220 bytes came through exactly as sent.
    Cameron D wrote:
    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.
    <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>
  • Hi Joe,

    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
  • Hi Guys,

    Its me the XML string needed ,$0D" at the end of the String.

    Thanks Guys for all the your help.
  • Cameron D wrote:
    Its me the XML string needed ,$0D" at the end of the String.

    Tsk, tsk. Way to not support XML right, Barco. :)

    - Chip
Sign In or Register to comment.