Example Code

Using VI Server to load data on a queue, hosted on a PC, from a controller PXI RealTime

Code and Documents

Attachment

Overview

The VI Server is a very powerful tool and there are several ways and purposes you can use it for.

This is an example about how to use the VI Server to enqueue an element on a queue, that resides on a HOST PC, from a controller PXI RealTime.

Description

The VI Server provides different instances and if you do not interrogate the right one the PXI RT will not be able to recognize the queue reference that already exists on the HOST PC.

The code provided by this example has been developed to resolve an issue that a customer faced.

The queue is used to host data on the HOST PC and it's monitored by a Main application that waits data to process (data hosted by the queue could be any kind of data type).

A "bridge" VI is used to obtain the reference of the existing queue (on the HOST PC) and to enqueue an element. The "bridge" VI is called from the PXI RT through the VI Server, but it's executed on the HOST PC.

Steps to Implement or Execute Code

  1. Configure a PXI RT (doesn't matter the model, I used a PXI-8195)
  2. Run the "Main.vi" on the HOST PC (this VI creates the reference to the queue and waits for data to process)
  3. Run the "callerRT.vi" on the controller PXI RealTime
  4. Take a look on "enqueuedElement" indicator on the "Main.vi" front panel to see that the number of element enqueued increase
  5. Take a look on the picture attached to the project: it shows the configuration of the VI Server instance running on the PC that the "Main.vi" refers to

Requirements

Software


LabVIEW 2013

LabVIEW Real Time Module 2013

Hardware


PC with LV 2013 installed

Controller PXI RealTime (doesn't matter the model)

Additional Images or Video


screenshoot.png


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

Contributors