LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

labview count time in status machine

Hi all

 I have a strange issue in status machine instruct, when set 4s only show 3s,and set 2000 millisecond wait how to set tick 1s increased,thanks!!

 

Download All
0 Kudos
Message 1 of 4
(1,615 Views)

Hi Sam,

 


@Sam.Huang wrote:

 I have a strange issue in status machine instruct, when set 4s only show 3s,


Because of a wiring error in your statemachine. Revise the "exit" state…

 


@Sam.Huang wrote:

and set 2000 millisecond wait how to set tick 1s increased,


Please explain what you are trying here. I don't understand that part of your short message…

 

General recommendation:

Use only pure English names for your files. Otherwise we get into problems when trying to load them on a default English Windows computer!

Best regards,
GerdW


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

Thanks for your comments,I have updated new files and described as below snippets.My code is recode elapsed time in status machine 4s,

1st   0.00s

2nd  1.00006s

3rd   2.00011s

4th   4.00023s

In my mind order is 1.000s,2.000s,3.000s,4.000s why is 3.000s lost or some wrong with that code.

Thanks for all comments.

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

Hi Sam,

 


@Sam.Huang wrote:

In my mind order is 1.000s,2.000s,3.000s,4.000s why is 3.000s lost or some wrong with that code.


Your code does exactly what YOU have programmed to do!

 

This is some kind of race condition in your code:

The wait function runs in parallel to your "time differences adding" code. That "adding" is done much faster than the wait, so the intermediate results seem to lag. The states "exit" and "stop" don't have a wait, so they will be executed within nanoseconds. And the end result will be correct (in the sense of "as expected")…

 

When you want to measure time at a certain point in time then you need to program this using DATAFLOW!

Best regards,
GerdW


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