ni.com is currently experiencing unexpected issues.
Some services may be unavailable at this time.
11-30-2009 09:13 AM
So I have an unusal requirement. Essentially I'm interfacing with a serial board that takes in 4 hex numbers as its commands followed by a line feed (0x0A). If I use string input boxes with the display set to 'Hex', I can interface corrected and the board executes the commands are run correctly.
The issue is that it takes in these hex numbers as one would read them in decimal*. That is 0x01 would be 1 but 0x10 would be executed as 10 not as 16. As I said string inputs as 'hex' displays works just fine.
But I would like to use visual (numeric) indicators in the user interface. Say, for instance, the input is a knob with the scale set from 1 to 16 and I want to send this as hex 0x01 to 0x16.
I tried using the type cast as seen below. It works just fine from 1 to 9 but 10 gets converted to 0x0A rather than 0x10.
Any suggestions of how I can do this? Thanks for your time.
* Don't ask me why it does this...
11-30-2009 09:23 AM
You are typecasting from a number to a string. That is like using the chr$ function in basic.
I don't understand what you are trying to do with this serial board. x10 is hex 10 or decimal 16.
A knob can only be set for decimal values. So 1 to 16 is 16 different values. Hex x01 to x16 is 22 different values. With a decimal based knob, there is no way you are going to get the some of your hex values such as x0A x0B ... x0F.
11-30-2009 09:29 AM
11-30-2009 09:33 AM
11-30-2009 09:33 AM
Ravens Fan wrote:You are typecasting from a number to a string. That is like using the chr$ function in basic.
I don't understand what you are trying to do with this serial board. x10 is hex 10 or decimal 16.
A knob can only be set for decimal values. So 1 to 16 is 16 different values. Hex x01 to x16 is 22 different values. With a decimal based knob, there is no way you are going to get the some of your hex values such as x0A x0B ... x0F.
Advanced editing mode will let you specify "%x" to get a hex display.
Ben
11-30-2009 09:51 AM - edited 11-30-2009 09:53 AM
I was looking at it in LV2009f2. The property sheet had hex display grayed out. And the advanced editing mode didn't allow %x either.
In LV8.6, the property sheet has a weird flickering when trying to pick hex. And the advanced editing mode doesn't allow %x either.
In LV8.5 and 8.2, grayed out on property sheet. Advanced editing mode still doesn't allow %x.
I noticed something interesting. In LV8.5 and 8.2, a valid display string is a lit green LED, an invalid display string is an unlit green LED. In 8.6 and 2009, the an invalide display string is a lit red LED.
So there does seem to be a bit of a bug in LV8.6. But I wasn't able to get any of them to show hex display for a knob.
But Smercurio's property node method does work.
11-30-2009 10:11 AM
Ravens Fan wrote:I was looking at it in LV2009f2. The property sheet had hex display grayed out. And the advanced editing mode didn't allow %x either.
In LV8.6, the property sheet has a weird flickering when trying to pick hex. And the advanced editing mode doesn't allow %x either.
In LV8.5 and 8.2, grayed out on property sheet. Advanced editing mode still doesn't allow %x.
I noticed something interesting. In LV8.5 and 8.2, a valid display string is a lit green LED, an invalid display string is an unlit green LED. In 8.6 and 2009, the an invalide display string is a lit red LED.
So there does seem to be a bit of a bug in LV8.6. But I wasn't able to get any of them to show hex display for a knob.
But Smercurio's property node method does work.
Message Edited by Ravens Fan on 11-30-2009 10:53 AM
You need to set the representation to an integer type in order to display the valua as binary, octal or hex.
11-30-2009 10:32 AM
Jeff Bohrer wrote:You need to set the representation to an integer type in order to display the valua as binary, octal or hex.
You're right. That does make a difference, and does make some sense.
There are still different random assorted bugs among the different versions.
LV2009, grayed out, but advanced editing does work.
LV8.6 and 8.5, seem to be fine on the property sheet.
LV8.2, not greyed out, but neither property sheet nor advanced editing work.
Hmm, you wouldn't think bugs would come and go, and come and go again.
11-30-2009 10:39 AM
11-30-2009 10:43 AM
Ravens Fan wrote:
Jeff Bohrer wrote:You need to set the representation to an integer type in order to display the valua as binary, octal or hex.You're right. That does make a difference, and does make some sense.
There are still different random assorted bugs among the different versions.
LV2009, grayed out, but advanced editing does work.
LV8.6 and 8.5, seem to be fine on the property sheet.
LV8.2, not greyed out, but neither property sheet nor advanced editing work.
Hmm, you wouldn't think bugs would come and go, and come and go again.
Agreed.
NI Please have an App engineer look inot the behaviour of the properties screen for the Knob.
And please add to the attached list that when you show the digitial display, it does not let us set the display format as Hex (even after maining it a U8).
Ben