10-10-2006 03:44 PM
10-11-2006 06:50 AM
10-11-2006 08:58 AM
10-11-2006 09:00 AM
10-11-2006 12:08 PM - edited 10-11-2006 12:08 PM
I'm not near a LV box now, so hopefully my memory is close to accurate.
1. The easy one first. If you right-click on the terminal constant, there's an option like "I/O Name filtering..." which gives the ability to "include advanced terminals". Many of the possible timing signals can only be seen after doing this right-click setting. I've often wished I could make it a global default because I almost always want to see the so-called advanced terminals. Don't think it's possible though.
2. Let's do a walk-through of your screenshot. First you identify a global encoder channel and configure it for finite acquisition. Next you identify a global pulse generation channel and configure it for continuous output. Next, it appears that you start the pulse generation task. Then, you try to read 3 samples from the encoder task. However, the encoder task has not been started, at least not explicitly.
Now, I'll admit to some ignorance here. I never use global channels and I always explicitly start my tasks. So I don't know what behavior to expect when calling DAQmx Read on a global channel whose associated task has been configured for buffered sampling but has not been explicitly started. I'm a little surprised you get a mere timeout error, but, well, so be it.
Suggestion: From the Encoder channel's call to DAQmx Timing, wire the task id output into a DAQmx Start prior to the call that configure's the pulse train's timing. I would also suggest wiring a non-default timeout value into the call to DAQmx Read, just so you have some way to control it.
(Aside: I know I've personally been wary what assumptions the DAQmx driver will make when I use an external sampling clock and am then required to specify a "rate" value. My real sampling rates are almost always in the 100 Hz to 50 kHz realm somewhere, but I always just wire in a value of "1" for external sampling rate. In my mind and in the rest of the program, the sample rate is interpreted as "samples per external clock edge" rather than as "samples per second.")
Another thing you might do for debug: after both tasks are started, go into a query loop. Call some of the DAQmx property nodes to query things like "Total Samples Acquired" or other properties that can give you some status about your task. Then only after hitting a front-panel Boolean stop button would you exit the loop and make the call to DAQmx Read.
- Kevin P.
Message Edited by Kevin Price on 10-11-2006 01:09 PM
10-12-2006 04:26 PM
10-16-2006 06:43 AM
Hi Mythilt,
You can route the start trigger over the RTSI lines for your devices by using the DAQmx Timing property nodes. Check out the following article – it goes into a lot of detailed synchronization methods using LabVIEW.
http://zone.ni.com/devzone/cda/tut/p/id/3615
Ed Waxler | Applications Engineer | National Instruments
10-16-2006 09:34 AM
For the final version of what I was attempting to do, we ended up using the RTSI bus. however, I did run into one question/problem afterwards. How do I reset the counter/timer card back to the state it was in before I called DAQmx Timing (Sample Clock).vi? What I am writing is part of a larger program and as such I want the counter task (it gets used by other vi's later on) to be back in the known state before the timing was modified, this is also because I disconnect the RTSI bus at the end of this test. Currently, the only thing that works is clearing the task and re-creating it, I was wondering if there was another way, I've tried using the timing property nodes, but keep getting errors.
Attached is a proof of concept vi that I wrote to test out the timing issues with the CAN card also added. I was hoping to avoid using the Analog card, but in the end had to for the CAN synching. The final version will have several other subVI's controlling two servos for the DUT.
10-16-2006 10:59 AM
Since I'm not certain about exactly what aspect of "state" you need to restore, I'll point you to some info that may help you evaluate for your particular situation. Check out the description copied from DAQmx Help in this thread.
Even simpler, if you haven't already tried it, is to simply Stop the task. Some (but not all, as far as I know) config settings can be changed while the task is stopped, then the task can be restarted to use those new settings. This would have less overhead than completely clearing and redefining the task from scratch.
There's also more than one way to use RTSI routing connections. Some are explicit, others are implicit, some have persistence beyond the end of a task, others wouldn't. Again, I'm not sure exactly what you need to accomodate so can only offer pointers about info to look into further...
-Kevin P.
10-16-2006 11:36 AM