NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to set limit as the module is excuted? in pre or post expression

TS 3.0 LV 7.0

selflearning teststand..

I tried to use limit step in my example which reads the AI and compair it to the limit.
however, it always reads the value which is there already. the AI value is updated when the LV is excuted. in order to get the right value, I have to set it at previous step. I have searched some posts here, and I found that using the expression in pre or/and post could fix that. but it still didn't work properly.

how to make the step compare the result obtained in current step?

thanks a lot for your input..
0 Kudos
Message 1 of 6
(3,579 Views)

Hi,

Can you post a small example showing your problem.

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 2 of 6
(3,541 Views)
Thank you very much for your reply. I think my question is quite simple, however, I just couldn't figure out how to do it.

attached is the simple sequence file, which uses a labview proprgram reading on USB6009's AO_1 to AI_2, and compares the AI to limit. It's just a very simple test code to test the AI/AO of labview and test sequence.

here is problem.

at first step, I set AO to zero. At econd step, AO was set to 3 and it is supposed to get 3 from AI and compare "3" to the limit. However, the result shows that the program reads the 0 which is set on first step and gives "failed". At fourth step, AO is set to 4, but the program uses the result "3"  to compare with current limit. I thought the problem was on pre and post expression,  andI had tried to fix it by setting the pre and post expression. I just couldn't fix it...

thanks again for any help. I know my question seems simple...:-(
Download All
0 Kudos
Message 3 of 6
(3,536 Views)

Hi,

Lets take the Sequence File first.

First Step - Ok so far.

Second Step - Your input AO Value and outputs AI Measure and Error Out are ok. Report Text should be connected to Step.Result.ReportText. I dont know why you have the Post Expression as you already have AI Measure connected to Step.Result.Numeric. you have some limits 2.8 <= x <= 3.5

Third Step - fine

Fourth Step - same as comment as the Second Step.  Loss the Post Expression. Its not doing anything for you. Limits 3.8 <= x <= 4.2

Fifth Step - fine.

So the Test Sequence should be getting your value you send and comparing with a set of limits.

So the problem must be in the  VI.

How do you know which part of the VI is running first - you dont. You have know way of knowing whether you have sent the AO value first or received the AI input first. By the sounds of it you are getting the AI measure first which is the value sent by the previous step.

Try connecting the Error terminal (error out of DAQ Assistant to error in of DAQ Assistant2) so that AO value is sent before AI Measure is read.

Hope this helps

Regards

Ray Farmer

 

Regards
Ray Farmer
0 Kudos
Message 4 of 6
(3,520 Views)
yep...it works as it is supposed to be. Thanks a lot. one more question.

if the DAQ assitance is not used, how to define the suqenuce in Labview? using the flat sequence structure?

thanks

0 Kudos
Message 5 of 6
(3,518 Views)
Hello gunking,
 
You can enforce the sequence of execution in LabVIEW using the data wires that connect your subVIs, using the error wires that most VIs have, or by using the flat or stacked sequence structures.  Any of those options should allow you to ensure the proper order of execution in your program.
John B.
Applications Engineer
National Instruments
0 Kudos
Message 6 of 6
(3,499 Views)