VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Get Channel 2D Array Values

I was experimenting with the NI VeriStand - Get Channel Value VI. There is an instance for getting a 2D array of values. The note says "Returns the vector values of a single channel". When I call that VI, the 2D array returned has a single element with the current value of the channel. Is there some way to use this VI and actually get the vector values? And what are the vector values?

 

http://zone.ni.com/reference/en-XX/help/372846G-01/veristandmerge/vs_get_channel_value_vi/#instance2

0 Kudos
Message 1 of 4
(6,009 Views)

Hey Kevin,

 

In general, VeriStand treats channels as scalar doubles. DAQ Channels (excluding waveform channels), Calculated Channels, User Channels, etc, are all doubles. So if you read those channels using the 2D array function you will, as you've found, get a 2D array with 1 element. However, when working with models, VeriStand allows you to have inports and/or outports as vectors so that you can pass arrays into and out of the model. When you add a model to the system definition file, on the inports and outports configuration tab, the Vector port specification allows you to split inport/outport vectors into scalar channels or treat them as a single vector channel. Further documentation on this can be found here (Under "Importing Inports and Outports"):

 

Recommendations for Configuring Models

http://zone.ni.com/reference/en-XX/help/372846G-01/veristand/models_recommendations/

 

So, if you had a model output (that was an array) that you had set to "Maintain as vector channel", and read it using the Get Channel 2D Array values, you would see the array of values from the model. 

 

Hope this helps!

 

Ryan_S

Message 2 of 4
(5,968 Views)

Can a custom device have a channel like the 2D inports/outports or the waveform channels?

0 Kudos
Message 3 of 4
(5,959 Views)

This looks like a great help topic you can read. It should answer your questions.

 

The short answer is that custom devices can have waveforms that they can read and write. Custom devices are limited to scalar channels. Some people have worked around this limitation by declaring a group of scalar channels that together represent a vector value by appending indices to the channel names, such as:

 

My Input(0,0)

My Input(0,1)

My Input(1,1)

...

Jarrod S.
National Instruments
0 Kudos
Message 4 of 4
(5,956 Views)