LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TCP Comm to send Hex data

Solved!
Go to solution

I have an embedded device server which has a set of 8 user controllable pins. The command format for  these pins requires a TCP message that is 9 bytes long and in the Hex format.

 

I am using the TCP Communicator-Active.VI in the LV7.1 examples, to link to the device server. There is no problem with the connection - but I am unable to send the required message in HEX format.

 

The communicator always converts my entry into ASCII and the command thus fails. Also it fragments the typed command bytes and when I probe the resultng data packet with a network analyzer ( Ethereal ) I see that the VI has fragmented the data bytes into many discrete packets.

 

The command message that I want to send is in this format : 1B FF 00 00 00 FF 00 00 00

 

Any suggestions to resolve the problem ??

 

Thanks

Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 1 of 2
(4,234 Views)
Solution
Accepted by topic author MogaRaghu

You need to either create your string in hex display mode so you know you're entering hex values, rather than characters, or use a byte array and then use the Byte Array to String function. I would opt for the latter since it's easier to understand.

 

 

Note that the array is an array of U8 integers with the formatting set to Hexadecimal, and using a minimum field width of 2 characters, zero-padded on the left, and with the radix displayed. Makes it more clear that it's a hex value.

Message Edited by smercurio_fc on 10-07-2008 01:36 PM
Message 2 of 2
(4,219 Views)