06-28-2012 07:29 AM
hi,
I have a question and I cannot find a good answer which satisfied me.
I have a waveform sampled à 1ms of dt to play on a signal.
My veristand RT target is running with a 1ms of cycle time.
first is it possible ?
second, what is the best method ?
thanks
06-28-2012 08:29 AM
If you are using NI VeriStand 2011 and you have LabVIEW 2011 installed, you might check out the shipping example VI called Waveform Player Example.vi. It is located here: <LabVIEW>\examples\NI VeriStand\API\Execution API\Sequences\Play Waveforms.
Where is this waveform stored? Is it in a file? If so, what type of file?
06-28-2012 09:09 AM - edited 06-28-2012 09:12 AM
Thanks,
I saw this example.
in fact forget the fact that's a waveform I want to play.
I just wants to be sure that is possible for me to update the value of a signal each millisecond through a RT sequence ?
exemple :
While (1)
signals=signals+1
end
If my realtime target is configured with a cycle of 1 ms , does the signals=signals+1 will be executed each ms ?
How are the RT sequenced processed by the engine ? is it one step per ms or can it interpret multiple step in the same ms ?
for example :
while(1)
toto=1
tata =2
end
will the toto =1 and tata =2 expression evaluated in the same ms ?
in this post http://forums.ni.com/t5/NI-VeriStand/Playback-of-an-array-from-labview/td-p/1959595 to process at1ms his waveform processing, he confgured his target to a 7khz cycle time base...
best regards
06-28-2012 10:06 AM
The real-time sequence executes once per iteration of the primary control loop. So if your loop rate is 1kHz, the real-time sequence will execute one of its time-steps every millisecond. A time-step for a real-time sequence means that each active task in the sequence gets to execute until it reaches a Yield statement.
There are two ways to specify a Yield statement. You can drop one directly as a statement from the palette. Generally, however, yielding is done through the optional Auto-Yield property of a loop structure, such as your While Loop. If Auto-Yield is set to true (the default value), then your loop will yield at the end of every loop iteration. So if there are no other yields contained in the body of the loop code, then the loop will run at the same rate as the primary control loop. In your example above, supposing the While Loop is set to Auto-Yield, both toto and tata get updated in the same timestep, once every millisecond.
For more information on sequence timing, you might check out a shipping example located here:
<Public Documents>\National Instruments\NI VeriStand 2011\Examples\Real-Time Sequences\Timing\SequenceTiming.nivsseq
06-28-2012 10:10 AM
In your example, yes, both expressions will be evaluated in the same time step (1ms, if that's your loop rate). RT sequences will execute multiple sequence steps in the same time step. This execution continues until there is a "Yield" in the sequence, at which time execution waits until the next tick on the main VeriStand loop. These yields can occur due to:
For 1., it is also possible to configure a loop to not yield at the end of each iteration. With this, it is possible to execute multiple iterations of the loop in a single time step. You can configure this behavior by clicking on the loop step and unchecking the "Auto Yield" option in the Property Browser.
Hope that helps!
Devin
06-28-2012 11:37 AM
Thanks a lot for these explanations !!
I looked on ni.com and in the veristand help to find these infos but I did not find them... maybe i was not looking at the good places.
Just another question :
We gonna use the Veristand API to create RTsequence and to launch them.
Is it possible to launch a RT sequence in the background at the beginning of the test and launch multiple RT sequence after during the test in parallals of these background sequences through the API ?
Best regards