03-15-2011 10:57 AM
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
03-15-2011 12:28 PM
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.