04-15-2013 04:42 PM
Hey y'all, I was wondering if I could get some help with a program I am trying to build. I am attempting to run a daqmx-related program; it involves controlling a set of pistons w/ voltage and collecting data coming in from a set of sensors. My largest issues at the moment are:
Whatever help you could provide would be much appreciated. I have attached a copy of the vi that I am working on. Thanks in advance!
-Hendrik
04-16-2013 02:42 PM
Hi Stefenmcloven,
The error you're seeing refers to a sampling rate error:
-20061 | Error | Invalid selection |
Error occurred in [BlockName] step. A signal frequency is higher than half the sample rate (Nyquist violation) or conflicts with other frequency values. |
You can fix this by increasing the sample rate or decreasing the frequency you are trying to write/read.
I had a look through your code and I have a few comments on how you could achieve desired functionallity.
If I understand correctly, you have input and output simultaneously, but at different rates. If this is the case you may want to have two loops running at different speeds to accomplish this. One way to do this would be through a producer-consumer architecture, you can find more information at this thread:
http://forums.ni.com/t5/LabVIEW/Producer-Consumer-Architecture/td-p/494883
A few other comments I have on this:
1) It is not a great idea to use both DAQ assist and DAQmx in the same VI, use one or the other but not both
2) Nestled while loops may lead to unexpected behavior, as you will not be able to access the first loop while the second is running. Here's a good example on using the same producer-consumer architecture for writing data to a file.
https://decibel.ni.com/content/docs/DOC-2431
Please let me know if this helps or if you have any other questions!
-N
04-17-2013 09:31 AM
Thanks for the pointers, I appreciate it quite a bit!