08-03-2023 03:57 AM
Currently I have the attached vi which runs a mobile instrumentation rack which we move between test cells. (repurposed from a previous solution)
I want to add a flow meter (which runs as a counter task in max) but I'm not sure how to implement it so that logs into the same TDMS file as the one on the vi.
I can duplicate the code and have a separate TDMS file, but this obviously isn't ideal.
Could someone point me in the right direction for how to have multiple tasks in max logging to a single TDMS file.
08-03-2023 04:12 AM
Hi LVIEWPQ,
@LVIEWPQ wrote:
I can duplicate the code and have a separate TDMS file, but this obviously isn't ideal.
Could someone point me in the right direction for how to have multiple tasks in max logging to a single TDMS file.
AFAIK each DAQmx task maintains its own TDMS log file. Obviously not ideal in your situation…
(Have you tried to use the same file for both tasks? Which error did you get?)
Other option:
Don't use the DAQmx logging feature, but save the data to TDMS with your own routine. Then you can stream any data you like to your file…
08-03-2023 04:19 AM
@GerdW wrote:
Hi LVIEWPQ,
@LVIEWPQ wrote:
I can duplicate the code and have a separate TDMS file, but this obviously isn't ideal.
Could someone point me in the right direction for how to have multiple tasks in max logging to a single TDMS file.AFAIK each DAQmx task maintains its own TDMS log file. Obviously not ideal in your situation…
(Have you tried to use the same file for both tasks? Which error did you get?)
Other option:
Don't use the DAQmx logging feature, but save the data to TDMS with your own routine. Then you can stream any data you like to your file…
Hi Gerd,
Thanks for the swift response.
I have tried using the same file previously, it fails to run due to both tasks trying to lock the file for writing, not sure what the actual error code is, it was a while ago, I just know it wasn't possible.
What would be the best way to set up 2 different DAQ tasks to log to TDMS then?
I struggled previously to get multiple tasks to log to a single TDMS file.
If you have an example of this, it would make life a lot easier, and something I could extrapolate in future for additional requirements of the system.
08-03-2023 04:28 AM
Hi LVIEWPQ,
@LVIEWPQ wrote:
What would be the best way to set up 2 different DAQ tasks to log to TDMS then?
As you can define different groups within one TDMS file you can log different amounts of data (channels, samplerate) into one file…
08-03-2023 05:37 AM
I still get the -2539 Error saying it's locked by another process.
I feel like I need a way of merging the two data types before writing to the TDMS file.
08-03-2023 05:54 AM
There is an example for logging from multiple tasks: https://forums.ni.com/t5/Example-Code/TDMS-Data-Logging-From-Multiple-DAQmx-Tasks-in-LabVIEW/ta-p/37...
08-03-2023 06:06 AM
@cordm wrote:
There is an example for logging from multiple tasks: https://forums.ni.com/t5/Example-Code/TDMS-Data-Logging-From-Multiple-DAQmx-Tasks-in-LabVIEW/ta-p/37...
This example highlights the issue I'm facing very well.
I data set is a 1D Waveform, the other is a 1D DBL, I need a way to combine the two data types to be able to store them.
08-03-2023 07:48 AM
Hi LVIEWPQ,
@LVIEWPQ wrote:
I data set is a 1D Waveform, the other is a 1D DBL, I need a way to combine the two data types to be able to store them.
You can easily convert an 1D DBL array into a waveform, then you could append that waveform to your 1D array of waveforms…
08-03-2023 07:52 AM
@GerdW wrote:
Hi LVIEWPQ,
@LVIEWPQ wrote:
I data set is a 1D Waveform, the other is a 1D DBL, I need a way to combine the two data types to be able to store them.You can easily convert an 1D DBL array into a waveform, then you could append that waveform to your 1D array of waveforms…
Which functions would I use to do this?
I've tried Bundle, and build array, and there's nothing obvious when searching that converts to waveform?
08-03-2023 08:09 AM
or change the type of DAQmx Read.vi