The DAQmx VIs are installed with the DAQmx Driver. For LabVIEW 2012, you'll need at least DAQmx 9.5.5 (according to here)--DAQmx 9.7 is the latest though. However, installing DAQmx 9.7 (or 9.5.5) will replace whatever version you have currently installed and there is no support for LabVIEW 8.6 in DAQmx 9.7 (or 9.5.5), so if you still need to do development in LabVIEW 8.6 but want to try out 2012 I would find another computer/image to install LabVIEW 2012 on with an appropriate version of DAQmx (annoying, right?).
Please find attached the 2 VIs I posted saved for LabVIEW 8.6.
Hello John: thanks a lotttt for your so prompt reply. I will try the Labview 8.6 with your vi. With great appreciate to you.
Hello John: I run the Labview 8.6 vi you post for me, but I want to confirm with you some issues.
Thank you very much for your help!
Assuming you're using the AbsoluteEncoderCounters example:
1. Yeah that's what I had intended--the specs you gave included a possible 10- or 12- bit configuraiton so I wanted to accommodate both. Keep in mind I don't have the encoders to actually try it out for myself though...
2. I had configured it this way to keep it a little simpler for test purposes. You can manually turn the encoder slowly and check the value as you do it to make sure the acquired data matches reality. To get the task to sample the encoder data at a fixed rate you should just need to modify the ctr0 task to run continuously:
a. Add a DAQmx Timing VI to the task (before committing/starting)--configure it to "Implicit", and make the sample mode "Continuous Samples".
b. Modify the high time for your task depending on your desired sample rate (sample rate= 1/(high time + low time)).
c. Move the DAQmx Start to before the loop, but after all the other tasks have started (wire the error out from the Merge Errors function to the input of the DAQmx Start to achieve this). Remove the DAQmx Stop.
d. You no longer need to commit the task explicitly.
e. Remove the event structure and the acquire button (or if you're feeling up to it replace it with a dynamic DAQmx Every N Samples Event...)--you could instead just read every loop iteration and poll the stop button in your loop to keep it simple.
f. Depending on your sample interval (in part b), you may need to read back more than 1 "sample" per loop (keep in mind a single "sample" is really 12 samples of the digital input line). You'll have to parse the array accordingly.
3. Before following the steps in #2, try just manually rotating the shaft if possible and keeping it stationary through several reads for troubleshooting, then slightly turn the axis and repeat, and keep doing this. You'd only expect a large jump when the measurement transitions between 4095 and 0.
Once the shaft is rotating on its own, you could run into seemingly random measurements if the sample rate is not enough (at the point where you are uncertain about the number of rollovers that have occurred). If you know the direction of movement, the sample rate must be greater than (not equal to) the rate that the shaft is turning. If you don't know the direction of motion, the sample rate needs to be greater than (not equal to) twice the rate the shaft is turning.
Hello John: thanks a lot for your detail instructions. I will find a solution following your method. Thanks a lot once more!
I want to ask you about the Analog voltage output issue. Now I'm using the output port a01 to control the proportional valve.
I compile the vi program, after I stop the program, it seems the valve still get the signal from the output a01.
Only after I shutdown the vi, there is no signal to the valve. I don't know what happened. I'm compiling a control vi. If I can't solve this problem, I can't continue the next job, how can I do?
Thanks a lot!
Just write 0 (or whatever voltage you want) to the output before exiting your program. Resetting the device would also revert the output back to 0 volts.
I post a Labview program to describe the problems I met. Actually, now I'm using the USB-6353 DAQ to control the hydraulic system to finish the task. There are two analog signal outputs to control the pressure of the valves and 3 inputs encoder angular and valves pressure respectively. I have to get the 2 pressure signals of valves at the same time. Now I meet the problems that the response time is too long of the close loop control and also the other problems as I marked in the attachments. Would you please have a review and help to find the solutions? I tried to find the way, but it seems the troubleshooting is very difficult.
Thanks a lot!