Function
This is a function that sets the digital input of the demo device in port.
Format
Ret = AioSetDemoDiByte ( Id , DiPortNum , DiPort , DiData )
Parameters
Id
[ C, C++ : short ] [ Python : ctypes.c_short ]
Specifies the device ID retrieved from AioInit.
DiPortNum
[ C, C++ : short ] [ Python : ctypes.c_short ]
Specifies the number of elements in the port number array.
DiPort
[ C, C++ : short * ] [ Python : ctypes.POINTER(ctypes.c_short) ]
Specifies the address of the array that stored the port number.
DiData
[ C, C++ : short * ] [ Python : ctypes.POINTER(ctypes.c_short) ]
Specifies the address of the array that stored the data.
0 |
OFF |
1 |
ON |
Return values
Ret [ C, C++ : long ] [ Python : ctypes.c_long ]
Return values |
Content |
0 |
Normality completion |
10001 |
Invalid
Id was specified |
10002 |
AIO
driver can't be called |
18123 |
Pointer to DiPort, DiData is NULL |
28120 |
The value of DiPortNum is outside the designated range of the device being used |
28121 |
The value of DiPort is outside the designated range of the device being used |
28122 |
The value of DiData is outside the designated range of the device being used |
28123 |
A driver inner error occurred |
Remarks
This is a function dedicated to the demo device.
One port has 8bit. And all initial values are 0 (OFF).
Please call AioInputDiByte function when you want to confirm the current Digital Input value.
Example
Sets the digital input data FH (bit0, bit1, bit2, bit3 ON) for port 0 to port 7.
C, C++ |
long
Ret; |
Python |
Ret
= ctypes.c_long() |
See also
AioSetDemoDiBit, AioInputDiByte