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

Modbus Communication Reference Example for cRIO

1 ratings | 5.00 out of 5
Print

Overview

This example ports the existing Modbus Library for LabVIEW to an FPGA-based implementation for use with the cRIO serial modules.

Downloads

Filename: crio_modbus.zip
Requirements: View

This example, based on the Modbus Library for LabVIEW, permits communication with Modbus devices via C-series serial modules.  Since these modules are not exposed to the controller as COM ports but instead interface directly to the FPGA on cRIO systems, the standard VISA serial commands are not available.  This example replaces all VISA calls in the Modbus library with custom wrappers around FPGA interface code to replicate the same functionality.  The example  includes complete FPGA code to implement a multi-port serial driver personality on the FPGA as well as a sample RT host implementation to demonstrate the usage of the modified library VIs.  

The code can be easily expanded to accommodate more than a single 4-port RS 232 serial module by adding additional RS-232 or RS-485 modules to the project and adding the appropriate cases and I/O nodes to the Read, Write, Bytes at Port, and Config command implementations in the FPGA code.

Please note that this implementation consumes 2 of the 3 available DMA channels on the cRIO device.

 

The minimum software set required to use this example is:

LabVIEW 8.6

LabVIEW FPGA Module 8.6

LabVIEW Real Time Module 8.6

NI-RIO 3.1

 

The example is written for the following set of hardware:

cRIO 9014 RT controller

cRIO 9103 FPGA backplane

NI 9870 RS-232 serial module

Requirements


Filename: crio_modbus.zip

Software Requirements


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

Hardware Requirements


Hardware Group: CompactRIO
Hardware Model: NI 9870, cRIO-9014
Driver: NI-RIO 3.0

 
1 ratings | 5.00 out of 5
Print

Reader Comments | Submit a comment »

 

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/).