LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

cRIO, host, combination

I'm looking for a little assistance in a program I'm writing. I'll be using the cRIO FPGA to read some quaduature encoders. I will then let the RT controller read these values and do some conversions. Then I'll have a host PC that will take these and perform some other functions (graph, print , save to local hard drive, etc.)
 
So I'll have 3 programs one on the host PC, one on the RT, and one on the FPGA.
 
I've already written the FPGA program. I've also written the Host/RT program that will be split in two so one part will go on the Host and the other will remain on the RT.
 
I'm not looking for anyone to write my program. I'm looking for some advice, tips, and suggestions, or links to good examples.
 
I will try to attach my project as it is now, for anyone who would like to look at it. Currently the RT and Host are the same program, as I wish to split this and put the bottom loop in the host, so I can do file saving and printing from the host. Also, there are some unused and redundant shared variables, as I was practicing :).
 
Some questions I have are:
When creating shared variables, does it matter where in the tree of the project they reside?
If I wish to have an EXE on the desktop that runs the host program, which in turn runs the RT program which in turn runs the FPGA, is this possible to get them all going like this?
 
 
 
Again, just looking for pointers and tips.. I'll be playing with this after I post, looking at examples.  I am not opposed to experimenting with different types of data sharing between the host PC and the RT controller.
 
Best Regards,
 
Jeff
 
 
 
 
0 Kudos
Message 1 of 3
(3,422 Views)

> When creating shared variables, does it matter where in the tree of the project they reside?

Yes it does. Depending on where in the tree you place the SV, this will be the location where the Shared Variable Engine (SVE) will be located that hosts these variables. This only applies to network shared variables. In general it is a good idea to place the SVE on the Windows target in the configuration you describe.

Single process (local) SVs need to be located on the target where they will be used, but they will not use the SVE. See the following document for lots of information on Shared Variables.

http://zone.ni.com/devzone/cda/tut/p/id/4679

> If I wish to have an EXE on the desktop that runs the host program, which in turn runs the RT program which in turn runs the FPGA, is this possible to get them all going like this?

You will need to have a Windows and separate RT executable that start automatically in this configuration. The FPGA VI is included in the RT executable and will be started by the RT VI. For both you Windows and RT VIs you will use the Application builder to create your executabel. On the RT executable before you deploy it to the RT target, you should select to start it automatically when the system is turned on. The Windows executable is normally started manually by the user, but can be included in your Windows Startup folder to start automatically.

Info on the LV 8.x app builder:

http://zone.ni.com/devzone/cda/tut/p/id/3303

Info on the RT app builder (from LV 7.x):

http://zone.ni.com/devzone/cda/tut/p/id/3883

For communication between the RT and Windows targets you should consider either Shared Variables or TCP based communication. For TCP communication look at the following documents for more information and a suggested implementation.

Command-based Architecture for LabVIEW Real-Time

http://zone.ni.com/devzone/cda/tut/p/id/3098

Simple TCP/IP Messaging Protocol

http://zone.ni.com/devzone/cda/tut/p/id/4095

authored by
Christian L, CLA
Systems Engineering Manager - Automotive and Transportation
NI - Austin, TX


  
Message 2 of 3
(3,410 Views)
Thanks Christian for your response.
I have chosen to use Shared Variables. I have 5 arrays of 1000 Single Precision Numbers, along with several other Shared variables (Booleans, etc.)

I have created the Shared variables under "My Computer" so I guess these will reside on my host PC?
 
It appears to work very well. I don't need to read the arrays in real time. I only read them after the cRIO finishes some work.
 
 
So the cRIO sends the arrays of data out to some shared variables, and also I have start/stop flags that are shared variables. This is how I keep the host and cRIO "in sync".
 
 
I tried the TCP stuff but I'm too lazy lol... this was much easier 🙂
 
 
So far so good!..
 
Jeff
0 Kudos
Message 3 of 3
(3,402 Views)