12-17-2009 03:37 PM
I followed the directions in CVI to create a two task, one task creating a phyiscal channel for each output and the other task for creating a phisical channel for each input. My question is how do I write/read physical channels in CVI. The only functions I see relate to writing/reading an arrays to a tasks, not a physical channel.
12-17-2009 07:56 PM
You might want to go to DAQmx Getting Started to get an idea of what DAQmx is.
Your task contains all of the phsyical channels you define with the DAQmx Create Channel or what you define in MAX. When you, for example, use a DAQmx Write with a specific task, all of those channels in the task are written to. When you perform a DAQmx Read with a specific task, all of the channels in the task are read. You can one or many channels in a task.
12-18-2009 08:36 AM
Is there a way to use the DAQmx in a similar way as the Traditional DAQ's DIG_Out_Line and DIG_In_Line? I'm guessing from what you are stating is that if I want to just write to one line, then I need a task for each line, is that correct?
12-18-2009 09:02 AM
Yes, using a separate DAQmxWriteDigitalx/WriteBinaryx is equivalent to using a separate Dig_Out_Line.
12-18-2009 09:27 AM
I think I'm missing something fundamental. Attached is a sample project I started. I have two tasks, one for inputs the other for outputs. When creating the tasks, I used one channel per line which created a name for each channel.
When using any of the DAQmxWriteDigitalx commands, you can only write an array to a task, no reference to a physical or named channel. When writing an array in this task, how do you know which element in the array corresponds to which channel?
12-18-2009 09:28 AM
12-18-2009 09:46 AM
For simple writes to a line, you should like at the example called WriteDigChan. This can be used for single or multi channels. If you have specified channels 2 and 3 in the DAQmxCreateDOChan, then when you pass the Boolean array to DAQmxWriteDigitalLines, element 0 is the value for channel 2 and element 1 is the value for channel 3. If you want to control a single channel, you would have an array with a single element.