LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

converting numeral systems

Hello,

im sorry if I post this in the wrong section or if its been awnsered already,  I couldnt find it anywere. I also dont know if it costumary to ask such questions. If it is not, then im sorry for this question.

Im a teaching assistent on a school in the netherlands and mu colleges asked if I could make a little program for them to use in class. Because I had some experiance with Labview I thought why not. After trying for some hours, I realized that I was much harder then I expected. So I thought, maybe I can ask some help fomr experts on the interent.

Here is the thing: I would like to make a program that can convert numbers from one numeral system, to an other. It has to convert decimal numbers to all other systems(up to hexadecimal) and all other systems(up to hexadecimal) to decimal. Whith this program, the students could get a nice feeling of how the systems work.

Now my question is if someone could help me with this. Is there maybe already a program like this that I could use as an example? or could maybe someone give me an example on how to convert, lets say hexadecimal to decimal, in a way that I could use to the other convertions? Just a starting point would be nice.

Ow, and I forgot to say I have labview version 7.1

I appreciate the help.

Sjaak Pieterse

Message Edited by Support on 05-26-2006 08:10 AM

0 Kudos
Message 1 of 9
(1,150 Views)

The easiest method for conversion requires no coding at all.  Place a Integer numeric control on a front panel, right click on it and check visible items>radix.  Now a little radix indicator  will appear to the left of the number.  Left click on this and select between decimal, hex, binary octal or SI notation.  You can also easily write code for this if you would like but this is the easiest possible answer.

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 9
(1,132 Views)
is this what you want?  you can select which number system the input is in, and which number system the output is in.

Message Edited by Elsa Fung on 05-25-2006 07:52 AM

*

Message Edited by Elsa Fung on 05-25-2006 07:52 AM

0 Kudos
Message 3 of 9
(1,127 Views)
Do you want base 2, base 3, base 4, base 5, ... through base 16? If so, that is more involved than Paul's approach. I worked out the theory behind doing this many years ago (before LabVIEW). It sounds like an interesting exercise in LV programming. Some questions: Integers only or real numbers (with fractional parts)? Non-negative or including negative numbers? What range of numbers (maximum value) to be converted?

Post what you have done so far, along with your LV version and what specific problems you may be having.

Lynn
0 Kudos
Message 4 of 9
(1,120 Views)
I got kind of bored, so I edited the VI to check for error now.  So if you string contains invalid character (example: "1241" as input while the input system is binary), it'll pop up with an error and treat the invalid character as 0s (example "1241" in binary -> "1001")
Message 5 of 9
(1,103 Views)
Thanks Elsa Fung. The program you posted works great.  Where did you got it from? did you make it yourself? Is it ok for me to use it? I dont want to use any programs without the maker's aproval.

Sjaak

0 Kudos
Message 6 of 9
(1,089 Views)
Hello Elsa,

what kind of LabView do you use? After loading your vi into LV7.1 I got an error: "Invalid property node" regarding to the 2 property nodes in the second frame.
What kind of properties are these? Where do you have them from?

Just wondering...

Message Edited by GerdW on 05-26-2006 09:58 AM

Best regards,
GerdW
CLAD expired, using LV2011SP1 + LV2017 (+LV2019 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

0 Kudos
Message 7 of 9
(1,079 Views)
Hello Elsa,

I was bored too 🙂 And so I made some small changes to your vi.

Best regards,
GerdW
CLAD expired, using LV2011SP1 + LV2017 (+LV2019 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

0 Kudos
Message 8 of 9
(1,074 Views)

I wrote it myself, so use it however and whenever you want to, of course you can make changes to it too, I don't really care ^_^

The property nodes were to close the VI after running, LV7.1 might not have the same properties, so if it doesn't work, just delete it.  What happen is, if you click on Quit, the VI will stop running, but the front panel is still open.  By adding the Close FP, the front panel will close too.

This is probably going to be my last LV program... I'm actually switching jobs, so I won't be using LV anymore or have access to use it ^_^

Good luck guys!

0 Kudos
Message 9 of 9
(1,060 Views)