10-14-2020 04:22 AM
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!!
10-14-2020 04:34 AM
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!
10-14-2020 07:14 PM
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.
10-15-2020 12:54 AM
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!