Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Document Type: Example Program
NI Supported: Yes
Publish Date: Sep 6, 2006


Feedback


Yes No

Related Categories

Related Links - Developer Zone

Related Links - Products and Services

Multiple DAQ Board Real-Time Control Example Featuring RT FIFOs, VI Server, and TCP/IP Communication

5 ratings | 3.40 out of 5
Print

Downloads

Filename: control_example_lv61.zip
Requirements: View

Filename: control_example_lv60.zip
Requirements: View

The general purpose of this example is to demonstrate the use of RT FIFOs to transfer data between the RT Engine time-critical priority VI and the RT Engine normal priority communication VI, and then further demonstrate the use of VI Server and TCP/IP to transfer data between the RT Engine normal priority communication VI and the Host PC VI.

The control loop in the time-critical VI has a very specific purpose, but it could be modified to do PID on the DAQ device or even to do FieldPoint or other operations on a different RT target.

This control loop monitors a large number of channels across (optionally) an arbitrarily large number of DAQ devices in the system. If the analog voltage acquired on any one of the channels drops below a specified minimum threshold value, DIO line 0 on the MIO board specified will be set to logic high. Once the channel goes back above this threshold, this digital line is set to logic low. For a system with only one DAQ device, you must simply specify this device along with the fact that you are using only one DAQ board. You may also need to reduce the number of channels if you are not using a 64-channel DAQ device.

The absolute minimum voltage acquired across all channels of all boards being used, along with which channel from which board are sent through RT FIFOs to a normal priority communication VI, which then in turn sends these values to the host computer through TCP/IP.

The Host PC VI connects to the RT Engine VIs to receive this TCP/IP data. It also uses VI Server to set some initial parameters on the RT Engine as well as retrieve a final result once the RT Engine VIs complete execution. Execution status of the RT Engine VIs is fully controllable from the Host PC VI.

In order for this or any other RT example using VI Server to run properly, you must verify your VI Server settings by doing the following:
1. Switch Execution Target to your RT system.
2. Open or create a new VI. From the Tools menu, select "Network: Options"
3. In the pull-down menu, select "VI Server: Configuration". Be sure TCP/IP is checked and set to port 3363. Also be sure that the top three check boxes under "Server Resources" are checked.
4. In the pull-down menu, select "VI Server: TCP/IP Access". Be sure that at least your Host PC IP address is entered in this list. The most fail-safe way to configure this would be to not worry about what your Host PC IP address is, and just enter an asterisk (*) in the allow list. This will allow VI Server TCP/IP access to any IP address on your network. Sometimes this can be a security issue, but often people are behind firewalls such that this does not pose a significant problem.
5. In the pull-down menu, select "VI Server: Exported VIs". Allow access to (*) like suggested for TCP/IP Access.
6. If any changes were made, press the OK button, switch execution target back to LabVIEW for Windows, and power cycle the RT system.

As mentioned, this VI makes use of the RT FIFO VIs for communication. These VIs do not currently ship with LabVIEW RT. If you have never used them before, you will need to visit the related link below to download these VIs. In specific you will need the files "nbfifo.dll" and "RTFIFO.llb" that are attached to this document. If you are prompted for a VI entitled "No EOC Error.vi" when opening the VIs, you should find this in the TCP/IP examples for LabVIEW, which reside at \examples\comm\tcpex.llb.


Related Links:
NI Developer Zone: Real-Time FIFO Example

Requirements


Filename: control_example_lv61.zip

Software Requirements


Application Software: LabVIEW Full Development System 6.1
Toolkits and Add-Ons: LabVIEW Real-Time Module, LabVIEW Real-Time Module 6.1
Language(s): LabVIEW

Hardware Requirements


Hardware Group: Multifunction DAQ (MIO)
Hardware Model: DAQCard-6023E
Driver: Traditional NI-DAQ (Legacy) 6.9.0

 
Filename: control_example_lv60.zip

Software Requirements


Application Software: LabVIEW Full Development System 6.1
Toolkits and Add-Ons: LabVIEW Real-Time Module 6.1, LabVIEW Real-Time Module
Language(s): LabVIEW

Hardware Requirements


Hardware Group: Multifunction DAQ (MIO)
Hardware Model: DAQCard-6023E
Driver: Traditional NI-DAQ (Legacy) 6.9.0

 
5 ratings | 3.40 out of 5
Print

Reader Comments | Submit a comment »


Can't find the files "nbfifo.dll" and "RTFIFO.llb" that the page says are attached what web page says: As mentioned, this VI makes use of the RT FIFO VIs for communication. These VIs do not currently ship with LabVIEW RT. If you have never used them before, you will need to visit the related link below to download these VIs. In specific you will need the files "nbfifo.dll" and "RTFIFO.llb" that are attached to this document.
- Matt Chinnick, Siemens VDO. matthew.chinnick@siemens.com - Jul 5, 2006

 

Legal
This example program (this "program") was developed by a National Instruments ("NI") Applications Engineer. Although technical support of this program may be made available by National Instruments, this program may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this program with each new revision of related products and drivers. THIS EXAMPLE PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).