10-26-2012 12:46 AM
I'am attaching one VI where , read string after the VISA serial which is put to the hexadecimal conversion . This should give the converted decimal number at the number label. But it's not providing that. So can you send me a solution for this.
Solved! Go to Solution.
10-26-2012 01:05 AM - edited 10-26-2012 01:15 AM
Well, how does the received string look like? (the display is set to \codes, so maybe it is not formatted as you seem to think)
Can you run your VI until the "read string" indicator contains data, then make the current value the default, save the VI under a new name, and attach it again?
We cannot tell what you are getting. Your current code assumes a formatted hexadecimal string, exclusively containing the characters 0..F.
Since you are sending a U8 numeric typecast to a string, maybe you get a binary string that needs to be typecast back to a numeric fo the correct type instead.
10-27-2012 12:03 AM
I'am attaching the file with default values
10-27-2012 12:31 AM - edited 10-27-2012 12:31 AM
You are reading a single byte and it is NOT a readable character between 0 and F, so trying to scan it as a hexadecimally formatted number makes no sense. Assuming it is a binary string of U8 data type, typecasting will return a 200. Is that what you expect?
(it could also be I8, in which case the value would be -56)
10-27-2012 12:36 AM
thank you for your help
10-27-2012 12:47 AM
(You typically would mark the most helpful answer as solution, and not you own final comment.)
10-27-2012 04:54 AM
your suggestion is good but since that VI will not work in labview 7 can you please sent the methodology of conversion using the VI's and what changes you had made for it. ANd if possibel please sent the VI in labview 7 form
10-27-2012 09:23 AM - edited 10-27-2012 09:24 AM
Sorry, LabVIEW 7 is ancient. You are already typecasting a number to a string elsewhere, so you simply need to do the reverse: typecast the string to a U8 constant.
Create a U8 diagram constant bu placing a numeric diagram constant and setting the representation to U8 (right-click...representation). Wire that as type as follows: (read string is set to hex display, but that is just cosmetic)
10-27-2012 05:17 PM