LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Network stream is not working to send data from RT to user interface

Solved!
Go to solution
Highlighted

Hallo everyone,

I am using sbrio-9637. My target is to send RT data to host computer. I have succesfully send data from FPGA to RT by using DMA FIFO. In the RT, I am sending data from time-critical loop to communication loop through RT FIFO. I am also getting data in the communication loop as desired.

But when I am connecting network stream with the communication loop, then I am not getting values anymore in the communication loop. The loop is not running at all.

I also run the user interface stand alone. The user interface is running but it is not getting any values from RT. I am following this example to build network stream- http://zone.ni.com/reference/en-XX/help/370622N-01/lvrthowto/sending_rt_data/.

For me it seems that, when I am creating network stream endpoint and writing data in network stream then the problem is occuring.I have attached both the VI with network stream and with out network stream here.

How can I modify my code so that I can stream data in user interface?

Thanks a lot for your help and patience.

0 Kudos
Message 1 of 5
(632 Views)

Did you specify the Writer URL on the PC side?

 

My main concern is that you have the code written such that the PC has to be running before your cRIO boots up.  A cRIO should be designed to run as a stand alone system.  You should have some sort of state machine to handle the connection to the PC.  If you are connected, you can send the data.  If you are not, then you ignore the data in the RT FIFOs.

 

Speaking of RT FIFOs, why do you have 2 of them?  Have the DMA FIFOs read the same number of elements and put those into a cluster to go to the communication loop with a single RT FIFO.  Otherwise, you are opening yourself up to data loss.


There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
0 Kudos
Message 2 of 5
(603 Views)

Hallo Crossrulz,

Thank you for your reply. In the user interface I have specify the writer URL. I have attached the user interface VI here.

Now I understand the problem. But I do not know how to design sbrio so that it runs stand alone. Can you tell me how can I solve this problem?

I have 2 DMA FIFO reading data from analog and digital sensors. They are not reading same number of elements. That is why I put two RT FIFO to read data from the two DMA FIFO. 

Thank you.

0 Kudos
Message 3 of 5
(600 Views)
Solution
Accepted by topic author Legolas-Elf
05-14-2018 12:52 AM

As I stated in my previous post, you need your communication loop be a state machine of some sort.  Cases I can think of include "Wait For Connection", "Active", and "Close Connection".  I recommend reading the FIFOs regardless before the case structure just to make sure those are being cleared out.  But the idea is you go to the Wait For Connection until your PC connects.  At that point, you progress to the Active state where you take the FIFO data and send it to the PC.  If there is an error, assume the connection was cut by the PC and go to the Close Connection state to clear out any stream references.  Then go back to the Wait For Connection state until the PC connects up again.


There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
Message 4 of 5
(591 Views)

I have limited experience with sbRIOs (I've got one and have done a little programming with it, but nothing in the last two years), but have been working with LabVIEW RT (with a PXI Remote) for some time.

 

The sbRIO is designed to be programmed using LabVIEW RT running on a PC Host system, utilizing LabVIEW Project to develop the code that will run on the Remote Embedded Controller (the sbRIO).  When you build a Remote Application and Deploy it to the sbRIO, one of the options you have is to set the deployed Code to be run at Startup.  This then lets you turn off the sbRIO, disconnect it from the Host, turn it back on, and "know" what it is doing (namely running the Code you just developed and want to "always be running when turned on").

 

This is basic material that you should have known if you are going to be developing code for such an Embedded Controller.  I don't understand how you could have not known about this, unless someone gave you a Project without providing you with any LabVIEW/LabVIEW RT Training nor any mentoring ...

 

Bob Schor

Message 5 of 5
(571 Views)