LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Scanned variable read function - all channels

Solved!
Go to solution

Does anybody know a way to read all channels of a c-series module with one function? The below archived white paper shows all channels on a module can be read with the scanned variable read function, but when i do this, i get the attached error. I'd prefer one function icon that outputs an array instead of, for example, dragging and dropping 32 I/O shared variables then wiring these to a build array function.

 

http://www.ni.com/white-paper/8071/en/

 

Thanks guys!

0 Kudos
Message 1 of 6
(3,271 Views)

What c-series module are you trying to perform the scanned read with? I just tried a 9205 and a cRIO-9033 running LV2017, and it worked without error.

 

If you right-click the refnum, then expand Select Variable Class, what's the current class type? Note mine is listed as a 9205 Variable Container:

refnum_class_type.png




Certified LabVIEW Architect
Unless otherwise stated, all code snippets and examples provided
by me are "as is", and are free to use and modify without attribution.
Message 2 of 6
(3,231 Views)

Good Morning Michael!

 

My setup details are labVIEW 2015 sp1, cRIO9075 with NI 9213 and NI 9207 modules. i drag & drop a scanned variable read function, click the refnum in, create constant. I then click the refnum drop-down arrow, browse. For both browse options, Variable Engines and Current Project, the module is grayed out so selection is disabled. See attached jpg. i can select individual channels, but not the module. When i manually edit the refnum text ni.var.io://192.168.1.214/Mod1/TC0 to delete /TC0 and run the code, i get an error. Variable class is shown in attached jpg. 

 

i'll start researching the variable classes, maybe it is a configuration issue. 

 

Ryan - CLD

 

Download All
0 Kudos
Message 3 of 6
(3,220 Views)

I noticed in my previous post i did not set a data type on the scanned variable read function first before creating the refnum. when I wire a array of double, and try to read Mod1, i get error "-1950678944 Scanned Variable Read in Untitled 4.vi". 

0 Kudos
Message 4 of 6
(3,217 Views)

Did you check out this white paper too:

http://www.ni.com/white-paper/7338/en/

The first one you linked has been archived and was published 8 years ago, the above was last updated earlier this year and deals explicitly with cRIO and the Scan engine

 

James

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 5 of 6
(3,215 Views)
Solution
Accepted by topic author Ryan01

I got it!!! Selecting the correct class was the trick. I did trial and error by selecting every type of variable class one at a time. The below class worked for getting all module channels. 

 

Thanks mike for pointing me in the right direction!

image.png

0 Kudos
Message 6 of 6
(3,213 Views)