08-03-2023 08:11 AM - edited 08-03-2023 08:12 AM
Hi LVIEWPQ,
@LVIEWPQ wrote:
I've tried Bundle, and build array, and there's nothing obvious when searching that converts to waveform?
Did you look into the waveform functions palette?
There is a function dedicated to build a waveform from its components…
08-03-2023 08:29 AM
@cordm wrote:
or change the type of DAQmx Read.vi
So how do you do that when the DAQ Read is a counter?
08-03-2023 08:38 AM
Sorry, I forgot about the "counter" part. Forget about the second option in that case.
08-03-2023 09:35 AM
RE: combining Counter 1D array data with AI waveform data:
First let me show you how you *can* do it, then get into a little discussion about whether you *should* do it.
1. Use the AI waveform as a starting point for making a waveform out of your 1D counter data. Illustrated here.
2. Change some particular attributes of that waveform to give your counter channel its own name. Illustrated here.
3. Consult the standard set of attribute names used by DAQmx to know what attributes to change. Table shown here.
But *should* you do it? Well, that probably depends on the nature of your counter task, and whether & how it's sync'ed to your AI task.
If the tasks are synced and share a sample clock, it would be appropriate do the steps above and put them in the same TDMS group.
If not synced but the counter task uses a regular sample clock, it could still be appropriate to put the counter data into a waveform, adjusting t0 and dt as needed.
If the counter task uses Implicit timing (such as frequency measurement), then you should *NOT* try to put that into a waveform. What I've done is turn the data into 2 1D array channels -- one for the frequencies, another for the times when those frequency samples were taken, where time relative to task start is just a cumulative sum of (1/freq).
-Kevin P
08-04-2023 02:54 AM
@Kevin_Price wrote:
RE: combining Counter 1D array data with AI waveform data:
First let me show you how you *can* do it, then get into a little discussion about whether you *should* do it.
1. Use the AI waveform as a starting point for making a waveform out of your 1D counter data. Illustrated here.
2. Change some particular attributes of that waveform to give your counter channel its own name. Illustrated here.
3. Consult the standard set of attribute names used by DAQmx to know what attributes to change. Table shown here.
But *should* you do it? Well, that probably depends on the nature of your counter task, and whether & how it's sync'ed to your AI task.
If the tasks are synced and share a sample clock, it would be appropriate do the steps above and put them in the same TDMS group.
If not synced but the counter task uses a regular sample clock, it could still be appropriate to put the counter data into a waveform, adjusting t0 and dt as needed.
If the counter task uses Implicit timing (such as frequency measurement), then you should *NOT* try to put that into a waveform. What I've done is turn the data into 2 1D array channels -- one for the frequencies, another for the times when those frequency samples were taken, where time relative to task start is just a cumulative sum of (1/freq).
-Kevin P
So in this case I'm running a flow meter which records in Hz then gets converted to to l/min.
What would be the most appropriate way to log the Pressure & Thermocouple channels, and then the flow rate into a single timestamped log file?
08-04-2023 05:22 AM - edited 08-04-2023 05:40 AM
@LVIEWPQ wrote:
@Kevin_Price wrote:
RE: combining Counter 1D array data with AI waveform data:
First let me show you how you *can* do it, then get into a little discussion about whether you *should* do it.
1. Use the AI waveform as a starting point for making a waveform out of your 1D counter data. Illustrated here.
2. Change some particular attributes of that waveform to give your counter channel its own name. Illustrated here.
3. Consult the standard set of attribute names used by DAQmx to know what attributes to change. Table shown here.
But *should* you do it? Well, that probably depends on the nature of your counter task, and whether & how it's sync'ed to your AI task.
If the tasks are synced and share a sample clock, it would be appropriate do the steps above and put them in the same TDMS group.
If not synced but the counter task uses a regular sample clock, it could still be appropriate to put the counter data into a waveform, adjusting t0 and dt as needed.
If the counter task uses Implicit timing (such as frequency measurement), then you should *NOT* try to put that into a waveform. What I've done is turn the data into 2 1D array channels -- one for the frequencies, another for the times when those frequency samples were taken, where time relative to task start is just a cumulative sum of (1/freq).
-Kevin P
So in this case I'm running a flow meter which records in Hz then gets converted to to l/min.
What would be the most appropriate way to log the Pressure & Thermocouple channels, and then the flow rate into a single timestamped log file?
First Kevin is on point! But, since you gave us some additional information about your channels I can jump in and offer some advice.
The Timing of each Task becomes important for the exact solution but, let's assume for simplicity that each channel is sampled at regular intervals.
Find the highest sample rate then resample each of the other channels to have the same dT. There is a function that interpolates the "in-between" reading points using one of several defined interpolation algorithms. For Pressure, I would chose a sin(x)/dx since that mimics a wave function over time (pressure moves in waves - demonstrate for yourself by dropping a rock in any pond) EDIT: make that any liquid pond, I'm from Minnesota so, try singing into a rotating fan.
For Flow Rate or Temperatures chose a linear interpretation but for different reasons:
Which really is the same thing, the changes are averaged out, Temp by the DUT, Flow rate by the sensor.
08-07-2023 04:42 AM
@JÞB wrote:
@LVIEWPQ wrote:
@Kevin_Price wrote:
RE: combining Counter 1D array data with AI waveform data:
First let me show you how you *can* do it, then get into a little discussion about whether you *should* do it.
1. Use the AI waveform as a starting point for making a waveform out of your 1D counter data. Illustrated here.
2. Change some particular attributes of that waveform to give your counter channel its own name. Illustrated here.
3. Consult the standard set of attribute names used by DAQmx to know what attributes to change. Table shown here.
But *should* you do it? Well, that probably depends on the nature of your counter task, and whether & how it's sync'ed to your AI task.
If the tasks are synced and share a sample clock, it would be appropriate do the steps above and put them in the same TDMS group.
If not synced but the counter task uses a regular sample clock, it could still be appropriate to put the counter data into a waveform, adjusting t0 and dt as needed.
If the counter task uses Implicit timing (such as frequency measurement), then you should *NOT* try to put that into a waveform. What I've done is turn the data into 2 1D array channels -- one for the frequencies, another for the times when those frequency samples were taken, where time relative to task start is just a cumulative sum of (1/freq).
-Kevin P
So in this case I'm running a flow meter which records in Hz then gets converted to to l/min.
What would be the most appropriate way to log the Pressure & Thermocouple channels, and then the flow rate into a single timestamped log file?First Kevin is on point! But, since you gave us some additional information about your channels I can jump in and offer some advice.
The Timing of each Task becomes important for the exact solution but, let's assume for simplicity that each channel is sampled at regular intervals.
Find the highest sample rate then resample each of the other channels to have the same dT. There is a function that interpolates the "in-between" reading points using one of several defined interpolation algorithms. For Pressure, I would chose a sin(x)/dx since that mimics a wave function over time (pressure moves in waves - demonstrate for yourself by dropping a rock in any pond) EDIT: make that any liquid pond, I'm from Minnesota so, try singing into a rotating fan.
For Flow Rate or Temperatures chose a linear interpretation but for different reasons:
- Temperatures change relatively slowly unless there is almost no mass to hold the heat energy.
- Flow Rate measurement changes are inherently dampened by the centripetal force of the sensor
Which really is the same thing, the changes are averaged out, Temp by the DUT, Flow rate by the sensor.
In terms of sample rate, it's relatively low (1Hz) and consistent across all measurements. So the smoothing isn't necessarily a concern, and this seems to be far beyond what I am trying to achieve.
My aim is to have a program that will produce 1 data point each second for Pressure, Temperature and coolant flow, with each reading having a timestamp.
It's how to get the readings from the Pressure & Temperature task and the counter task to log to a single file with a timestamp. I'd be quite happy with it in a .csv file, but I just can't seem to get my head around how to log things to a single text file, and the time stamp to work.