LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

user defined variables transfer data

Solved!
Go to solution

Hello

I am using the etherCAT 9144 chassis and this hardware supports only target scoped FIFO. After a search, I realized that the only way to transfer data from FPGA to Host is by using User defined variables. But these variables do not support FIFO concept. So, which is the best practice to transfer data after measurements ( e.x 10Hz measurement of 15 values ) to host VI ?

Thanks

0 Kudos
Message 1 of 8
(4,623 Views)

When using a 9144 for distributed I/O, you treat the 9144 as a single-point I/O device only and not something that collects and buffers whole measurements; the host VI would be the one that does all measurements.  The FPGA on the 9144 is for things like inline signal processing.  You can buffer things on the FPGA for use in signal processing, but you cannot transfer anything other than single-point values.

 

For your case of 10 Hz measurements, this should be easily streamed over EtherCAT to the host.  If you only need to read values from one of your C-series modules, then you could leave it in scan mode.  If you want to do some inline processing, combinational logic, etc., then you can do this on the FPGA and expose it as a UDV, which you would still stream to the host using the scan engine.  It would just be like instead of having a NI-XXXX card you have this custom card that outputs that processed variable instead of, for instance, a voltage.



0 Kudos
Message 2 of 8
(4,596 Views)

Hi

Initially I had the acquisition VIs in ScanEngine, since the sampling speed is not such high. However, I want to synchronized each sampling event with some PWM signals that I produced in FPGA. (ex. when DOI1 is high then start sampling).  Then, I realized that the measuring system in Scan Engine is delayed at each sampling so it doesn't sample at the same point compared to the PWM signal which is used as trigger above. 

So the next solution I though can be to measure the voltages with FPGA and what I am trying is to buffer each bunch of data in fpga (locally) and then to retreive them one-by-one, using a UserDefined Variable in Host VI. But this is more difficult than the first approach.

Is there another way to stream the data using UDV as you mentioned ?

 

Thanks a lot.

0 Kudos
Message 3 of 8
(4,588 Views)

If streaming data, you really need an RT system.  Something like the cRIO-9066 would work well here.  You can then create a network stream between this chassis and your main chassis to stream the data.

 

Either that or reevaluate which modules are in which chassis.  Any streaming channels really need to be on the cRIO controller.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 8
(4,570 Views)

@crossrulz wrote:

If streaming data, you really need an RT system.  Something like the cRIO-9066 would work well here.  You can then create a network stream between this chassis and your main chassis to stream the data.

 

Either that or reevaluate which modules are in which chassis.  Any streaming channels really need to be on the cRIO controller.


You do not use network streams to communicate with a NI-9144, it is an EtherCAT expansion chassis.  It's data is streamed deterministically over EtherCAT using the scan engine.

 

The host for using a NI-9144 expansion with NI's EtherCAT already must be an RT system.



0 Kudos
Message 5 of 8
(4,554 Views)

VItan wrote:  It's data is streamed deterministically over EtherCAT using the scan engine.

It is NOT streamed via EtherCAT.  It is TAG data.  This means you only get the latest value whenever the scan engine comes around to read the data.  Therefore, you could have a lot of data points lost.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 8
(4,536 Views)
Solution
Accepted by topic author UserLab

As mentioned, the 9144 only supports scan engine.

 

As for what you should do, that really depends on the whole application. For example, what is the master? Are there other systems involved here? Etc. This is a good read in general, although it might not help right this second: https://www.ni.com/en/shop/compactrio/expansion-i-o-for-labview-rio-systems--an-in-depth-comparison....

 

From a high level you should decide what you need. If you need deterministic, low latency communication over longer distances from an RT controller, the 9144 is probably the right choice. If you need low-latency+streaming over short distances from an RT controller, you should look into the MXI RIO chassis. If you primarily need non-deterministic low speed (10 hz) data mixed with low-throughput streaming over long distances from a windows or RT host, then the ethernet rio expansion (9146,7,8,9) is probably the right choice. If you need high speed streaming with low latency control over long distances from a windows or RT host, you need a full cRIO controller. Based on what you've posted so far, its uncertain what is the right fit.

 

Lets say you're stuck with the 9144 for now. Given that you can easily hit 1 kHz scan cycles, it should be perfectly achievable to "stream" data at 10 Hz. If you run scan engine at 1 kHz then you're oversampling by 100x. Where it gets tricky is that sync requirement. By default the I/O acquisition is synchronized to the scan clock (and you can see when the scan clock is set through an FPGA I/O node). However, you can take full control of a module in the FPGA and read the I/O at any time you please. That is, you can set it up so when DIO0 goes high you immediately sample all 15 AI values. You can then transfer those latched AI values to the host using user defined variables.

Message 7 of 8
(4,516 Views)

Hello

It's true that I am stuck with NI9144 for now and I can't change. The last thing you said is what I am trying to implement now, having also seen the Scan Engine Synchronization example provided from NI. What I am facing now is that not all the user defined varialbe are seen to be tranferred to Host. I am giving the part of code made for this and I am totally positive for any suggestion. The key point to the application is that I want the acquisition to be done with much precision after the given pulse and the transfer to host it propably follow the scan speed as mentioned.

Thanks

0 Kudos
Message 8 of 8
(4,497 Views)