05-30-2023 09:35 PM
My VI runs perfectly fine as far as controls and reading data but as soon as I start writing/ recording data to any kind of file (tdms or excel) the acquisition system starts lagging. At most I'm trying to write 28 channels of data 8 pressure channels (2 modules x 4 9237),16 channels of Thermocouples ( 4 modules x 4 channels 9219), 4 current channels (1 module x 4 channels 9219).
any help with this would be greatly appreciated
05-31-2023 07:59 AM
What do you mean by lagging? How do you tell? Did you check the actual execution rate of the loop?
File I/O is a slow process. Use low level File I/O API for streaming instead. Avoid using Express VI. Besides, use the binary file like TDMS. It provides much better read and write performance.
05-31-2023 08:08 AM
Please save as LabVIEW 2020.
05-31-2023 08:17 AM
as the previous comment said, writing files takes time, and using express vi even though is easy, it lacks performance.
Use the low level vis,
Outside the Loop - OPEN/Create File
Inside loop, combine the data in the format you want to use (for ex, if you want it to be csv file, use format into file
Outside loop, Close file.
A more elegant solution, would be to create a separate loop just for saving data so it would not interfere in the acquisition loop.
But that would require more complex structures to control the execution of parallel loops.
05-31-2023 09:32 AM
I modified your code. See attached VI. Hopefully, it works. Let us know.
~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Proverbs 16: 3
05-31-2023 10:15 AM
When the VI runs the data being read looks great on the chart data and waveform graph. as soon as i enable the write/ record data portion of the program. the the data chart and wave form start to be out of sync with what the actual program is doing and is clearly seen on the graph that the timing is off and gets worse over time. this only happens when I start the record data function.
05-31-2023 10:35 AM
GRCK5000 Thank you for looking into this. Im am getting an error message at soon as i start the VI.
05-31-2023 10:40 AM
@Kasper19 wrote:
GRCK5000 Thank you for looking into this. Im am getting an error message at soon as i start the VI.
50103 usually suggests you've got NIMax open as well
05-31-2023 10:41 AM
your code, is setting up channels everytime, I'm assuming you don't need to setup the data acquisition every loop iteration.
Keep inside the only the code that reads data and saves into the file.
This is probably the only part that needs to be on the loop .
There are a lot of activities going on that delays the writing and updating, this is why you are observing the behavior you described.
05-31-2023 12:07 PM
The modification isn't working, I'm now getting a synchronization Error