LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

cRIO to Modbus using CVT RT

Code Prodigies,

 

I am working on a solution involving (2) cRIO 9073 chassis with identical module sets; to be used for controlling adjacent environmental chambers (PLC controlled). I am working on some LV code that will be deployed to the RT targets (cRIOs). I would like for this code to be universal and be deployed to both cRIOs. I need sensor values to be passed from the cRIO directly to Modbus registers on each chamber's PLC (there is one PLC for each chamber) I have created Modbus I/O servers for each of the PLCs. My original plan was to simply create a project in which each I just use drag-and-drop variables to pass each value within a while loop. However, this is not very scalable and would not support modifications very well. 

 

My research has led me to believe that the Current Value Table (CVT) method might be more appropriate for my application. My idea is to use the Tag Configuration Editor (TCE) to create a config file that contains all data points for both cRIOs. The name of each cRIO in the configuration will be = its own IP address. Then I can include code that finds the IP address of the current cRIO chassis and convert that to a string to programmatically set the "Target Name", on the inputs of "CIE Load Tag List.vi" and "CVT Load Tag List.vi" (http://zone.ni.com/devzone/cda/epd/p/id/1717). Also in the configuration file, I can make the "Description" field of each tag = the variable name of a given Modbus register. This description will be the input to a case structure in which there is a case for every modbus register that I plan to use.

 

This is how I have rationalized a method for deploying a single set of code to (2) separate cRIOs that will appropriately pass every cRIO input value to a given Modbus register and will be scalable and efficient.

My problems are that:

 

1. I have never used CVT and have very little experience implementing RT code on a cRIO.

2. I have attempted to do a quick test of the CVT method, but I can not get it to work.

           - I put a TCE config file on the cRIO via FTP. I put it in the location (/ni-rt/startup/TCE Trial 1.xml), but I can not get "CIE Load Tag List.vi" to run. It just errors. I keep messing with my TCE config file path, but to no avail.

3. Is there any way to programmatically read the name of a variable that is created from a Modbus I/O Server?

           - I have created Modbus I/O Servers for each PLC and created variables for each register I need, but I can not figure out how to relate each register with a tag from the config file.

           - I had hoped to relate the two by making the description field of each tag in the config file = a variable name from the Modbus I/O server.

4. Does anyone simply have a better way?

 

I've done lots of LV work over the past year or so, but cRIO RT and CVT are new.

Any help you prodigies could give would be greatly appreciated.

 

Thanks! 

0 Kudos
Message 1 of 2
(2,221 Views)

Hi chris8302,

 

I assume you are using our CVT library at the page linked below:

 

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

 

That page also contains some really useful links for getting started with CVT.  As to Real Time programming, I would check out the CompactRIO Developer's Guide:

 

http://www.ni.com/compactriodevguide/

 

Yes there is a way to programmatically read the name of a Modbus variable, using the DSC module.  An implementation of this can be achieved by modifying the code in the link below to access the "name" property of the shared variable.

 

http://digital.ni.com/public.nsf/allkb/2A4119F316BC6E8E862576DD007B835C?OpenDocument

 

A similar strategy could be implemented without the DSC module as is shown in the link below under "Finding Variables Programmatically"

 

http://zone.ni.com/reference/en-XX/help/371361G-01/lvconcepts/usingdynvarapi/

 

I hope this helps!

Andrew T.
National Instruments
0 Kudos
Message 2 of 2
(2,201 Views)