LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Digital Switch Input with timer

I have a Labview program at work that I am trying to add some analog sensors to (I have already written a separate vi for this). The existing Labview program is .exe and is so old we can't track down the original .vi to edit it. So I am trying to rebuild it. Moist of my experience is using analog and I have not done much in the digital realm. With some help I don't think it will be hard to reproduce. Attached is a picture of the front panel of the .exe program.

 

An external switch, when pressed, turns on an LED on the front panel and starts a timer from 0. Releasing the switch stops the timer and turn off the light. Pressing the switch again restarts the timer from zero. pressing "stop testing" stops everything and writes the "Sample Information" along with the "Time(min)" to an excel spreadsheet.

 

An additional thing I want to add is another column for comments that will also be written to the spreadsheet.

 

Any advice, help, or vi examples are appreciated. Thanks!  

 

0 Kudos
Message 1 of 2
(2,272 Views)

Well, my first question would, what hardware are you using? cRIO, cDAC, etc?  I'm guessing it's in the DAQ family.  In that case you can just follow the DAQmx examples for getting started.  This link here shows how to access various examples and has some walk throughs that might point you in the right direction:

http://www.ni.com/academic/students/learn-daq/digital/

Also, since you're using front panel buttons to control this, I would suggest getting familiar with and then using the Producer Consumer design pattern for handling your user events:

http://www.ni.com/white-paper/3023/en/

 

Message 2 of 2
(2,218 Views)