LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a timer on a seven-segment LED display (myRIO 1900)

Hi!

 

I am working on a project where I would like to display a stopwatch on a seven-segment LED display using the myRIO-1900 microcontroller (not the front panel on LabVIEW, instead, on an actual LED display). Like a real stopwatch, once a button on the myRIO 1900 has been pressed, the LED will start counting (in seconds), and stop counting once a different button has been pressed. 

 

I am pretty new to LabVIEW, and I wanted to get some feedback on my "pseudo-code."

 

I was looking at using a flat sequence and setting a timer to each frame to be 1000 ms, equivalent to 1 second. In each frame, I will use the Digital Output from the myRIO subpalette and an index array to specify which segments of the display are required to be lit to display the corresponding time. 

 

The idea is that each frame of the flat sequence will contain the configuration of the corresponding time. e.g. the first frame will manipulate the LED display to show '1', and the second frame will show '2,' etc. I will have all of this in a conditional statement, which will execute when the start button has been pressed. 

 

I was wondering if this will be feasible? I am looking at counting for around four minutes, and I imagine it will get incredibly tedious, with many many frames in the flat sequence. I have tried looking around on the net at other ways of achieving a stopwatch VI but I have difficultly understanding it. 

 

I appreciate any guidance.

 

Thank you!!

0 Kudos
Message 1 of 4
(1,925 Views)

Hi Michellly,

 


@Michellly wrote:

I am pretty new to LabVIEW, and I wanted to get some feedback on my "pseudo-code."

I was looking at using a flat sequence and setting a timer to each frame to be 1000 ms, …

The idea is that each frame of the flat sequence will …

I was wondering if this will be feasible? I am looking at counting for around four minutes, and I imagine it will get incredibly tedious, with many many frames in the flat sequence.


Some notes:

When you are new to LabVIEW then you really should take care of those "Training resources" offered in the header of the LabVIEW board!

You didn't attach any "pseudo-code"…

Try to NOT use sequences frames, neither flat or stacked ones…

Your approach is not feasible!

 

Ever thought about using a loop to iterate once per second?

Ever thought about splitting your problem into "software side" and "hardware interfacing"? In the first step you can show that counter on a frontpanel, in the next step you might think about interfacing your external LED display…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(1,900 Views)

Hi GerdW,

 

Thank you for the advice. I have since split my problem into software and hardware. The software aspect has a timer, that displays the time in seconds onto the front panel using a numeric indicator. I am now trying to interface this with  my external seven segment LED display. I have been looking at creating a property node of my elapsed time numeric indicator and wiring this into a case structure, where each case corresponds to the elapsed time, ie. 1 second, 2 seconds, etc. Inside each case, I will make the required connections to light up the corresponding segments on the LED display to show the required elapsed time. Is this approach feasible (albeit highly inefficient)? I am having trouble trying to think of another, more efficient way of interfacing my timer software aspect with the LED display.

 

Thank you. 

0 Kudos
Message 3 of 4
(1,853 Views)

When you need to turn a specific LED on or off, that would be a digital output.

So you need to use 7 digital outputs to trigger the 7 LED's in a 7 segment display.

 

Search the forums for 7-segment displays as I'm quite sure you'll find some questions and examples where people have solved the same problem.

0 Kudos
Message 4 of 4
(1,846 Views)