LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

string control problem

I am sending a string to a device. The only parameter that changes is the bit driven by the boolean. The output on the right is correct. Why is the output on the left different? Example vi is attached.
0 Kudos
Message 1 of 5
(2,943 Views)
Hello LabTech,

that's an easy question: The output is different because of the different formatting...

On the left you format your boolean to a number (0/1) and then you format this number into a string "0"/"1". This string is displayed hex formatted (right click on your indicator!) thus resulting in a "30"/"31" (=ASCII value of "0"/"1").
On the right you just append the strings "00"/"01" which are different from the ASCII representations of numbers!
A "hex formatted string" has a different meaning to "hex formatted display"...

You better define what you need and then do the correct formatting!

Message Edited by GerdW on 04-18-2006 04:37 PM

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(2,934 Views)
On the left you are sending the hex value "30" that is the ascii char "0" while on the rigth you are sending directly the hex value "0" that is the ascii NULL character.
Regards
CLD - Labview Certified Developer
0 Kudos
Message 3 of 5
(2,920 Views)
Thanks antea06. I got it now.
0 Kudos
Message 4 of 5
(2,906 Views)
Probably the easiest way to get the right result from a boolean would be to typecast it, you'll get 0 for false and 1 for true.
 
 

Message Edited by altenbach on 09-12-2006 06:20 PM

Message 5 of 5
(2,820 Views)