DI_ContReadPort | ![]() ![]() ![]() ![]() |
DI_ContReadPort
@ Description
This function performs continuous digital input on the specified digital input port at a rate as close to the rate you specified.
@ Cards Support
7200, 7300A
@ Syntax
I16 DI_ContReadPort (U16 CardNumber, U16 Port, void *Buffer, U32 ReadCount, F32 SampleRate, U16 SyncMode)
@ Parameter
CardNumber : The
card id of the card that want to perform this operation.
Port : Digital
input port number. For PCI-7200/cPCI-7200 and PCI-7300A/cPCI-7300A, this
argument must be set to 0.
Buffer : The starting
address of the memory to contain the input data.This memory must have been
allocated for enough space to store input data.
If double-buffered mode is enabled, this buffer is of no use, you can ignore
this argument.
ReadCount : If
double-buffered mode is disabled, ReadCount is the number of input
operation to be performed.
For double-buffered acquisition, ReadCount is the size (in samples)
of the circular buffer and its value must be even.
SampleRate : The
sampling rate you want for digital input in hertz (samples per second).
Your maximum rate depends on the card type and your computer system.
This argument is only useful if the DI trigger mode was set as internal
programmable pacer (TRIG_INT_PACER) by
calling DI_7200_Config() or DI_7300_Config(). For the other
settings, you have to set this argument as CLKSRC_EXT_SampRate.
SyncMode : Whether
this operation is performed synchronously or asynchronously.
Valid values:
SYNCH_OP : synchronous digital input, that is, the function does not return
until the digital input operation complete.
ASYNCH_OP : asynchronous digital input operation
@ Return Code
NoError, ErrorInvalidCardNumber,
ErrorCardNotRegistered, ErrorFuncNotSupport, ErrorInvalidIoChannel, ErrorTransferCountTooLarge
, ErrorContIoNotAllowed
Note: | Because the scatter-gather mechanism used by PCI7300A, the memory space allocated in your process will be locked before passing the virtual address to the device drivers, and be unlocked after the data acquisition is completed. However, Linux does not give the permission of mlock/munlock to everyone. Only the processes with root privilege can lock/unlock the memory. If your process call this function for PCI7300A_RevA or PCI7300A_RevB, it must have the root privilege. |