National Instruments 321645c-01 Welding System User Manual


 
Chapter 2 Function Reference DIG_Block_In
NI-DAQ FRM for PC Compatibles 2-150
©
National Instruments Corporation
Using This Function
DIG_Block_In initiates an asynchronous transfer of data from a specified group to your
buffer. The hardware is responsible for the handshaking details. Call
DIG_Grp_Config for
the DIO-32F and the DIO 6533 (DIO-32HS), or
DIG_SCAN_Setup for all other devices at
least once before calling
DIG_Block_In. DIG_Grp_Config and DIG_SCAN_Setup select
the group configuration for handshaking.
If you use a DIO-32F or DIO 6533 (DIO-32HS),
DIG_Block_In writes data to all bytes of
your buffer regardless of the group size. If the group size is 1 (which is supported only by the
DIO 6533),
DIG_Block_In writes to the lower eight bits of buffer[0] on the first read from
the group and the upper eight bits of buffer[0] on the second read from the group. For
example, if the first read acquired is 0xCD and the second data acquired is 0xAB, buffer[0]
is 0xABCD. If group size is 2,
DIG_Block_In writes data from the lower port (port 0 or
port 2) to the lower eight bits of buffer [0] and data from the higher port (port 1 or port 3) to
the upper eight bits of buffer [0]. If group size is 4,
DIG_Block_In writes the data from
ports 0 and 1 to buffer [0] and the data from ports 2 and 3 to buffer [1].
Note
On the DIO-32F, you cannot use DIG_Block_In with a group of size = 1. On the
DIO 6533, you can use
DIG_Block_In with a group of size = 1, but count must
be even in this case.
If you use any device but a DIO-32F or DIO 6533, NI-DAQ writes to the lower byte of each
buffer element with a value read from the group and sets the upper byte of each buffer element
to zero. If the group size is 2, the lower byte of buffer[0] receives data from the first port in
the group and the lower byte of buffer[1] receives data from the second port. NI-DAQ sets
the upper bytes of buffer[0] and buffer[1] to 0.
If you have not configured the specified group as an input group, NI-DAQ does not perform
the operation and returns an error. If you have assigned no ports to the specified group,
NI-DAQ does not perform the operation and returns an error. You can call
DIG_Block_Check to monitor the status of a transfer initiated by DIG_Block_In.
If previously enabled, pattern generation for the DIO-32F or the DIO 6533, begins when you
execute
DIG_Block_In. See Pattern Generation I/O with the DIO-32F and DIO 6533
(DIO-32HS) Devices in Chapter 3, Software Overview, of the your NI-DAQ User Manual for
PC Compatibles for important information about pattern generation.
To avoid delays that are caused by AT-bus DMA reprogramming on an AT-DIO-32F or
AT-DIO-32HS, you can use dual DMA, or you can align your buffer. For more information
about dual DMA, see the
Set_DAQ_Device_Info function. The second option, aligning
your buffer, works only for the AT-DIO-32F with buffers up to 64K in size.
For the AT-DIO-32F, you can align your buffer by calling
Align_DMA_Buffer. If
you have aligned your buffer with a call to
Align_DMA_Buffer and have not called
DIG_Block_Clear (either directly or through DIG_Block_Check) to unalign the data,