LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

rt References to Controls Real-Time VI

I am attempting to build an instrument using an FPGA/RealTime board.  With the instrument I would like to incorporate a touch screen panel.  In order to make a more seemless integration of the display, I need to make a reference array of the controls.  With this array I can transfer values from the controls to the display panel using a simple for loop.  However all my attempts at constructing a reference array have failed.  I assume that this is due to controls in a RealTime VI being "virtual".  Is there any way to get at the control values using references in an array?

 

If I cannot do this task, then I must manually place all controls in the for loop, making for very clumsy coding.

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

Can you be more specific than "have failed"?  What specific error are you receiving?  Can you share a screenshot that shows what you've tried to do?  What sort of board or system are you using?  Are you using a touch screen panel from NI, or from somewhere else?

 

I don't know what you mean by controls being "virtual" but VIs in RT systems don't have full-featured front panels and many methods and properties of front panel controls don't work, or don't work normally.  Also, if you have a dedicated PC running the RT operating system, you won't get the VI's front panel on the display, you'll just get some processor use statistics.

 

If you need a full-featured front panel for a VI running on RT, you need to write a separate program for the user interface, and set up some communication system (shared variables, TCP, etc).

0 Kudos
Message 2 of 5
(2,770 Views)

Yes, that is exactly what I am trying to do, write separate code to send data from the controls to my touch screen display (over serial communications).  My RealTime VI has almost 100 controls that hold data.  I want to transfer the data from the controls to the touch screen display, based on what page I am trying to display on the touch screen.  I find that I cannot construct an array of references to the controls in my VI.  If I could construct such an array, I could use a for loop and an output map (csv file) to map the controls to the touch screen. 

 

Without the array of references, I must manually position each control into the for loop, in its own case structure, to get its value and send it to the touch screen.  This is very clumsy and I am looking for alternatives.

0 Kudos
Message 3 of 5
(2,767 Views)

For good perfromance in RT I avoid controls and indicators like the plague (FPGA is an exception).

 

I would concider uisng an Action Engine to store all of your values. Any code that want to know the data will look ot the AE for the information. If it is time to update an value the "Update" method can include the logic to push the update to the serial as required.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 5
(2,762 Views)

Uh oh... first impression, if you're storing data in controls on an RT target you're doing something wrong.  Data should probably be in clusters in shift registers.  I can't picture how an array of references helps you.  Are you trying to transfer the references themselves to your user interface program?  That won't work - references are local to the application that generates them.  How are you transferring the data between the RT system and the user interface program?  Shouldn't be necessary to use a for loop with a case structure.  The easiest solution is often to transfer an entire cluster, then unbundle out the items.  If both the RT and user interface share a cluster type definition, the cluster names stay consistent and it is easy to unbundle the right data to the right indicator.

 

Again, could you elaborate on "cannot construct"?  What steps are you taking?  What error occurs?  An image of your code would make it a lot easier to provide good suggestions.

Message 5 of 5
(2,761 Views)