VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Timeout setting for Realtime-Sequence execution

Hello,

 

I'm referring to the "Timeout" setting in the stimulus profile editor or the "Timeout" parameter of the SequenceCallInfo Constructor. The description of this parameter is as follows:

The timeout in milliseconds within which the sequence must complete each time step.

What exactly is this parameter good for? I understand that each task in a realtime sequence is executed once per PCL iteration and that the "time step" of a task is completed when the control flow reaches a "Yield" statement (or the end of a loop with autoyield enabled).

 

When I'm running a sequence where a timestep takes longer than the PCL period, the VeriStand engine will abort and undeploy the system definition. In my case the PCL rate is 2KHz so isn't the timeout implicitly given as 500us?

 

I thought that maybe I can use the timeout parameter to set an additional timeconstraint from "greater 0 to less than PCL period". So for example if I set it to 0,1ms, the realtime sequence would have to hit a Yield statement within 100us. But this doesn't seem to be the case either because the realtime sequence is not aborted and it still stops the VeriStand engine.

 

Thanks

Krid

 

 

0 Kudos
Message 1 of 6
(5,217 Views)

The timeout parameter is not automatically set to the period of the PCL, I don't think. You'll have to supply a value when you deploy the sequence. The main use cases of the timeout are the following.

 

1. Restrict sequence execution time within a period of the PCL if the PCL should never be late.

2. Helps debug and protect against sequences that might have an infinite or long-running loop in them that don't have auto-yield enabled. The timeout will at least help you abort the sequence rather than locking up the entire controller.

Jarrod S.
National Instruments
0 Kudos
Message 2 of 6
(5,198 Views)

Hi Jarrod,

 

thanks for your answer but your second use case is exactly what I tried to do. The VeriStand engine is still aborted even when I run the sequence with timeout set to 0,01:

Error -307743 occurred at NI VeriStand Engine.lvlib:VeriStand Engine Wrapper (RT).vi >> NI VeriStand Engine.lvlib:VeriStand Engine.vi >> NI VeriStand Engine.lvlib:VeriStand Engine State Machine.vi >> HP Loop.lvlib:HP Loop Main.vi

I just tested it again and the first time I started the stimulus profile, the realtime sequence actually was aborted and the VeriStand engine continued to run. Then I started the stimulus profile a second time (without changing anything) and this time the profile was not aborted and hence  the VeriStand engine was stopped. It's also not possible to stop the profile in stimulus profile editor. It just hangs and I have to kill it.

 

After this happened it's also not possible to run any other realtime sequences (they will simply not start but no error message is returned).  One has to completely close down VeriStand (just re-deploying doesn't work) and restart it before it works again.

 

Why isn't the timeout parameter working as it's supposed to?

 

Regards

Krid

 

 

0 Kudos
Message 3 of 6
(5,190 Views)

Hi guys,

 

here is a similar case, which should be interesting for you.

Especially the second page, there is the same error code;

 

reflective memory setup in Veristand

http://forums.ni.com/t5/NI-VeriStand/reflective-memory-setup-in-Veristand/td-p/2563601/page/3

 

best regards

Richard

0 Kudos
Message 4 of 6
(5,166 Views)

Hello Richard,

 

over the past 2 years we have run into error -307743 many times, unfortunately. In my experience it says that "something was late" and didn't finish executing within the PCL period. This can happen for many different reasons.

 

In my case it is the realtime sequence that is late and triggers the error. I understand why it is late, my complaint is that the timeout parameter should abort the sequence before it crashes the VeriStand engine. I cannot see that the timeout parameter has any effect, no matter what value I set it to.

 

So although both issues trigger the same error code, I think they are unrelated.

 

Best Regards

Krid

0 Kudos
Message 5 of 6
(5,155 Views)

Sorry, but I have to bring up this old thread. In VS 2015 SP1 the timeout setting has improved but I think it's still not working as expected. 

 

I have a realtime sequence that is doing many operations within a single timestep. When running this sequence, the HP Count channel is incremented and also get DAQ error 209801, indicating that the operations take longer than one PCL period. 

 

I want to use the timeout setting to prevent from these situations. The sequence should be aborted before the HP Count increases and especially before I get DAQ errors. 

 

Using the tickcountus() function I measured the processing time of the rtsequence time step to be 616us. My timeout is set to 0.1ms, ie 100us. Therefore I would expect that the sequence is aborted by VeriStand but this is not happening. When I further increase the processing time to about 1200us, the sequence is finally aborted by VeriStand but only after the HP Count increments and the DAQ error appears.

 

I'm aware that I can just put in Yield statements to breakup the processing into multiple timesteps but this is not the point here. I don't want users to have the possibility to write sequences that can cause DAQ errors and the timeout mechanism would allow me to do this, if it was working as expected.

 

I would appreciate feedback from NI regarding this matter.

 

Thanks & Regards

Dirk

0 Kudos
Message 6 of 6
(3,746 Views)