06-20-2013 05:36 PM
Hello,
I am new to LabVIEW and I am writing a VI that sends 2 voltage (AO voltage) to a motor, and read the voltage input (AI voltage) from a strain gauge and one of the corresponding AO signal that I sent out to the motor. Also, the VI reads encoder value. I am using a PCI 6230.
I am unsure of the difference between the number of samples per channel in DAQmx Read (AI Volt), DAQmx Read (Encoder), and DAQmx Write (AO volt).
If I set all three values to 1 (like in the attached VI), I will get a log data that has logical data for DAQmx Write (AO volt) and DAQmx Read (Encoder) (values changing and logged every 1ms). However, the log data from DAQmx Read (AO volt) has some error (it's not logging data with increment of 1ms), then the Error 200279 shows up.
If I set DAQmx Read (AO volt) to 1000, and the other two to 1, I will get DAQmx Read (AO volt) data with increment of 1ms, and the others increment of 1s. While if I set all to 1000, my encoder and DAQmx write data will lag (shows up late in the log) by 1s (transient data is not shown, only stedy state after 1s).
I have been trying to troubleshoot and read about the error description but found no helpful clues.
Appreciate your help.
Thanks a lot!
06-20-2013 06:07 PM
Or to be precise, how can I make sure that all three data signals that I am logging are logged at the rate of 1ms, and the data logged at a time stamp is the real data that is occuring in reality (without lag). Thanks a lot!
06-21-2013 01:52 PM
Hi diamondoface,
I looked over your code and there a couple of options. You can remove the hardware timing VI in the AI voltage task, and let everything be software timed, or synchronize all of your modules together with the hardware timing. The first option will result in samples that are taken at the same approximate time, but depending on your OS, it could vary up to 3-5ms, instead of every 1ms, as you were intially wanting. That method will have the input and output occur fairly simultaneously, however.
The second option allows you to start all of the task simultaneously, and each would be timed based on the same hardware clock on your PCI 6230. It would allow you to have very accurate sample rate. Follow the instructions linked here, to set up that sort of an acquisition on a single device.
06-21-2013 03:53 PM - edited 06-21-2013 03:53 PM
Hi Thomas,
Thanks for your inputs. I have tried using the "Shared Sample Clock" example but I have an error which says:
Error -200077 occurred at Property Node DAQmx Timing (arg 1) in DAQmx Timing (Sample Clock).vi:6->AnalogOutputandInputRev1c.vi
Possible reason(s):
Requested value is not a supported value for this property. The property value may be invalid because it conflicts with another property.
Property: SampTimingType
Requested Value: Sample Clock
You Can Select: On Demand
Task Name: _unnamedTask<2DE>
And then,
Error -50103 occurred at DAQmx Start Task.vi:3
Possible reason(s):
NI Platform Services: The specified resource is reserved. The operation could not be completed as specified.
Task Name: _unnamedTask<2DF>
I have attached my modified VI here as well.
I would like all my tasks to occur at the same time, and most importantly, logged at the time it happens without some delay.
Would you please advise on what's going wrong with my VI this time?
Thank you very much.
06-24-2013 09:44 AM
Hi diamondoface,
Take a look at the following documents. This document discusses the various reasons that can cause the -50103 error, and this document provides insight into how to possibly fix it in your case. It looks like you need to combine your AO tasks.
I suspect the -200077 error could be a result of the -50103 error. The property node conflict may be a child of the reservation error.