LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to record time when the relay button is pressed?

Hi,

 

In my vi, I'm trying to record the exact time when I pressed the "start" button, which sends a signal to a relay. Could someone point me to the right function in the labview to use? I tried several in the "Timing" module but most of them seem to be too complex. 

 

Thank you!!

0 Kudos
Message 1 of 10
(4,395 Views)

Get Date/Time in Seconds

Example_VI_BD.png

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
Message 2 of 10
(4,388 Views)

Or if you are not into Event based programming you can poll in a loop.

Carre.PNG

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 3 of 10
(4,353 Views)

@Cheeseki wrote:

 

In my vi, I'm trying to record the exact time when I pressed the "start" button, which sends a signal to a relay.


Terms like "exact time" do not exist in programming, you always need to specify what kind of jitter is acceptable. (Seconds? milliseconds? nanoseconds?). Also there is slight (and possibly random) delay between the time the start button is pressed and the relay reacts. Which time is more important?

Are you interested in absolute time (date, time) or e.g. a relative time of other event (other button presses, system response, etc.) compared to this button press.

 

What are you doing with the time information? For example are you waiting for a system response?

 

Is this on plain Windows, RT, or FPGA? Is this a button on your front panel or a physical button connected to your DAQ hardware?

 

Until we have a much clearer picture of your application, we cannot answer the question.

0 Kudos
Message 4 of 10
(4,320 Views)

Hi altenbach,

 

Thank you for the reply. The relay will trigger out an accident in the system, and the temperature, pressure, O2 concentration etc will response to the accident. The time when the relay reacts is of interest but can it be recorded because of the random time delay? As to the accuracy, seconds will be fine.

 

It is on plain windows. 

 

Thank you!

0 Kudos
Message 5 of 10
(4,292 Views)

Hi aputman,

 

Thank you for the reply! I'll try it with the system. 

 

 

0 Kudos
Message 6 of 10
(4,291 Views)

Hi RTSLVU,

 

Thank you for the reply! I'll try it.

0 Kudos
Message 7 of 10
(4,290 Views)

So, the button press basically defines "time zero" for the remaining measurements and absolute "date&time" is less important.  You still have not told us about your hardware, but if you would do a hardware timed acquisition on all channels, and also measure the relay output on one of them, you'll have everything on the same accurate time base and you can analyze everything later.

0 Kudos
Message 8 of 10
(4,277 Views)

@aputman wrote:

Get Date/Time in Seconds

Example_VI_BD.png


aputnam,  Look at the left hand side nodeSmiley Wink


"Should be" isn't "Is" -Jay
0 Kudos
Message 9 of 10
(4,265 Views)

@JÞB wrote:

@aputman wrote:

Get Date/Time in Seconds


aputnam,  Look at the left hand side nodeSmiley Wink


That's the same as "tick count", and only useful for relative measurements.

0 Kudos
Message 10 of 10
(4,260 Views)