Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

cRIO Module Variable Order Problem

All,

 

In my LV code, I am querying data from a SQL database and then using that data to determine which cRIO channels I want to read (using the All Variables property). Now, to avoid confusion I have renamed all of the cRIO channels to intuitive names (ex: Inline Flow Rate or EUT Phase A Amps). However, doing this renaming has altered the order with which the All Variables property returns the list of channel references. I want the All Variables property to return an array of channel references in numeric order (ex: AI1, AI2, AI3, etc.), regardless of the name of the channel. However, the array is coming out in alphabetical order based on channel name. 

 

Does anyone know how to fix this; other than removing all custom channel names or starting each name with a numeric?

 

The attached picture shows both the implementation of the All Variables property node and (on the left hand side) the way in which the channels have automatically reordered alphabetically.

The order shown in the project window is the same order in which the reference array is being returned.

0 Kudos
Message 1 of 3
(5,489 Views)

Hello Chris,

 

Thank you for posting your question.

 

When operating in Scan Engine mode, the variables order alphebetically and other ordering methods are not available.

 

Scan Engine has been built upon user-defined I/O variables, which behave similiarly to network-pusblished shared variables. Based on this architecture, the physical channel becomes less important that the user-defined name, as the user-made name defines the variable’s path.

 

To achieve both the desired ordering and custom names, your suggestion of using a enum or physical channel prefix would work brilliantly.

Cameron
Message 2 of 3
(5,437 Views)

FrisbeeArrays,

 

Thank you for your quick and concise answer! I will just have to restructure my names to fit the requirements.

 

Chris

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