VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Model Output versus User controlled Output

Solved!
Go to solution

 

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 

 

0 Kudos
Message 1 of 8
(6,076 Views)
If a channel is mapped is mapped... It's values are from it's source mapping. If you need to change this at run time, you could fault the channel (and there is API for this as well) or perhaps create a model that is basically a switch... And use it as either a pass through or a fault.
Stephen B
Message 2 of 8
(6,067 Views)

You could also use a conditional calculated channel as a switch instead of creating a model.

Message 3 of 8
(6,056 Views)

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.

 

0 Kudos
Message 4 of 8
(6,050 Views)
Solution
Accepted by topic author LDBM

I see.

 

You can use the system defintion API call "get mappings" to get a list of mappings.

 

get mappings.png

 

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.

 

get active mappings and channels.png

Stephen B
Message 5 of 8
(6,040 Views)

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.

Scott A
SSP Product Manager
National Instruments
0 Kudos
Message 6 of 8
(6,036 Views)

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.

0 Kudos
Message 7 of 8
(6,028 Views)

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

Stephen B
Message 8 of 8
(5,932 Views)