From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Feedback on Getting Started with CompactRIO - Logging Data to Disk

Hi,

 

The Fpga Vi compiles and the error occurs after the code ran for a while.

The part that is throwing the error should be in the VI "StateMachine Realtime mit Zeit" - in the state "operating", as this is the Part that reads/writes the data.

 

Thank you for taking a look on the code!

 

The newest version of the code is attached

 

Best Regards,

Alex

0 Kudos
Message 71 of 108
(1,607 Views)

Alex,

 

There is a knowledge base article that details the cause of this error and how to resolve the problem. See the article I linked below.

 

Why Does My DMA FIFO on My Host Fail to Allocate Memory with Error -52000 or -50352 on a 64-bit Oper...

 

-Nick-

 

 

Nick C | Software Project Manager - LabVIEW Real-Time | National Instruments
0 Kudos
Message 72 of 108
(1,587 Views)

Nick,

 

Thanks for the article, i was able to resolve the 52000 error.

I also replaced the queue with a RT FIFO. but still the Code is not fast enough in writing the Data to the TDMS before the buffer overflows (almost immediately).

Also, the data (one channel + time) change columns in the TDMS again and again and i do not really know why, it must have something to do with the RT FIFO as this is the only thing i changed.
.

Is it possible to speed up the read from FIFO-->Save to TDMS part of the code?

 

Thanks in advance,

Alex

0 Kudos
Message 73 of 108
(1,568 Views)

Hi, I too have a problem with the speed of writing a TDMS file. The data acquisition loop runs 100 Hz (synced to scan engine) and the program works fine until saving to disk. The timed loop then runs late. I have calculated the data rate to be 74,600 bits/s or so, not including any overhead...

 

 

Download All
0 Kudos
Message 74 of 108
(1,561 Views)

Turns out to be a conflict of priority- everything was set to above time critical. Replacing the consumer loop (that writes file) with a timed loop and specifying a lower priority for this than the producer  (Acquisition) loop fixed it.

 

thanks !

 

0 Kudos
Message 75 of 108
(1,550 Views)

...not quite fixed, writing 22 channels of single precision float to a tdms file often takes 11ms, so at 100Hz sample rate the FIFO overflows and looses data after about 25 seconds. Why is write TDMS so slow on the RIO ? surely it can handle more than 8kB/s... it has a 500MHz processor...

0 Kudos
Message 76 of 108
(1,528 Views)

Julian,

 

A queue is fine for this architecture on RT. An RT FIFO is recommended as it will reduce jitter in your application, whereas a queue can introduce a slight amount of jitter. 

 

And you are correct that switching to dynamic data type will allow you to pair your data with a timestamp.

 

-Nick-



Notes for Branch AE:
Please reply to This Post within 24 hours
The US AE is expected to reply to all of your posts within 24 hours. Having this expectation will keep the escalation moving quickly and toward a fast resolution.

You can also use other communication channels: Phone, Skype, etc. to discuss the issue with the US AE. This can help with troubleshooting and quick diagnosis of the issue.

Click here to provide kudos for a post on this page
0 Kudos
Message 77 of 108
(1,508 Views)

Thanks Nick, using RT FIFO now, and obtaining timestamp from one of the channels directly, converting to double, and dropping it in the array to the FIFO.

 

To overcome the slow write to TDMS file speed when multiple channels are used it is necessary to build an array of data first, then, when 80 readings have been taken these are written to file (transpose array first) and the array emptied.

Doing this dropped the write file time from 10-11ms on average to about 640us (on avaerage). 80 readings seems to be optimal, much more than this and building the array starts to take a long time.

 

thanks,

 

Julian.

 

 

0 Kudos
Message 78 of 108
(1,488 Views)

HI,

 

I am using a cRIO-9073 and have a couple of 9236 quarter bridge strain gauge units. I followed this tutorial but still can not get data to log with these products. I get a couple of error messages when trying FPGA method.

 

-2519 TDMS Open in Gather Data.vi

 If I change the name of the file on the backend I get a different error (sometimes) -50400 Invoke Method:FIFO.Read in Gather Data.vi.

 

Any help would be appreciated. All the 9236 'getting started' vis had errors in, I am desperate to start using these modules but can not get them to work. If there is a better ready-made vi that would be great to. I know the units are working as I can get a chart moving when a gauge is installed if I use Scan Interface and a basic vi, so the hardware works, but I can not get FPGA to work.

 

Thanks

Download All
0 Kudos
Message 79 of 108
(1,408 Views)

Can you save to TDMS while using scan interface ? Or using simulated data... this will allow you to work out whether the following is the problem:

−2519 LabVIEW could not load the TDMS file component. The component is expected in the National Instruments\shared\TDMS directory. You might need to reinstall LabVIEW to fix this problem.

Julian.

0 Kudos
Message 80 of 108
(1,396 Views)