LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to send HEX data by LabView TCP Socket

using LabView2015, string data can be sent by TCP/Socket, How to send HEX data ? 

0 Kudos
Message 1 of 8
(5,352 Views)

There is typically some kind of message protocol you have to follow to talk to your device.  Please share that protocol so we know exactly it is you need.  I have seen too many versions of "Hex" data to feel comfortable giving an answer with that exact protocol.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 8
(5,295 Views)

Right click on the "data in" constant or control wired to the TCP Write function and select Visible Items -> Display Style and then select Hex Display. You can also wire an array of bytes to the data in input.

write TCP.png

Lucian
CLA
0 Kudos
Message 3 of 8
(5,270 Views)

Thanks.

but I can't find the way to use in LabView2015.

do you have such a vi file ? would u like to attach a copy.

0 Kudos
Message 4 of 8
(5,131 Views)

@huaew wrote:

Thanks.

but I can't find the way to use in LabView2015.

do you have such a vi file ? would u like to attach a copy.


You were given steps to produce the code.  Did you try it?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 8
(5,035 Views)

@huaew wrote:

using LabView2015, string data can be sent by TCP/Socket, How to send HEX data ? 


A string can contain all types of numbers, even hexdecimal numbers. 
Example:

RolfO_1-1577726709048.png

Do you need help for how to format a integer to a hexadecimal string or do you need to send a byte or byte array.
Since a byte just contain a value between 0 and 255 (decimal) your question is a little misleading if you ask for how to send hexadecimal data.

I would like to ask the same question as crossrulz, could you share information about your  message protocol.

0 Kudos
Message 6 of 8
(4,347 Views)

I want to send byte array. such as send 0x08 0xa0 0xe0.

0 Kudos
Message 7 of 8
(3,742 Views)

Hi huaew,

 

you still don't attach your VI…

 


@huaew wrote:

I want to send byte array. such as send 0x08 0xa0 0xe0.


  1. Then you need to create an array constant.
  2. Place a "byte" (aka U8 integer) constant in the array constant.
  3. Change the display style of that U8 constant to show hex formatted values and show the display style indication…

This is pretty basic LabVIEW knowledge: did you take note of those "Training resources" offered here?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 8
(3,735 Views)