LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do I program a "set once" feature ?

Hi Folks,

I have a little vi task I cannot get my head around.

I am sending commands to a GPIB device and then checking for any errors by sending the command SYSTEM:ERROR?
When a command is malformed it can generate more than one error.
This can also happen when a function on the GPIB device conflicts with it's current setup.

Now, I have a little Do-While loop that takes care of reading back all the errors until the list is clear; indicated by "+0,No Error".

Thing is, if there is an error I want to be able to capture this, but if I use a True/False condition box the final output from the While loop will always be False (no error)
What can I use to set a flag when an error occurs that later will not be reset when I receive the "+0,No Error" reply ?

Many thanks,
Bob.
Uk.
0 Kudos
Message 1 of 4
(2,624 Views)
Hello mad_bob,

use a shift register to hold the flag and a boolean or to set it. Set the shift register to Old_Error OR New_Error. This way you cannot clear old error flags with the last "no error" condition.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 4
(2,616 Views)

You can also pass out an array of booleans (auto index the error? flag out of your while loop to build the array) corresponding to a error flag for each error condition tested, or the array af any case is true (error is true) then the status will be true as well.

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
Message 3 of 4
(2,606 Views)
Bob,

Here is a VI I wrote while testing an HP instrument which behaves much like what you have described. Perhaps it will assist you.

Note that this VI will NOT stop unless the instrument responds with '+0,"No\serror"\n'. If you are going to use it as a subVI in a larger project you will need to add a limit, such as the maximum number of errors the instrument buffer will hold (20 on my instrument).

Lynn
0 Kudos
Message 4 of 4
(2,598 Views)