Example Code

Programmatically Read Selected Ring Value Without Property Node

Code and Documents

Attachment

Introduction

This very brief example shows how you can read the selected value of a ring control in an indicator, without the use of property nodes in the final code. It is a two-step process; first to build an array of the ring values and save this as a type def. Then, use this type def to reference the selected value and write to an indicator.

Steps to Complete

Simply run the example .vi to see the indicator return the number. The ring was taken from a default control for setting DAQ data rate.

I wanted to use this data rate to write a value (a frequency that related to the data rate). However, I was using Remote Front Panel and the property node I was using was not compatible and so had to find another way to read the values.

NOTE: Although the first part of the code DOES use a property node, this is only used to create the array of values quickly. This is not required for the second part of the code (which will be used in the final application). The array of values was saved as a type def .ctl so it is easily accessed.

snippet.png

Eden S
Applications Engineer
National Instruments UK & Ireland

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors