09-03-2019 10:37 AM
Hi all,
I have been developing a VI to open and close a 3/2 solenoid valve which creates a pulse in a fluid line. The VI uses 2 producer and consumer loops to send a voltage pulse and then a third loop to log this pulse and the resulting pressure in a transducer.
At the moment i can only figure out how to log both these values at the same sample rate but it would be great if i could have them log at different rates i.e pressure 100 Hz, voltage pulse 10 Hz if someone could please give me some advice on this?
I am also very unsure about my architecture in general as i am very much a beginner. Is this the best way to go about this?
Feel free to tear me to shreds 🙂
Xander
09-03-2019
01:25 PM
- last edited on
12-03-2024
03:38 PM
by
Content Cleaner
1. I don't see a need for either of your Producer/Consumer loops. All the consumers do is update indicators. You don't have anything that timing critical that you can't just keep them together.
2. Do NOT log based on local variables. That is just riddled with race conditions. Instead, you should be using a queue to send data to the logging loop. This way, you can easily include a timestamp, etc with the data (ie use the Waveform data type).
3. Please, stop using teh DAQ Assistant. The main complaint with it is the use of the Dynamic Data Type. We have seen SOOOOOOOOOOOOOOOOOOO many issues from it abstracting the actual data. Go give this article a good read: Learn 10 Functions in NI-DAQmx and Handle 80 Percent of Your Data Acquisition Applications
4. What do you want your log file to look like? If you are sampling at different rates, then you would likely need 2 files to save the data and then correlate them somehow with timestamps.
09-04-2019 03:24 AM
Hi,
Thanks for getting back to me I really appreciate it! Please see my responses below.