DI_ContReadPortToFile Previous topicNext topicFirst topicLast topic

DI_ContReadPortToFile

@ Description

This function performs continuous digital input on the specified digital input port at a rate as close to the rate you specified and saves the acquired data in a disk file. The data is written to disk in binary format, with the lower byte first (little endian).

@ Cards Support

7200, 7300A

@ Syntax

I16 DI_ContReadPortToFile (U16 CardNumber, U16 Port, U8 *FileName, U32 ReadCount, F64 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.
FileName : Name of data file which stores the acquired data
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, ErrorInvalidSampleRate, 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.