Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

NI-9871 RS-485 to Carlo Gavazzi

I'm new in FPGA programming, and I need some help to communicate with my cRIO-9074 with NI-9871 throw RS-485 to a Carlo Gavazzi energy meter. I need to send a request to the devise and wait for a reply with the measurements. I have all the necessary things installed, but I can't establish a valid communication with the device. The examples about this kind of communication didn't really help me.

Does any one have experience with this?

The energy meter is Type EM21 72D and the communication type is in the attachment.

I'll be glad with some help.

Best regards.

 

André Quintino

 

0 Kudos
Message 1 of 17
(5,490 Views)

Hello Quintino,

 

Thank you for posting on National Instrument's forum.

 

Did you use the NI Example RS 485?

To write some bits instead of string, you can use the function "Number in string hexadecimal" and set the number into binary.

I join a screenshot to send 32 bits via RS 485.

 

Let me know if it works.

 

Regards,

Romain P.
National Instruments France

0 Kudos
Message 2 of 17
(5,447 Views)

Hello Romain, and thank you for the help.

I've tried the 202314.vi example available by NI here. This VI is similar of the one you just send me, but when I run this example I get this error:

"Error -1073807331 occurred at Property Node (arg 2) in VISA Configure Serial Port (Instr).vi->202314.vi

 

Possible reason(s):

 

VISA: (Hex 0xBFFF001D) The specified state of the attribute in not valid, or is not supported as defined by the resource."

 

In VISA resource name, I have RIO0::INSTR, and I can only choose between this and ASRL1::INSTR. The baud rate is 9600, 8 data bits, none parity and stop bits 1.0 for this Carlo Gavazzi.

 

I have installed on my system this software:

- NI 985x Software 1.3.5

- NI CompactRIO 3.5.1

- NI CompactRIO Module Support 3.5.0

- NI FPGA Wizard for LabVIEW FPGA 2010

- NI Farm Server 2010

- NI FlexRIO 1.5.0

- NI FlexRIO Adapter Module Support 1.8.0

- NI IVI Compliance Package 4.2

- NI Instrument I/O Assistant

- NI LabVIEW 2010

- NI LabVIEW 2010 Advanced Signal Processing Toolkit

- NI LabVIEW 2010 FPGA Module

- NI LabVIEW 2010 PID and Fuzzy Logic Toolkit

- NI LabVIEW 2010 Real-Time Module

- NI LabVIEW FPGA Xilinx 11.5

- NI LabVIEW SignalExpress 2010

- NI LabVIEW TEDS Installer

- NI LabWindows/CVI 2009 Run-Time Engine

- NI Measurement & Automation Explorer 4.7.0

- NI Measurement Studio Common .NET Assemblies for .NET 2.0

- NI Network Browser 32-bit 1.1.0

- NI PXI Platform Services 2.5.6

- NI PXI Platform Services 2.5.6 Configuration Support

- NI PXI Platform Services 2.5.6 for LabVIEW Real-Time

- NI R Series 3.5.0

- NI Real-Time Execution Trace Toolkit 2.0.3

- NI Spy 2.7.2

- NI System Configuration 1.1.0

- NI System Configuration 1.1.0 LabVIEW Support

- NI System Configuration 1.1.0 for Real-Time

- NI TDM Excel Add-In 3.2

- NI Update Service

- NI mDNS Responder 1.3 for LabVIEW Real-Time

- NI-488.2 2.7.3

- NI-DAQmx 9.1.5

- NI-DAQmx ADE Support 9.1.5

- NI-DAQmx MAX Configuration Support 9.1.5

- NI-RIO 3.5.0 driver for Real-Time Embedded Targets

- NI-RIO 3.5.1

- NI-RIO 3.5.1 driver for Real-Time Embedded Targets

- NI-Serial 3.6

- NI-Serial 3.6 for LabVIEW Real-Time

- NI-VISA 5.0.0

- NI-VISA 5.0.0 for LabView Real-Time

- NI-VISA Runtime 5.0.0

- NI-VISA Server 5.0.0

 

Am I missing something?

Thank you for helping me.

0 Kudos
Message 3 of 17
(5,419 Views)

Did you check your hardware in Measurement & Automation? Did you test it?

 

Regards,

Romain P.
National Instruments France

0 Kudos
Message 4 of 17
(5,390 Views)

Under Measurement & Automation Explorer, I can find my cRIO under Remote Systems. Inside there is a Devices and Interfaces with NI cRIO-9074 "RIO0", Network Devices and Serial & Parallel. Under Software is a bunch of things I've installed like "NI-RIO 3.5.1 with NI Scan Engine support - August 2010".

Under the NI Distributed System Manager, I can see my cRIO with all the modules except the NI-9871. However, I can't really see the measurements being made with the modules.

Under the Project Explorer I have the cRIO with the FPGA Target with the NI-9871 module, and out of the FPGA Target the second and third modules. Once again, I can't real the measurements from the module 1 and 2 in the VI.

0 Kudos
Message 5 of 17
(5,375 Views)

Can you send me your project? It'll be easier.

 

Regards,

Romain P.
National Instruments France

0 Kudos
Message 6 of 17
(5,337 Views)

The first project I'm sending you is the first try with VISA.

The second one is the Modbus Communication Reference Example for cRIO.

I can't get it work with the first or with the second project.

Thank you for the help once again.

Download All
0 Kudos
Message 7 of 17
(5,322 Views)

Can you send me the associated VIs? (I think about Modbus test.vi)

 

Thank you

Romain P.
National Instruments France

0 Kudos
Message 8 of 17
(5,307 Views)

The associated VI's for the "cRIO Modbus" project are in here, the MODBUS Library for LabVIEW.

The associated VI's for the "Vazio" project are also the MODBUS Library for LabVIEW.

If you get any problem, please let me know.

Once again, thank you for the support.

0 Kudos
Message 9 of 17
(5,303 Views)

Hello,

 

The Modbus Library for LabVIEW uses VISA (you can see this by opening the library VIs and checking their block diagrams).  However, VISA cannot be used with the 987x modules because they are only interfaced through FPGA.  This project was put together to bridge this gap.

 

http://zone.ni.com/devzone/cda/epd/p/id/6166

 

This library is the same as the Modbus Library for LabVIEW, but all of the VISA calls have been replaced by the VIs that use FPGA and the 987x modules.

 

Thanks,

Steven T.

Message 10 of 17
(5,298 Views)