10-13-2011 05:03 PM - edited 10-13-2011 05:05 PM
I have a simple model acting on AO1 of my system that is generating a hardware analog output on channel 1.
Sometimes, I want to stop the model, (not pause, but stop) and have the user interface directly acting on the AO1 via a control. For this I use the Set Single Channel Value.vi in the Veristand API. The Channel is defined as Targets/HILRT2/Hardware/Chassis/DAQ/Dev2/Analog Output/AO1 (1) , as I believe it should, but for some reason, the
output is not generated...
The model output is also plugged to Targets/HILRT2/Hardware/Chassis/DAQ/Dev2/Analog Output/AO1 and I wonder if (1) and (2) are not conflicting...
Somehow I would like a way to easily switched the control of a given output from a GUI control to a model output, or get the model out of the way if need be...
L.
PS: VS2011, LV 2011
Solved! Go to Solution.
10-13-2011 11:24 PM
10-14-2011 10:31 AM
You could also use a conditional calculated channel as a switch instead of creating a model.
10-14-2011 11:42 AM
Ok, thx for both suggestions. I will give it a try.
In the current context, one thing that would help is this: with the VS API, I generate a "manual list" of my available AOs and for each of them I have a numeric control. This is a basic manual control. By changing the numeric associated with the AO name, this specific AO is activated. Ok.
But, as I was mentioning earlier, to which you confirmed the behavior, if an AO is mapped to a model output as well, then this is an issue. So what I would like to do at this point is to use the API to retrieve the mapping of my model outputs to HW outputs, so I can spot which AO(s) in my manual list are already assigned to a model, and therefore should not be used via user input ?
The reason for this is to have a dynamic list of AOs that the user can control manually at first to study the sytem under test, then activate some models to "spice things up". When models are activated the user has then to be aware of which AO channels aer now under model control.
L.
10-14-2011 03:25 PM
I see.
You can use the system defintion API call "get mappings" to get a list of mappings.
If you don't know what sysdef is running, you can use the execution API call to get system state and even get the available channels.
10-14-2011 03:56 PM
I do believe that the conditional calculated channel will be the easiest way to do go about this. Are you wanting the models, when started, to control certain AOs every time or random ones? If you want the models to control certain channels every time then you can look at the Model Execution Status to inform the user.
10-14-2011 04:09 PM - edited 10-14-2011 04:11 PM
Thx Stephen and Scott. I like the API solution.
I think I have to dig more into the API to see what are all the methods exposed. Not all are implemented as VIs it seems. I will give a try to the two options next week.
More specifically to answer Scott's question: I think for the time being the AOs would be fixed at run time.
What I was hoping though, and maybe this should be another thread, is to programatically assign a set of AOs to a given model before it runs, without having to "re-plumb" the path in Veristand everytime. I have to check the API, maybe the Get method pointed out by Stephen, also as a Set.
Laurent.
10-14-2011 04:12 PM
You should use the system defintion API to do that. See here for all API examples: C:\Program Files (x86)\National Instruments\LabVIEW 2011\examples\NI Veristand\API
and here for sysdef API examples: C:\Program Files (x86)\National Instruments\LabVIEW 2011\examples\NI Veristand\API\System Definition API
The help has LOTS of documentation on the APIs as well