How Do I Make a 2D Array Shared Variable?

Updated May 20, 2024



  • LabVIEW Real-Time Module
  • LabVIEW Datalogging and Supervisory Control Module

I have data that is in a 2D array that I want to pass to another program or bind to an OPC Tag, but when I make a shared variable there isn't a 2D array data type. How can I make a 2D array shared variable?

There is no option to create a 2D array shared variable, but you can create a 2D array custom control and then create a shared variable from that custom control.

Create a 2D Array Custom Control
  1. Add an array constant to the front panel.
  2. Place a numeric control in the array constant.
  3. Right-click the array index and select Add Dimension from the shortcut menu.
  4. Right-click the 2D array of numeric controls and select Advanced>>Customize from the shortcut menu.
  5. Select File>>Save As to save the custom control.
Create a Shared Variable from a Custom Control Data Type
  1. In a LabVIEW project, right-click My Computer and select New>>Variable from the shortcut menu.
  2. In the Shared Variable Properties dialog box, select From Custom Control from the Data Type pull-down menu.
  3. Select the previously created 2D array custom control.
  4. Click the OK button.