09-11-2018 05:02 AM
Hello,
my program uses a timed loop. In the timed loop the actual position is retrieved at a certain time. My timed loop is repeated after 0.1 s. At the end of period n and before the beginning of period n+1 the program should retrieve the actual position and save the value for a comparison between actual position after period n and actual position after period n+1.
Is there a clever way to solve this task? Thank you for your help.
Sincerely
Guni
09-11-2018 05:06 AM
timed loop, ok.
But use a functional variable (GetSet.vi) to accumulate your data with a time stamp.
Then in a paralleled loop with a lower speed, you unpile the functional variable to a file or database.. up to you.
Benoit
09-13-2018 05:01 AM
Thank you for your Answer.
Should I retrieve SDO 0x6064 multiple times in the timed loop to get the value which comes closest to the loop End? I only want to know the value at the end of the loop. How can I get this value without retrieve the actual position multiple times?
Thanks.
Guni
09-13-2018 05:06 AM
Do you have a sample code?
09-13-2018 05:30 AM
Hi Guni,
I only want to know the value at the end of the loop.
Do you want to read that SDO "at the end" of each iteration (aka as last operation in the loop)? Then use DATAFLOW to call that ReadSDO function as last one per iteration.
Do you want to read the SDO at/after the last iteration of the FOR loop? Then use DATAFLOW to call ReadSDO right after the loop.
Why do you need a TimedLoop for serial communication (CAN is serial!) and (most probably) on a Windows computer?
09-13-2018 05:50 AM
I use the programm for motor control. In the first picture (Case 4/5) are the calculations which are used for the realisation of the movement (second picture: Case 4/31).
In the timed loop the aktual position is retrieved with SDO 0x6064, but the retrieval time is not defined. I need the measured position at the end of every period.
Guni
09-13-2018 12:39 PM - edited 09-13-2018 12:40 PM
Hi Guni,
OMG!
I need the measured position at the end of every period.
What is the end of a "period"?
Simple solution: create a new state "get position", which is called after every "period"!
Before doing that simple step you need to rewrite your VI to use a proper statemachine architecture. Good luck on that!