LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error -50400 occurred at Invoke Method: FIFO.Read in Host.vi

Solved!
Go to solution

 

Hey there,

 

we have sensors on an Engine which are connected to a NI cRIO 9014 board (with a NI9411 6-channel digital input modul) and go from there via network to a host computer.

 

cRIO board: the cRIO board collects the data from the engine and stores it in a buffer, this is because the network is to slow for the magnitude of data

host computer: the host computer reads over the network the buffer on the cRIO board, on the host computer it takes out specific portions of the data to create pressure graphs of the engine

 

Error: 

Error -50400 occurred at Invoke Method: FIFO.Read in Host.vi

Possible reason(s):
The transfer did not complete within the timeout period or within the specified number of retries.

 

This error occurs in the following scenario:

- engine is running

- cRIO is running

When I press the start button (boolean 3) in the host.VI to start the reading of the data from the board AFTER I pressed the run button of the host VI. 

The Error would not occur if I pressed the start button (boolean 3) BEFORE I pressed the run button of the host VI.

 

We tried to increase the time out, but it still did not work, the error occurs!

 

We would be really happy if you could look over it and help us in this case! If you need further informations or if we need to clarify some specific portion, please let us know!

 

We included the VI's in the attachement!

 

Thanks in advance!

Download All
0 Kudos
Message 1 of 9
(7,774 Views)

You have hardcoded the number of elements to read out of the FIFO - (4*1440 = ) 5760 elements. Are you sure that 5760 elements are put into the FIFO? You can test this by making a parallel loop with a FIFO Read that reads zero elements, and only outputs remaining elements.  This will tell you if you ever reach enough elements to read.

 

The PREFERRED method for reading the FIFO would be to have one FIFO read reading zero elements and outputting 'Elements Remaining' directly into another FIFO read so that every time that while loop runs, it pulls exactly how many elements are in the FIFO out.  Of course, this would then require you to write to spreadsheet and append data, which you have append to false(probably so when you run this VI multiple times, you just overwrite old data)

 

Some suggestions/coding techniques:

 

Use the 2 FIFO reads in series so that you always read everything in the FIFO rather than just waiting for x elements

 

Your FIFO size should not have to be 32,767 elements.  This is all space being used on your FPGA, I bet that your FPGA takes quite a while to compile! The most I ever use(rare cases) is 8,191.  This is, of course, dependent on how fast you are reading data and how long it takes you to process data(which can be optimized with queues on the host)

 

Do your File writing in a different loop, file writing is extremely slow compared to other operations and can be the bottleneck in your master loop - use queues to write to file.

 

Implement error checking - use a parallel loop that is just polling the # of elements in the FIFO to see if you ever hit your magic # of 4*1440

 

Obviously, I wasnt sure what the digital inputs are reading, but I can tell you are polling for digital edges.  I dont have enough knowledge of the system to see if all of that logic is corect, but I would definitely look it over and maybe see if it can be optimized any.

 

 

Rob K
Measurements Mechanical Engineer (C-Series, USB X-Series)
National Instruments
CompactRIO Developers Guide
CompactRIO Out of the Box Video
0 Kudos
Message 2 of 9
(7,753 Views)

Hey Rob,

 

thanx for the help so far, well, we read the crankshaft angles on an engine. So, per crankshaft revolution, our sensor gives out 1440 pulses and we need 4 revolutions of the crankshaft to get one set of data. So we basically read lots of data!

 

1.) Could you explain the RT FIFO READ a little closer, we don't understand where we put this, since it is real time, it should be in the cRIO, right?

2.) What would be our input, I can't connect the input port 'rt fifo' to anything!

3.) Where should the parallel loop for file wirting be, I can't take it out of the loop it is in right now, since I want to write into the file evertime the loop completes.

4.) Same thing on the error checking with the parallel loop, where do you want us to put the parallel loop for the polling?

 

Thank you for your help, we're a little in trouble here and don't know where to go on!

 

 

0 Kudos
Message 3 of 9
(7,736 Views)

chrisse,

 

Hopefully, this will clear it up a little.

 

Right now, your code has this methodology:  "We are expecting N number of points, when the FIFO has this many points, pull everything out, do processing, and save everything to a file at once"  This should work in theory, but as we see, we are never reaching our N number of points for some reason or another(unknown for now).  Therefore, I want to put this error checking in to see how many points we are ACTUALLY getting, which may help us find where points are bing lost/not being put into our FIFO.

 

My recommended system is: "Let us check how many points are in the FIFO, ok great we have (N-X) points, lets pull all available points out of the FIFO, do processing on them, and write to a file.  Repeat the process - check how many points are in the buffer, do processing, ok now append the data to the file we originally wrote. Repeat until # of points available is zero for a set amount of time."  A setup like this adds flexibility when the amount of data we pull in is unknow.

 

For your current application, your methodology can work since you know you have N points.  For now, let us just track down the reason we do not get 1440*4 points into the buffer.  Here is how I implement a 'How many points are in buffer?' and 'Read all available points in buffer' scenarios.  Put the first one in your code and lets see how many points we are actually getting! I bet it is under 1440*4!

\

As for the queues and parallel file writing, I would look in example finder for 'queue'

 

Let me know if this helps and what you find out!

 

PS - The timer is recommended in the top loop, but I should have taken it out in the bottom loop.  We don't want to poll our available elements constantly at max speed in the first loop, but in the second loop we want to pull one set out as fast as possible obviously, so no wait needed

Message Edited by Robbob on 04-04-2009 09:48 PM
Rob K
Measurements Mechanical Engineer (C-Series, USB X-Series)
National Instruments
CompactRIO Developers Guide
CompactRIO Out of the Box Video
0 Kudos
Message 4 of 9
(7,712 Views)

Hello Rob,

sorry that it took us so long to work on our VI. We have finally built a new VI the way you told us to. But now the following error occurs, which we don't know how to handle it:

Error -52003 occurred at Close FPGA VI Reference in Host2.vi (unexpected software error occured)

Attached is our new VI, so if might wanna check on it again ( in case of the error and if we have built it the way you have meant to do it)

 

Thanks in advance, we really apriciate your help.

 

Chris and Tobias

0 Kudos
Message 5 of 9
(7,583 Views)
Solution
Accepted by topic author chrisse5186

Chrisse,

 

There are a few things wrong in your application, if I may offer some suggestions.

 

First, your while loops are not running in parallel.  In fact, they are in while loops with a true constant wired to them. I am not sure if this is by design for debugging, or on accident.  I would put the Polling(read pulling zero elements) outside your main while loop.

 

Your second nested while loop (the one polling the # of elements and then pulling them out) is going to run just once, and may pull only a few samples.  I don't think that is what you are looking for here, and there are a couple ways we can go here.  You could continuously poll until you have 0 elements available for x amount of time, then you know you have no more samples available and you can process all the data OR you can put all of your data processing as part of that loop and just always write to file immediately as x samples are pulled.

 

Also, your main loop's stop condition is (i <= 3) Therefore, it will run once and then stop.  Maybe you mean >=3?

 

Also, you have 'append to file' disabled on your write to spreadsheet, so everytime you write you are overwriting old data.  If you want to continuously write, you will be losing data.  This can be cured by either setting this to true(requiring a new file name or programatically deleting the old spreadsheet every time you run the vi) OR you can collect all of your data in a shift register, and only write to file once you have all your data available.

 

The error you are seeing is because you try to close your FPGA reference twice.  You only need to close it once.

 

After seeing your overall picture, I think this can all be cured by simply hardwiring your Read to get your 1440X4 elements, but as we have seen, this does not work.  Something is happening in your system....this is what I want you to do...run just the following code...and let me know how many elements remaining it gives you...Once the number has settled(I hope it does and your engine doesn't keep running), hit stop, and all the values will be put on a graph for you.  My broken wires are because I do not have the FPGA VI.

 

 

Message Edited by Robbob on 04-21-2009 01:48 PM
Rob K
Measurements Mechanical Engineer (C-Series, USB X-Series)
National Instruments
CompactRIO Developers Guide
CompactRIO Out of the Box Video
0 Kudos
Message 6 of 9
(7,577 Views)

 

Hey Rob,

 

that helped, it works now!

 

Thank you very much! We really had a hard time!

 

Best Regards

 

Chrisse

0 Kudos
Message 7 of 9
(7,551 Views)

Dear Robbob,

 

Recently we purchased cRIO 9025 in which 9229 x 3 modules (Total 12 channels) are connected.

 

FPGA has to collect the data @ 50KHz sampling rate.

As of now I wrote the code for only one channel @ 50KHz. When I run, It works properly after some time (in minutes) it shows the error Invoke: FPGA.Read.

 

I tried a lot, yet cant find the solution.

 

FYI, kindly see the attachments.

 

Hope so you can fix this.

Thanks & Regards

M. Ashokan

ashok3085@gmail.com

NIOT, Chennai, India.

Ocean Acoustics,
National Institute of Ocean Technology,
Chennai, India - 600100.
Download All
0 Kudos
Message 8 of 9
(6,820 Views)

rammu,

 

Without even looking at your code, it sounds as if your FIFO is slowly filling up until it completely fills up and overflows, and then throws an error. You are putting in 50,000 samples a second, how fast are your processing this data? If you are processing 49,000 samples a second, then your FIFO is growing by 1000 samples a second, until it overflows.

 

This is very common when the host VI is not programmed in an optimal fashion. Your priority should be pulling items out of that FIFO, especially once you go up to 12 channels. Post-processing (things like FFTs, averaging, scaling) should be secondary operations, or even offloaded to a PC. Of course, this greatly depends on your application. If you are taking finite burst measurements, you could log all the raw data and do all the processing later, however if this is going to run for quite some time and publish the data, then usually you need to do the processing at the same time as the measurements are taken.

 

My recommendation is to monitor the size of the FIFO and take a look at your host code - where is the bottleneck? Usually it is a file writing process that should be moved to a queue. Look for examples for queues. Unfortunately, I don't have as much time nowadays to help people out with their code, so maybe someone else can take a look and see if there are any issues with your code so far.

Rob K
Measurements Mechanical Engineer (C-Series, USB X-Series)
National Instruments
CompactRIO Developers Guide
CompactRIO Out of the Box Video
0 Kudos
Message 9 of 9
(6,811 Views)