LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Using DIG_Out_Prt to control 8 bits

I am using a PXI-6508 96-line DIO card. All bits are outputs and are wired to a Virginia Panel and subsequently to an ITA. I have organized my outputs in 8-bit groups since the configuration is for 12 8-bit ports.

Unfortunately, the DIG_Out_Prt assumes you are writing 32-bits. The Easy I/O function gives you control of the port size. I would prefer not to use the Easy I/O functions or keep track of state of all 96-bits since I have routines that write individual lines and routines used for writing patterns.

Am I missing something? Is there another function available? Is the only way to use the DIG_Out_Prt function is to know the state of all 32-bits to be written?
0 Kudos
Message 1 of 3
(3,589 Views)
I just started using the same module and I don't see any problem. I need
only 5 bits on 1 port, so here's what I am doing.

retVal = Init_DA_Brds(AT_BOARD_NUM, &boardCode);

// Configure Port A for output, no handshaking (AT_PORT_NUM = 0)
retVal = DIG_Prt_Config(AT_BOARD_NUM, AT_PORT_NUM, 0, 1);

retVal = DIG_Out_Prt(AT_BOARD_NUM, AT_PORT_NUM, Attenuation);

Even though DIG_Out_Prt takes Attenuation as a long, I see that only 8 bits
change on the output, which is what I want when I write to PortA.


vishi

"DAQtech" wrote in message
news:5065000000080000002B6F0000-1042324653000@exchange.ni.com...
> I am using a PXI-6508 96-line DIO card. All bits are outputs and are
> wired to a Virginia Panel and subsequently to an ITA. I have organized
> my outputs in
8-bit groups since the configuration is for 12 8-bit
> ports.
>
> Unfortunately, the DIG_Out_Prt assumes you are writing 32-bits. The
> Easy I/O function gives you control of the port size. I would prefer
> not to use the Easy I/O functions or keep track of state of all
> 96-bits since I have routines that write individual lines and routines
> used for writing patterns.
>
> Am I missing something? Is there another function available? Is the
> only way to use the DIG_Out_Prt function is to know the state of all
> 32-bits to be written?
0 Kudos
Message 2 of 3
(3,589 Views)
Greetings,

If you look at the help for DIG_Out_Prt() (Start >> Programs >> National Instruments >> NI-DAQ >> NI-DAQ Help), the "pattern" parameter is described as an "8-bit digital pattern for the data written". Thus, even though its type is i32, you are only writing 8 bits.

Good luck with your application.

Spencer S.
0 Kudos
Message 3 of 3
(3,589 Views)