Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQPad-6016 extended digital I/O configuration

I do have a severe configuration problem with the DAQPad 6016 digital I/Os. The device is part in a functional circuit test system.

The ports are configured this way:

    P0: all lines are outputs, assigned to
daqDigitalOutTask, digWriter
    P1:
all lines are outputs, assigned to daqDigitalOutTask, digWriter
    P3.2, P3.3, P3.4: are inputs, assigned to daqDigitalInTask, digReader

    P2: all lines are inputs, assigned to daqDigitalInTask, digReader
    P3.0, P3.1: are inputs, assigned to daqDigitalInTask, digReader

    P3.5, P3.6, P3.7: are bidirectional, assigned to daqDigitalOutTask2, digWriter2 and daqDigitalInTask2, digReader2

    The pin assignment is fixed. There might be options to change line assignment on P3.

Initialization is done this way and works well:

                daqDigitalOutTask = new Task("DigOut");
                daqDigitalOutTask.DOChannels.CreateChannel(                            .DIChannesl. for inputs
                    CreateChannelList(physicalChannels, digOutputConfig),            expands to "dev1/port1/line0, ..."
                    "DigOut", ChannelLineGrouping.OneChannelForEachLine);
                digWriter = new DigitalMultiChannelWriter(daqDigitalOutTask.Stream);

Now, when writing to digital outputs

    digWriter.WriteSingleSampleMultiLine(true, vector);

everything is fine and the outputs are set to the desired state. But when reading the inputs

    bool[,]
vector  = digReader.ReadSingleSampleMultiLine();

the DAQpad 6016 forgets about the outputs and simply resets them. So I can use either outputs or inputs, but not both.

Is it a bug in DAQmx 8.3, a programming error or a feature of the 6016 ?

The plan was to run all configured tasks. The daqDigitalOutTask should provide static stimulus and daqDigitalInTask should return the I/O state. The daqDigitalOutTask2 and daqDigitalInTask2 should set stimulus or return state but not at the same time.

Regards,
Marko

Hardware:   DAQPad-6016
Software:    DAQmx-8.3, .net libraries, C# 2005
see also: http://forums.ni.com/ni/board/message?board.id=250&message.id=27315
0 Kudos
Message 1 of 2
(2,940 Views)
Digging into the documentaion I found a hint, that a 8255 is used for the extended ports. Thus you can configure P1.0-P1.7, P2.0-P2.7, P3.0-P3.3 and P3.4-P3.7 as input or output. Individual line assignment is not possible, only group assignment Smiley Mad

I verified this using Measurement & Automation Studio, i.e. I created tasks (P3 was split) and run Test on them.

I am wondering why the 6016 specification does not include the information, that port data direction is set in groups only (except for P0).

Regards,
Marko
0 Kudos
Message 2 of 2
(2,931 Views)