02-13-2021 12:57 AM
Hello community!
I am trying to do serial communication with LabVIEW. I am using very simple program of read and write. I get the result as shown in following picture. What I want is to get the result given in the following format as shown in picture took from pdf. Please assist how I can change the output string to those meaningful values as given in details of following picture.
Solved! Go to Solution.
02-13-2021 04:27 AM
Hello Rahman,
The output which you have shared looks like a hex code. I don't know the exact details that you are looking for from the picture you have shared. b-But you can search "hex to ascii" in order to learn string conversion of the codes you receive in output.
02-13-2021 10:39 AM
02-15-2021 08:44 AM
Could you attach the full PDF? Either we're not seeing enough of the message you supplied or you are showing the wrong message. I'm also worried about this message since it seems to mix ASCII and binary/raw/hex data formats. Again, we need a lot more information in order to really help.
02-15-2021 09:11 AM
Data described in the doc start at the 5th byte of the read buffer, which is 47 hex = G (ASCII) = header byte.
Next byte (Gauge type) is 49 hex = I (ASCII) = Ion Gauge.
Next byte (Gauge number) is 31 hex = 1 (ASCII) = Ion Gauge 1
Next byte (Gauge status) is 40 hex = 0100 0000 bin, that is only bit 6 is high, as stated in the doc
Next byte (Gauge error) is 40 hex = 0100 0000 bin, that is only bit 6 is high, as stated in the doc
To extract a given character (e.g. Gauge type), use the String Subset function.
To extract a value (e.g. Gauge status), use String to Byte Array function then pick the desired value from the resulting U8 array.