Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with real time logging on CompactRIO 9022

Hi,

 

I have CompactRIO 9022 model and 9112 chassis. I'm trying to log AI data coming from 16 AI channels. AI module is NI 9234. This module's max data rate is about 51kS/s.

I implemented FPGA module that just read AI values from 16 channels and put AI data into DMA FIFO. So, the actural data rate is controlled by setting count in loop timer within the while loop in FPGA.

Problem is RT module. I have producer/consumer structure. So, the producer loop gets data out of DMA FIFO, which is filled in FGPA module and also put those data into RT FIFO. On the other hand, the consumer loop read the data out of RT FIFO and write the data into *.tdms file. Problem I think is this FILE I/O part. Without the File I/O, I see that the RT module can read data at 50k times/sec. Once I put  File I/O part in the code, the IO part slow down the system. I can't achieve 50k times/sec acquisition with writing data in tdms file. Is this the way it should be? I wonder if I can achieve high acquisition rate (50k samples/sec) with writing large data into a file.

 

I'll repeat my question. I think I have unorganized statement.

What I have is here.

  - CompactRIO 9022, chassis 9112, 4 X NI 9234 modules.

 

My goal is here.

 - Read 16 channels of AI data as quickly as I can. Let say 50k samples per sec since NI 9234's max data rate is 51kS/s.

 - Log AI data into a file at the same rate as data is acquired.

 

My question is "

 - Can I achieve 50k AI readings (16 channels) per second with the file writing?

 - If I can, is there any recommendation for program structure, loop setting, any type of buffuer I need to use?

 

 I attached my RT code.

 

Thanks.

Download All
0 Kudos
Message 1 of 2
(3,087 Views)

Hi CRIOuser,

 

Generally, you only want to use one timed loop in your RT VI and do things like file I/O and network communication in a regular while loop.  You can see the recommended structure in Figure 3.11 (page 30) of the cRIO Developer’s Guide.   Have you tried using one of the example projects from the NI Example Finder?

Jayme W.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(3,060 Views)