From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Why does UDP Write Pass 3's as Hexidecimal Placeholders?

HI everyone.  I'm having trouble making two machines communicate via UDP protocol.  I have one computer (Host) which is attempting to pass a specific message to another computer (Receiver)  via UDP communication.  I have the right ports open and Wireshark shows that the communications are passing, but the values that I'm trying to communicate are not.  Both Wireshark and the MB computer show that the values are being written differently than the initial string.  

 

For example, when I try to write a value to the a value of 0065, Wireshark and Receiver both show that a value of 3635 is being written.  I've been struggling with this error for a while, trying to unflatten, reflatten, and convert strings with no avail.  Does anyone know how to fix this to only pass the specified hex values?

0 Kudos
Message 1 of 8
(4,971 Views)
When I've used udp, the transmission is exactly what I've passed to the write function. Why didn't you post your code? What happens when you run one of the examples?
0 Kudos
Message 2 of 8
(4,958 Views)

What seams to be happening is that your "0065" is being sent as acsii  that would be NUL, NUL, 6and 5 or 0x00003635

 

A good acsii conversion chart is a necessity for serial communications.


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 8
(4,956 Views)

Sorry about not posting the code and Wireshark data earlier, it's attached to the end of this post.  I see that the Write function only accepts strings.  I'm interested in concatenating several strings of hex data together to pass a message, also linked below.  Each piece of the message is 4 bytes long and needs to be passed together through the UDP protocol.  Is there a way to properly concatenate several hexadecimal strings together to do this effect, or will I need to work specifically within ASCII?  I really appreciate any help you can give me in this, I'm struggling as an intern right now.

 

 

 

 I'm interested in passing 00000065, not the 30303635 data.

 

Download All
0 Kudos
Message 4 of 8
(4,929 Views)
No attachment.

Are your string constants set for hex display?
0 Kudos
Message 5 of 8
(4,927 Views)

Edited.  I used the Number to Hexadecimal String command to generate the data.

0 Kudos
Message 6 of 8
(4,923 Views)
That is not correct. If you don't want to use my suggestion for direct entry of the strings, use a U8 array and the byte array to string.
0 Kudos
Message 7 of 8
(4,921 Views)

You really need to show radicies and display styles.

UDPHex.llb.png


"Should be" isn't "Is" -Jay
Message 8 of 8
(4,908 Views)