From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

trouble sending network published variable to real time VI

Hi,

 

I am using Crio 9014, with 9211 and 9215 modules. I made an FPGA VI with different sampling rate for 9211 and 9215 (I am using FIFO for this data transfering from 9215). The sampling rate for 9211 is 10hz, and for 9215 is 2khz.

 

In realtime VI, I am using FIFO read and producer/consumer method to extract and save data. I also have an Save buttom to enable saving whenever I want.

 

I tried to create network shared varaibels for indicators of RT vi and the same for controls of host vi 

 

When I run the host vi, it seems that shared varaibels cannot be transferred from host to RT, while varaibles from rt to host can be transferred. 

 

any help would be appriciated.

 

I have also attached, FPGA, RT and HOST vi.

0 Kudos
Message 1 of 10
(3,039 Views)

Hi far_nia

 

Could you give more details about the communication issue? Can you see the variables been updated on the NI Distributed system manager?

 

If I understood correctly you have a library on the RT target and one on the host?

 

The issue is in an executable application or in the developer system?

 

Regards

Esteban R

0 Kudos
Message 2 of 10
(2,994 Views)

Hi Esteban,

 

the problem is I am new to this kind of application in labVIEW. 

 

I trasnfered all the shared varialbes under RT target, but I just can see a fixed number of point in the graph! I think I cannot set up a proper communication between host and real time vi. When I run my program on real time vi (no shared varaible) it works accuratly but, when I make shared variables from controls and indicators of RT vi and create an host vi, the communicaton between RT and host is not working well.

 

and I don't have any idea about the difference between executable application/ the developer system that you mentioned. 

 

I couldn't find any tutorial for FPGA+RT+host application on ni website, if you know any please let me know

 

Thanks for the help

0 Kudos
Message 3 of 10
(2,982 Views)

Hi far_nia

 

It seems that you might be having a communication issue between the target (cRIO) and the host (developer computer). The use of the shared variables between the target and the computer is very similar to a communication between two computers.  The following links have information that might help you.

 

Real-Time VI to Host VI Communication Methods

Using the LabVIEW Shared Variable

 

First, I might recommend you to try to communicate two computers in order to check that it might not be firewall issue.

 

Configuring Software and Hardware Firewalls to Support National Instruments Products

What Ports Do I Need to Open on My Firewall for National Instruments Software Products?

 

Second, I will recommend you to use the NI Distributed system manager to check the communication and if the shared variables are being published and updated as they should.

 

Monitor NI CompactRIO System Resources and I/O with the Distributed System Manager

 

And my third recommendation would be that since National Instruments has LabVIEW Real time and FPGA courses available, it would be beneficial for you to improve your programming skills, and that might help you to accelerate the developing process of your application.

 

LabVIEW Real-Time 1

LabVIEW FPGA

 

I hope that this information might help you with your communication issue.

 

Regards

Esteban R.

0 Kudos
Message 4 of 10
(2,972 Views)

Hi 

 

thanks for the reply. I attached a screen shot of my distibuted manager. I can see all the shared variables. Why some of them like (lateral) look different than other ones (like flushed data size). Do you think that can cause the problem?

 

for control variables such as sampling rate or stop buttom, should I create shared variable under my computer or under target? right know I am creating all of the shared variables under the target .

 

0 Kudos
Message 5 of 10
(2,957 Views)

Esteban,

 

I made some simple examples and I believe the way I am using shared variables is okay (I am putting all of the them under the target vi and not host vi). The only problem is, everytime I run my HOST vi, I have to run my Real time vi manually to see the results,

 

It sounds like stupid for me to run two vi and there should be a way to just run the PC host vi once and it runs the rt vi automatically. can you help with that?

 

I also made stand alone rt, build it, set it as startup, reboot the target, but still need to run rt vi to see the data in host vi.

0 Kudos
Message 6 of 10
(2,948 Views)

It's your choice where to run the SharedVariableEngine(SVE). I prefer to run it on the Host because it slows down the performance of the RT (in my case a cRIO with a 400MHz single core controller).

 

Just place your variables (*.lvlib file) in your LabVIEW project under the MyComputer section. The RT uses an <RTexe_Name>.aliases file to point to the SVE to communicate with. As long as you work in the LabVIEW IDE all settings will change automatically. If you want to use the stand alone RT exe use the context menu of the build spec to select the Run at Startup option which will modify the ni_rt.ini and the *.aliases file.

0 Kudos
Message 7 of 10
(2,941 Views)

Hi Christian,

 

Thanks for the reply. I moved all the shared variables under my computer, but it doesn't work! Only when I put ALL the variables under target, they can communicate with rt and host. (I checked that with distributed system manager)

 

I am pretty sure I am missing something here, could you please put step by step guide for me.  als let me ask you some questions:

 

1. What is the use of real time excecutable? I want to change some variables (for example sampling rate, while running host vi, using rt executable is useful in this case?)

2. When making rtexe should I include .lvlib in "startup vi" or "always included" or none of them?

3. When I make rtexe, I click build, set as startup and then run as stertup. The cRio chassis should be rebooted, when I click reboot, the greenlight on the cRIO chassis does not turn on again. does it have a special meaning? (I think after rebooting chassis, it remain disonneceted becuase the green light on the icon remain dark)

 

That would be great if you help me with that, I am spending so much time on this and so confused about this rt/host communication.

 

Regards,

 

0 Kudos
Message 8 of 10
(2,931 Views)

Hi far_nia

 

1-      A real time executable is use when you want to run an application as soon as the target (NI cRIO or RT target) finishes the start up process in order to have a standalone application. In your case the application will be a standalone system that communicates with a host system.

 

2-      You should not have to include the library in the always included section, the only items that we need to add here are the ones that are dynamically call and some others, take a look to the section Stand-alone applications of this link.

 

Distributing Applications with the LabVIEW Application Builder

3-      Here is a link that explains the status of the LEDs and what each status means. You can use the NI Distributed system manager to monitor if the variables are being updated and if the cRIO is doing something by checking the controller CPU and memory.

 

Why is the Status Light on My CompactRIO Controller Flashing?

4-      The green LED of the project explorer indicates if the developer computer is connected to the cRIO in order to use the front panel communication, to deploy the application, etc. The LED might be turned off but if the application is running on the target and is updating the information trough the shared variables you will be able to communicate with the cRIO trough the shared variables.

 

Startup EXE not Launching on Real-Time (RT) Target at Controller Reset

Communicating with RT Targets from a Host Computer (myRIO Module) - LabVIEW 2013 for myRIO Module He...

 

 

Regards

Esteban R.

0 Kudos
Message 9 of 10
(2,921 Views)

....so confused about this rt/host communication.

 

In fact this is no RT/HOST communication. There's always the SVE in the middle and you decide where to put the SVE. It can run on any other PC in your network.

 

I suggest to start with some LabVIEW examples and Esteban gave you all the links you need to get an idea how this should work.

0 Kudos
Message 10 of 10
(2,905 Views)