Discussion:
Problem with creating individual channels digital I/O lines NI 6509 (C++)
(too old to reply)
Bret01
2008-06-02 12:40:08 UTC
Permalink
I am using visual studio C++. I have created individual tasks for each line using
DAQmxCreateTask("",&m_pDigInTask[x]); where this is in a loop.
 
I then assign the individual lines using
DAQmxCreateDIChan(m_pDigInTask[x],tempString,"",DAQmx_Val_ChanPerLine);
Where tempString is the indivdual channel for example: "dev1/port11/line4"
 
I also create digital output tasks along same lines as above except using DAQmxCreateDOChan.
 
The objective is to control each digital line seperately. My problem is that if I set two output lines to a value, for example
p11.0 and p11.1 and  then I read an input line p11.4 then both p11.0 and p11.1 are reset from the value I had written to them earlier. I thought that by separating the lines to individual tasks and channels as I showed above, this would make them independent of each other so that what I do on one line does not affect the others. Is this not the case, or am I doing something wrong?
 
Thanks for any help.
PBear
2008-06-04 20:40:10 UTC
Permalink
Hi Bret,
Sorry about the frustration that this may be causing. You are correct on the fact that you can create individual tasks per line on a port and run them at the same time. This is only possible if doing software timed DIO, as you are.
The problem that you are having arises from the DIO direction, port vs. line. For the 6509, this is a by port direction board. This means that all lines of a port will either be input or output at the same time. When calling a read from the port, all lines must change to read, thus resetting the port. More information about this can be found in the following KB.
KB 041A1KNI: On Which Devices can the Digital Input/Output (DIO) Lines be Individually Configured?<a href="http://digital.ni.com/public.nsf/allkb/FDEE00034B16F5E086256119005DC75A" target="_blank">http://digital.ni.com/public.nsf/allkb/FDEE00034B16F5E086256119005DC75A</a>
The following pictures show two test panels, one for an M-Series board and one for the 6509. You can see that on the M-series you can select the direction by line or by port where as on the 6509 you can only select by port.
<img src="Loading Image..."><img src="Loading Image..."> Message Edited by PBear on 06-04-2008 03:27 PM


ScreenHunter_02 Jun. 04 15.23.gif:
http://forums.ni.com/attachments/ni/70/8958/1/ScreenHunter_02 Jun. 04 15.23.gif


ScreenHunter_03 Jun. 04 15.23.gif:
http://forums.ni.com/attachments/ni/70/8958/2/ScreenHunter_03 Jun. 04 15.23.gif
Loading...