06-21-2006 11:05 AM
06-22-2006
10:41 AM
- last edited on
09-27-2026
11:31 AM
by
Content Cleaner
Hello Maggie,
If you would like to use DAQmx, you definitely can with LabVIEW 7.1. This is recommended. DAQmx was originally released with LabVIEW 7.0.
Next, this example switches between two input tasks based upon a stop trigger. I'm not sure this is exactly what you are looking for based upon your post. Also, this example will not port directly to DAQmx Base since DAQmx base does not support property nodes.
Regardless of whether you choose to upgrade to DAQmx, or stay with DAQmx Base you can create two tasks (one AI one AO) and have them both running. There are many examples that show how to setup and run either AI or AO for both DAQmx and DAQmx Base. The concepts in the examples can be combined into one program. DAQmx examples are found in Example Finder under Hardware Input and Output >> DAQmx. Example Finder can be found in LabVIEW under the help menu. DAQmx Base examples can be found in your start menu under Programs >> National Instruments >> NI-DAQmx Base >> Examples.
I hope this clarifies things.
Jesse O.
Applications Engineering
National Instruments
06-22-2006
01:18 PM
- last edited on
09-27-2026
11:32 AM
by
Content Cleaner
Hi Jesse, thanks for your fast response. I forgot to mention that I am using Linux RH. According to the readme DAQmx only works in LV8.0 or later versions for Linux. Am I misunderstanding this?
I should have been more explicit originally about what I'm trying to do. I have been able to have two tasks running simultaneously without a problem. However, I need to switch between the two tasks (I think) because my AO Voltage must be determined from an AI measurement, and I would like to update AO at 100Hz or greater. Right now I have a working VI in which I have a sequence structure that switches between AO and AI and I pass the AI measurement to determine AO voltage. Each time I have to restart the task, run a finite number of samples, and close the task, so the fastest I can update is around 4Hz which is not sufficient.
How else can I change the voltage setting while running an AO task?
Maggie
06-23-2006 02:35 PM
Hello Maggie,
You are correct that DAQmx 8 is only supported by LabVIEW 8
on a machine running RH Linux. I still believe that the application you
first mentioned is not exactly what you are looking for.
If you are wanting you can continuously read in data and
write that data back out to your analog output channel. You do not need
to start and stop the two tasks. I have posted code below that performs
hardware timed analog output it uses a loop to update your analog
output. This application uses a hardware timed single point sample mode. It would be system and code dependent, but you should probably be able to run at 100Hz. You could also use continuous acquisition, however you will have to deal with the delay generated by using the onboard FIFO. You could apply this code's concept to your application and add analog input to it.
Regards,
Jesse O.
Applications Engineering
National Instruments
06-27-2006 10:39 AM
06-28-2006 05:35 PM
Hello
mktrias,
I'm glad what I provided before was useful. The hardware timed single
point acquisition is only supported in Windows, and this is why you are getting
the error. The delay I was referring to before with a buffered output is
that your analog output buffer (FIFO) is roughly 8000 samples. This means
that if you are updating your buffer during your output it will take time for
the new samples to be generated (because samples are already present in the
buffer).
I believe you are also getting errors (after 8k samples) because of your finite
generation. Finite tasks are typically used to generate a set of outputs
and then you stop the task. In your case you seem to want to continuously
output samples. If this is the case either use software timed or
continuous output. There are examples showing how to code either of
these. You can typically find them here:
/usr/local/natinst/LabVIEW-8.0/examples/daqmxbase/dynamic/ao
The software timed output example is called Gen Mult Volt Updates-SW Timed.vi
and the two continuous examples (one with and one without regeneration) start
with Cont Gen Voltage Wfm-Int Clk. Regeneration means that when all the
samples you have written to the FIFO have been used it will use the samples you
previously wrote again. The non-regeneration example shows that you need
to be continuously sending data to the analog output FIFO before it
finish/empties its FIFO.
Finally, if you look at either of the continuous acquisition example you will
see that the error cluster from the DAQ task is unbundled and used to stop the
while loop if an error occurs. This is not present in the posted code,
and it makes it harder to determine when and where an error is occurring.
I hope this helps,
Jesse O.
Applications Engineering
National Instruments