Next Steps - LabVIEW RIO Evaluation Kit

cancel
Showing results for 
Search instead for 
Did you mean: 

Open Variable Connection Function: inconsistency ?

I am following the tutorial. In the exercise 4, Open-Variable-Connection function is used, where "refnum in" is formed by concatenating strings. No question there.

In the Context help, it says this function has a "data type" input. But in the example VI, it seems this terminal is used to set a initial (default) value for the variable. Right clicking the terminal and choose "create/constant" does that too.

But if I add a "open variable connection" function directly from the function pallete to the block diagram, right click the "data Type" terminal, under the create submenu, the options, "constant"/"control" etc are all grayed out!

See attached screen capture.

What am I missing?

Thanks

Greg

0 Kudos
Message 1 of 2
(5,695 Views)

Hi G373,

Great question! That is a tricky terminal. For this example, we already created the variables in exercise 3 and are hosting them down on the RT target (RT-Host Shared Variables.lvlib), so we had the luxury of already knowing they would be an enum, type definition, or fixed-point data type (and at specific word lengths), so we created the constant first and then wired it to this terminal. The string refnum in is just the path to dynamically access network variables but doesn't actually store any of that variable info (like data type). The expected behavior is to not allow you to create a constant, like you see, instead of say, creating a constant but with some default data type that might not actually match what that variable is.

If instead of using a string refnum you right-click on the shared variable refnum in terminal and select Create>>Constant, then right-click on that constant and select Properties, you CAN specify the data type information for that variable, and in that case the data type input terminal disappears altogether (see picture).

I appreciate the feedback on the usability of this VI; please post any additional questions.

-Deborah

Deborah Burke
NI Hardware and Drivers Product Manager
Certified LabVIEW Architect
0 Kudos
Message 2 of 2
(4,529 Views)