VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Variable Replay or How do I change the simulation speed?

Hello,

 

I'm trying to add a control to allow me to change the replay speed of a simulation based upon a user channel in the workspace. (In an effort to reduce a 30 minute real-time simulation to 15/5/3/etc minutes of time). I'd like to do this in real time (hence the workspace control), but I don't seem to have found the proper way of executing this. I stumbled upon the Variable Replay generator in the Stimulus Profile Editor, but again, this doesn't seem to work as I intend. 

 

Can anyone point me in the right direction?

 

TIA.

0 Kudos
Message 1 of 4
(6,073 Views)

After some experimentation I've gotten this to work with two user channels, a calculated channel, and one additional stimulus generator. Essentially I have the additional stimulus generator producing a monotonically increasing Ramp stimulus which is associated with the first user channel. The second user channel is simply a multiplying factor which is used by the calculated channel. The second (original) stimulus generator is then associated with the calculated channel to run through the imported data. 

 

It works well enough, except for one thing. The Ramp Generator has a run time of almost 30 minutes regardless of when the Data Generator ends. As there is no reason to continue the test at this point, I'd like to automatically end the stimulus at this point. Experimenting with 'Stop Profile' doesn't seem to work as it only seems to end on stimulus generator. Is there a way to create an active (while loop type) of 'Conditional' in the Ramp Generator so that when the data ends, the whole stimulus stops?

 

TIA.

0 Kudos
Message 2 of 4
(6,070 Views)

Write to the Generator Engine State system channel.  This should stop the stimulus.

http://forums.ni.com/t5/NI-VeriStand/stop-stimulus-profile-though-procedure/m-p/1334512#M503

 

Steve K

0 Kudos
Message 3 of 4
(6,068 Views)

Steve,

 

That doesn't seem to work. Or maybe it does, but it only stops the single generator? (of which I need to kill the first one...)

 

In my simple test I write to some external channels (an LED) following the variable replay step. I know that this generator ends as the LED comes on, the voltage drops to zero (by design) and then I write to that channel (2, it seems is desired), but the whole stimulus profile keeps going and I have to exit manually.

 

Oddly (and perhaps, unrelated), if I start the stimulus again it doesn't seem to run at all. Once I stop it and run it again everything works.

0 Kudos
Message 4 of 4
(6,049 Views)