LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Processing on the RT

Hi,

 

I am doing a continous acquisition at 1 MS/s. The FPGA to RT FIFO on the FPGA is used to store the sample values and the timestamps. I wish to process these sample values on the cRIO.

 

1:I wish to send a limited say 1000 samples from the loop which reads the FIFO onto another loop which does the processing onto the RT.

How do I check if I am able to read only 1000 samples from the FIFO and send these fixed number of samples to another loop for processing each and every time?

 

2:I wish to process the values in the second loop check if the amplitude is greater than a minimum value say threshold and if I get say 100 samples amongst these 1000 samples with successive amplitudes greater than this minimum threshold value then I wish to transmit them to the PC using Network Streams. How do I check this prior to transmission, is there any available component in labview which does this?

 

I wish to process only a fixed number of samples say 1000 everytime prior to transmission.

 

Please find attached the snapshot of the VI.

 

Could you please suggest?

 

 

0 Kudos
Message 1 of 17
(1,346 Views)

Hello Harss,

 

for the first point I suggest you to use RT queues for passing data from the reading (producer) loop to a second (consumer) loop. 

You can choose the dimension of RT queue, so you can choose 1000 samples at time. 

For the second point you just have to create the writer endpoint in RT targeted vi and the reader endpoint in your PC vi. The checks you want to do can be done inside the loop, and you have to pass the required samples to the writer. In this way, the check is done prior to transmission. You can use a case structure to handle it.

 

I hope my answer helped you.

 

Kind regards.

0 Kudos
Message 2 of 17
(1,318 Views)

Hi,

 

Thanks for your prompt response.

 

Is it possible by anyways to extract the same number of elements (say 1000) because when I use Array size function to determine the size of the block of data being read from the DMA FIFO because I had tried using the case strycture and checked if array size is 1000, in the True part of the Case Structure I used a Queue to transmit data to another loop. However, it was observed that the True part of the Case Structure was never invoked because I guess the number of samples are always greater than that value but never equal. Hence, it creates an issue and I need to flush large number of data points at a time from the DMA FIFO while reading from it to avoid Time Out related issues . How do I check this before using a Queue while transmitting data to another loop onto the RT?

 

Thanks.

 

0 Kudos
Message 3 of 17
(1,294 Views)

Hi,

 

I am also not quite sure if there is an already available module in labview which can handle processing described below

 

Determine the number of points exceeding the threshold (say more than 100 data values continously in succession out of 1000 data  points exceeding the threshold) then transmit those array of data points.

 

Thanks.

0 Kudos
Message 4 of 17
(1,281 Views)

Hi Harss,

 

you have to create the RT queue with the desired dimension, then you fill it inside the True case of the case structure, in which you read the DMA FIFO. This has to work.

For the implementation of the algorithm you have to think about some way, but I think that with a couple of comparison and a Case structure you should do it. 

If you have any further doubt you could also attach here your code so I can check it out.

 

Kind regards.

0 Kudos
Message 5 of 17
(1,278 Views)

Hi,

 

Thanks a lot . I will check this out and get back to you as soon as possible.

 

Thanks once again Smiley Happy

 

I just had one question.

 

I need to process a data with fixed number of elements so in my processing loop I need to process the thousand elements sent from the first loop which involves the FIFO Read. Once I am done with the entire processing and transmission , it is then that I need to process the other set of thousand elements. If I set the Queue with its maximum limit as thousand in the first iteration I will be able to send the thousand elements for processing from the acquisition loop, but once I Dequeue the elements it will flush out single elements and once the queue starts getting emptied the new values would be pumped in the Queue , now I no longer have processed my previous set of 1000 data points and start getting new values.

 

I need to first process these thousand data points send them through Network Streams and later once this operation is done later accept another 1000 set of data points. I am not sure if this could be implemented or atleast , if I can flush 1000 elements from the Queue and later when the whole processing is done then provide an intimation to flush the remaining 1000 elements.

 

Could you please suggest, since I am unable to understand if setting the Queue dimensions could solve this issue?

 

Thanks

 

0 Kudos
Message 6 of 17
(1,266 Views)

I am totally confused about what you are trying to do, and why you are having a problem.  I know that you are generating samples at 1MHz.  I don't know the size of your acquisition buffer -- is it 1000 points?  [You mention an RT FIFO of this size].  You mention a "limited ... sample of 1000 points" -- what is this?

 

Suppose you acquire 1000 points at once and, using an RT FIFO, stream them to a Producer loop.  The loop examines them, decides if they have 100 points over your threshhold, and if so, you send them to the Network Stream Consumer loop (and, I suppose, if not, you discard them).  I'm pretty sure this is not what you mean, but is it at least close?  Partly correct?

 

Bob Schor

0 Kudos
Message 7 of 17
(1,226 Views)

Harss, couldn't you perform the threshold test on the FPGA? That would be far more efficient than trying to continuously transfer all of the data to the RT controller to handle such a simple task.

0 Kudos
Message 8 of 17
(1,211 Views)

Hi Harss,

 

if you set the dimention of the Queue when you create it, you will have no problem when you do the dequeue.

This is indeed the aim of the queues, which synchronize the process of passing data between two parallel loops. You can put a part of code before you destroy the queue in order to flush all the remaining elements, being sure that you don't lose none of them.

 

Kind regards.

0 Kudos
Message 9 of 17
(1,169 Views)

Hi all,

 

I apologize for not being clear in my previous post.

 

Please find the below details

 

1Smiley Surprisedn my RT . I chjeck if the number of elements remaining in the FIFO is greater than 90000. In such cases I try to flush the DMA FIFO and the FIFO depth on the RT is set to  900000.

 

2:In my previous post what I meant by 1000 is the Size of the RT Queue. What I want to do now is check for every 1000 samples from the FIFO if the amplitude is greater than a particular threshold then transmit it using network streams. For this purpose I use a Queue within the True part of the Case structure and set the dimensions to 1000 elements. I now wish to transmit these 1000 points to another loop which will process the data and check if I get all these thousand samples with amplitude greater than the threshold value then transmit using network Streams.

 

This was the approach I thought I could adapt for processing the data on the cRIO.

 

3:I am unable to do this processing on the FPGA as it would require some more storage for the arrays and the computation would be rather complex on the FPGA so I decided to handle this on the cRIO.

 

As per the suggestions received yesterday I have implemented the flow using a simple random number , once I am able to implement the solution correctly I plan to integrate it with the main VI.

 

Please find attached the snapshot of the code which I tried today. However, I was unable to get the required result.

0 Kudos
Message 10 of 17
(1,151 Views)