LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview Time log

Hello, I have somewhat of a general understanding regarding LabVIEW however I feel others are without a doubt way more experience in it then me, regardless I want to create a system that can log the current time whenever a button is pressed on (that logged time can be expressed on a string indicator) and log the current time whenever a button is pressed off.

0 Kudos
Message 1 of 3
(148 Views)

@TyTibbs wrote:

Hello, I have somewhat of a general understanding regarding LabVIEW however I feel others are without a doubt way more experience in it then me, regardless I want to create a system that can log the current time whenever a button is pressed on (that logged time can be expressed on a string indicator) and log the current time whenever a button is pressed off.


I would simply configure an Event Structure with a value change Event for your button.   The Time of the Event is available from the left side data node and represents when the Event fires,  rather than when the Event starts processing,  There is a Time to string primitive on the String Manipulation palette. 


"Should be" isn't "Is" -Jay
Message 2 of 3
(143 Views)

@JÞB wrote:

@TyTibbs wrote:

Hello, I have somewhat of a general understanding regarding LabVIEW however I feel others are without a doubt way more experience in it then me, regardless I want to create a system that can log the current time whenever a button is pressed on (that logged time can be expressed on a string indicator) and log the current time whenever a button is pressed off.


I would simply configure an Event Structure with a value change Event for your button.   The Time of the Event is available from the left side data node and represents when the Event fires,  rather than when the Event starts processing,  There is a Time to string primitive on the String Manipulation palette. 


Someone will point out that the node outputs the millisecond timer tick.

 

Bonus points for the community member that actually writes the lvlib to convert ms tick to Timestamp.

 

Note you will need an AE that stores; the timestamp when ms was 0 , and the latest ms timer value when called.

Init would call get Timestamp and a 0ms Wait to get ms value now and subtract those milliseconds from current Timestamp to get t0

Get Timestamp from ms would:

  • Compair ms input to last call ms value (if now is less than then ms timer rollover occurred and max I32 must be added to t0)  HINT: put in some hysteresis say, 20,000msec just in case.
  • Add ms now to t0 = Timestamp 
  • Return Timestamp 

This tells you the time of the button presses rather than the time the Event processes.


"Should be" isn't "Is" -Jay
Message 3 of 3
(128 Views)