Function
The transfer position on the data buffer is acquired.
Format
Ret = DioDmGetWritePointerUserBuf ( Id , Dir , &WritePointer , &Count , &Carry )
Parameters
Id
[C:short] [Python: ctypes.c_short]
Specifies the device ID retrieved from DioInit.
Dir
[C:unsigned long] [Python: ctypes.c_ulong]
Specify the transfer direction.
Definition |
Value [Hex] |
Description |
DIODM_DIR_IN |
0x01 |
Input |
DIODM_DIR_OUT |
0x02 |
Output |
WritePointer
[C:unsigned long *] [Python: ctypes.POINTER(ctypes.c_ulong)]
Specify the address of the variable in which the transfer position is stored.
Count
[C:unsigned long *] [Python: ctypes.POINTER(ctypes.c_ulong)]
Specify the address of the variable in which the transfer count number
is stored.
Carry
[C:unsigned long *] [Python: ctypes.POINTER(ctypes.c_ulong)]
Specify the address of the variable in which the carry count number is
stored.
Return Value
Ret[C:long] [Python: ctypes.c_long]
Definition |
Value [Dec] |
Description |
DIO_ERR_SUCCESS |
0 |
Normal complete |
DIO_ERR_DLL_INVALID_ID |
10001 |
Invalid ID is specified. |
DIO_ERR_DLL_CALL_DRIVER |
10002 |
Driver cannot be called (failed in ioctl). |
DIO_ERR_DLL_BUFF_ADDRESS |
10100 |
Invalid data buffer address. |
DIO_ERR_SYS_DIRECTION |
50000 |
I/O direction is outside of the setting range. |
The other errors: (See also: Error code details)
Initial Value
None
Remarks
It can know where data is written on the data buffer.
When the transfer position is 0 in number 0 of transfer counts,one
position
actually written becomes the previous data about the transfer position
that
can be acquired in this function to show the state that data is not
transmitted.
When using the DIO-32DM3-PE, the data is transferred to the
PC side every 2-2048 samplings for optimization.
Therefore, there is such a possibility that the count doesn't work
when the clocks input, but the sampling is performed.
When the transfer is completed, the rest of the data will also be transferred.
Example
C |
Ret = DioDmGetWritePointerUserBuf(
Id , Dir , &WritePointer , &Count , &Carry ); |
Python |
Ret = cdio.DioDmGetWritePointerUserBuf(
Id , Dir , ctypes.byref(WritePointer) , ctypes.byref(Count) ,
ctypes.byref(Carry) ) |
See Also
Usage of buffer at input transfer