Discussion:
Write to single line with DAQmx
(too old to reply)
Greg_NTI
2006-08-09 13:40:13 UTC
Permalink
Hello,
 
life was so easy with traditional DAQ...
 
I'm trying to control single lines of DIO cards with DAQmx und CVI 8.0.1 , - the equivalent in traditional DAQ would be "DIG_Out_Line"
 
What I do:
- I create a task
- I add one channel for each digital line
 
DAQmxCreateTask (tsk_MAIN_OUTPUT_A, &tMainOutputA);DAQmxCreateDOChan (tMainOutputA, "Dev1/port0/line0", "Line0",DAQmx_Val_ChanPerLine);
..
..
DAQmxCreateDOChan (tMainOutputA, "Dev1/port0/line7", "Line7",DAQmx_Val_ChanPerLine); 
 
When I look into the "WriteFunction" collection, I find all kind of functions that write to tasks, but none which writes to channels...
The examples which comes with CVI only writes to a port, - 8 bit at a time, - which is what I want to avoid...
 
What am I missing?
 
Thanks a lot!Greg
 
 
 
Greg_NTI
2006-08-11 07:10:09 UTC
Permalink
Hello Micaela,
I've found out about the difference of tasks and channels in the meantime. However, thanks a lot for answering. The application is running fine now.
Best Regards,
Greg
 
 
MrFingers
2007-06-18 17:10:19 UTC
Permalink
I have a 6516 card and I'm try to control the eight lines on port 3 individually.  I've gone through all the sample code and such.  Is this card capable of this?  Here's the code that I have write now.
Dim digitalWriteTask As Task = New Task()digitalWriteTask.DOChannels.CreateChannel("Dev1/port3/line0", "port1", ChannelLineGrouping.OneChannelForAllLines)Dim writer As DigitalSingleChannelWriter = New DigitalSingleChannelWriter(digitalWriteTask.Stream)writer.WriteSingleSamplePort(True, 1)
I've tried ChannelLineGrouping.OneChannelForEachLine and DigitalMultiChannelWriter with no luck.  I also tried making a task in MAX to control Dev1/port3/line0 and this doesn't work either.  I'm starting to think this isn't supported on this card.
Could any shed some light on this for me.
 
Thanks in advance,
Gary

Loading...