Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

LV2009: How to aggregate SV refnums

Solved!
Go to solution

I would like to aggregate SV refnums but can only do this in windows using the variant data type.

On the cRIO this does not work.  Is there any other way to accomplish this?

0 Kudos
Message 1 of 5
(4,022 Views)

Forgot to mention that I get a -1967362038 error code when running on the cRIO.

 

0 Kudos
Message 2 of 5
(4,019 Views)
Solution
Accepted by topic author viScience

The variant data type only works on the windows platform, it was disabled for rt apparently since it is too cpu intensive.

The only solution for RT is to use clusters of arrays of similar data types.

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

It appears you are trying to access an IO Variable on an Ethercat slave.  However, from your screenshot, I couldn't tell if you were trying to access the variable from a local machine or a remote machine.  If you're trying to access it remotely, you should be able to use a variant data type.  The protocol for publishing across the network will automatically perform the data type conversion for you.  If you're trying to access an IO Variable locally, you have to use the exact data type of the IO channel in order to successfully open a connection to it.  If you don't know what this data type is ahead of time, you can use the DataType property in the Variable property node to programatically determine the correct type. 

 

With all of that said, the error code from your previous post implies the variable wasn't found within the variable engine.  If you're trying to access an IO variable remotely, make sure you've deployed all of your variables, and that you've enabled networked publishing.  One difference between using the static variable node and the programmatic API is that when using the programmatic API, the variables won't be deployed for you automatically when using the development environment.  You'll have to do this manually each time you make a change to one of the variables.  With the static variable node, the development environment does this for you since it knows which variables are being used in the VI you are about to run.  With the programmatic API, this isn't possible since the actual variable being referenced isn't known until run time.

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

SV Test.png

 

VI Snippets can be directly placed in the forums 🙂 

0 Kudos
Message 5 of 5
(3,978 Views)