From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Separate decimal number to array of numbers

Hi there,

 

I need help with Labview. I am currently doing a basic calculator project, whereby the output value is to be displayed on 7-segment. I'm only using 3 7-segments, so the maximum output value is 999.

 

My question is, how do I convert decimal numbers into separate arrays, so that it can be displayed on the 7-segment. For instance, if the output is 100, I need to display 1 on the 1st 7-segment and 0 on the 2nd and 3rd 7-segment.

 

Thank you for your time and assistance.
Kaye

0 Kudos
Message 1 of 11
(4,645 Views)

Why make it more complicated than it has to be?

0 Kudos
Message 2 of 11
(4,642 Views)

Thanks for the reply. I am actually using a NI-DAQ 6009, which is then wired to the 3 units of 7-segments.

 

I need to separate the decimal output into separate arrays so that the 1st array contains the value of the hundreds decimal point, the 2nd array contains the tens decimal point and the 3rd array contains the ones decimal point. This arrays are then used as outputs and will display each array value separately on the 7-segments.

 

Example: Output is 489, so the 1st array contains 4, 2nd array contains 8 and the 3rd array contains 9. Therefore the 1st 7-segments displays 4, the 2nd 7-segment displays 8 and the last 7-segment displays 9.

 

Thanks for the help.

0 Kudos
Message 3 of 11
(4,639 Views)

Please, you don't have to explain what you want to do. It's very clear. What I don't understand is why you think you 'need' to do this. You could be the next addition to the Rube Goldberg thread.

 

If this is some academic excercise, show what you have tried so far? It would seem you could at least have converted to a string and gotten each character.

0 Kudos
Message 4 of 11
(4,636 Views)

This is the part of the project that we are having problem with.The output needs to be separated, but we dont know how to do it.

0 Kudos
Message 5 of 11
(4,625 Views)

Make an array for numbers 0-9 consisting of a Byte with the bit pattern needed to print each character.

 

Then to you only need to wire your number, e.g. '1' to this array and you'll get the 2nd value which could be sent directly.

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 6 of 11
(4,617 Views)

@aPpErEnTiCe wrote:

This is the part of the project that we are having problem with.The output needs to be separated, but we dont know how to do it.


That makes no sense. I still think what you are trying to do is a waste of time but if you want separate digits, you can do this.

 

 

I've asked twice why you are doing this. Why don't you answer this very simple question?

0 Kudos
Message 7 of 11
(4,615 Views)

@Dennis Knutson wrote:

@aPpErEnTiCe wrote:

This is the part of the project that we are having problem with.The output needs to be separated, but we dont know how to do it.


That makes no sense. I still think what you are trying to do is a waste of time but if you want separate digits, you can do this.

 

 

I've asked twice why you are doing this. Why don't you answer this very simple question?


My guess is that this is a class assignment and controlling the separate part sof the 7 segment dsplay is part of the problem. This sounds a lot like a typical homework assignment.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 8 of 11
(4,601 Views)

Hi,

 

Thanks for the replies. We are doing this project actually for a short semester subject, where we are required to come up with project ideas, and we descided to create a simple calculator whre the output will be displayed on the 7-segment.

 

We have connected the circuit, and we get an eror when we execute it. We get an error msg if the output is less than 100.

Download All
0 Kudos
Message 9 of 11
(4,573 Views)

Sorry. Use Format Into String with %03d as the format specifier.

0 Kudos
Message 10 of 11
(4,568 Views)