From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I change the termination character (Hex 00) in LabVIEW?

I'm talking to a 3rd party device over USB where I make function calls to their DLL. I send and receive Hex commands as Strings data type. I can send without problem however when I read back a string that should be Hex "FF 00 FF", I get back "FF" because LabVIEW sees 00 as a termination character so I don't get any data past the 00.  Likewise if I'm supposed to read "00 FF", I get back nothing!   The following KB linked below explains that LabVIEW sees 00 as a termination character.  It shows where using Serial to change the termination character to something else.  I don't have this option using my 3rd party USB device.  Is there a way to change what LabVIEW sees as it's termination character?

 

 http://digital.ni.com/public.nsf/allkb/9A3589A05F21A1B186256CE9006448D4

0 Kudos
Message 1 of 2
(2,333 Views)

That article is talking about two things. The first has to do with the fact that in C strings are terminated using 0x00. The second part has to do with a serial port read terminating once it sees 0x00. Based on what you described, I don't believe the second part does not apply to you since you are calling a third-party DLL, so it's doing the serial port read. Is this correct? Or, are you actually doing the serial port read yourself using VISA functions? If you are just calling their DLL, then the issue has to do with the string being passed back from the DLL to LabVIEW. You're probably passing in a string datatype. You should simply change this to a byte array so you get all the values.

0 Kudos
Message 2 of 2
(2,321 Views)