![]() |
NexMotion
1.4.0
Open Robots & Machines [WIP]
|
I/O Control Functions. More...
![]() |
Functions | |
RTN_ERR FNTYPE | NMC_GetInputMemorySize (I32_T DevID, U32_T *PRetSizeByte) |
Get the size of mapped input(Input) memory. More... | |
RTN_ERR FNTYPE | NMC_GetOutputMemorySize (I32_T DevID, U32_T *PRetSizeByte) |
Get the size of mapped output (Output) memory. More... | |
RTN_ERR FNTYPE | NMC_ReadInputMemory (I32_T DevID, U32_T OffsetByte, U32_T SizeByte, void *PRetValue) |
Read the mapped input (Input) memory. More... | |
RTN_ERR FNTYPE | NMC_ReadOutputMemory (I32_T DevID, U32_T OffsetByte, U32_T SizeByte, void *PRetValue) |
Read the mapped output (Output) memory. More... | |
RTN_ERR FNTYPE | NMC_WriteOutputMemory (I32_T DevID, U32_T OffsetByte, U32_T SizeByte, const void *PValue) |
Write the mapped output (Output) memory. More... | |
RTN_ERR FNTYPE | NMC_ReadInputBit (I32_T DevID, U32_T OffsetByte, U32_T BitIndex, BOOL_T *PRetBitValue) |
Read the mapped input memory by bit, word or dword. More... | |
RTN_ERR FNTYPE | NMC_ReadInputI8 (I32_T DevID, U32_T OffsetByte, I8_T *PRetI8Value) |
RTN_ERR FNTYPE | NMC_ReadInputI16 (I32_T DevID, U32_T OffsetByte, I16_T *PRetI16Value) |
RTN_ERR FNTYPE | NMC_ReadInputI32 (I32_T DevID, U32_T OffsetByte, I32_T *PRetI32Value) |
RTN_ERR FNTYPE | NMC_ReadOutputBit (I32_T DevID, U32_T OffsetByte, U32_T BitIndex, BOOL_T *PRetBitValue) |
Read the mapped output memory by bit, word or dword. More... | |
RTN_ERR FNTYPE | NMC_ReadOutputI8 (I32_T DevID, U32_T OffsetByte, I8_T *PRetI8Value) |
RTN_ERR FNTYPE | NMC_ReadOutputI16 (I32_T DevID, U32_T OffsetByte, I16_T *PRetI16Value) |
RTN_ERR FNTYPE | NMC_ReadOutputI32 (I32_T DevID, U32_T OffsetByte, I32_T *PRetI32Value) |
RTN_ERR FNTYPE | NMC_WriteOutputBit (I32_T DevID, U32_T OffsetByte, U32_T BitIndex, BOOL_T BitValue) |
Write the mapped output memory by bit, word or dword. More... | |
RTN_ERR FNTYPE | NMC_WriteOutputI8 (I32_T DevID, U32_T OffsetByte, I8_T I8Value) |
RTN_ERR FNTYPE | NMC_WriteOutputI16 (I32_T DevID, U32_T OffsetByte, I16_T I16Value) |
RTN_ERR FNTYPE | NMC_WriteOutputI32 (I32_T DevID, U32_T OffsetByte, I32_T I32Value) |
I/O Control Functions.
Get the size of mapped input(Input) memory.
DevID | Device ID (DevID) |
PRetSizeByte | The size of I/O output memory will be returned after the function is called successfully. Unit: byte. |
Usage:
NMC_GetInputMemorySize() is used to read the accessible range of the I/O memory in the controller (0 to the return size, in bytes). Different controllers (different models) may have different I/O memory sizes that can be controlled, so this API can be used to confirm the actual reachable range.
The function can be called after the device is started.
Examples:
Reference:
Get the size of mapped output (Output) memory.
DevID | Device ID (DevID) |
PRetSizeByte | The size of I/O output memory will be returned after the function is called successfully. Unit: byte. |
Usage:
NMC_GetOutputMemorySize () is used to read the accessible range of the I/O memory in the controller (0 to the return size, in bytes). Different controllers (different models) may have different I/O memory sizes that can be controlled, so this API can be used to confirm the actual reachable range.
The function can be called after the device is started.
Examples:
Reference:
RTN_ERR FNTYPE NMC_ReadInputBit | ( | I32_T | DevID, |
U32_T | OffsetByte, | ||
U32_T | BitIndex, | ||
BOOL_T * | PRetBitValue | ||
) |
Read the mapped input memory by bit, word or dword.
DevID | Device ID (DevID) | |
OffsetByte | Memory offset (byte) from 0 | |
BitIndex | Bit index in a byte, value must be 0~7 | |
[out] | PRetBitValue | Return bit value (0 or 1) |
Usage:
The function can be called after the device is started.
Examples:
Reference:
RTN_ERR FNTYPE NMC_ReadInputMemory | ( | I32_T | DevID, |
U32_T | OffsetByte, | ||
U32_T | SizeByte, | ||
void * | PRetValue | ||
) |
Read the mapped input (Input) memory.
DevID | Device ID (DEVID) |
OffsetByte | Memory offset (byte) from 0. |
SizeByte | Size of the memory to be read. |
PRetValue | The contents within the specified memory segment will be saved into the variable after the function is called successfully. |
Usage:
Please refer to the I/O Control chapter for information on how to map I/O to the controller's internal I/O memory. This function can be called after the controller is started. Suppose an I/O device sets its DI-0 to DI-15 to the first Byte and the second Byte of the I/O Input memory. I want to read the value of the fourth DI input (DI-3). Please refer to the following example
Examples:
Reference:
RTN_ERR FNTYPE NMC_ReadOutputBit | ( | I32_T | DevID, |
U32_T | OffsetByte, | ||
U32_T | BitIndex, | ||
BOOL_T * | PRetBitValue | ||
) |
Read the mapped output memory by bit, word or dword.
DevID | Device ID (DevID) | |
OffsetByte | Memory offset (byte) from 0 | |
BitIndex | Bit index in a byte, value must be 0~7 | |
[out] | PRetBitValue | Return bit value (0 or 1) |
Usage:
The function can be called after the device is started.
Examples:
Reference:
RTN_ERR FNTYPE NMC_ReadOutputMemory | ( | I32_T | DevID, |
U32_T | OffsetByte, | ||
U32_T | SizeByte, | ||
void * | PRetValue | ||
) |
Read the mapped output (Output) memory.
DevID | Device ID (DevID) |
OffsetByte | Memory offset (byte) from 0. |
SizeByte | Size of the memory to be read. |
PRetValue | The contents within the specified memory segment will be saved into the variable after the function is called successfully. |
Usage:
Please refer to the I/O Control chapter for information on how to map I/O to the controller's internal I/O memory. This function can be called after the controller is started. Suppose an I/O device sets its DO-0 to DO-15 to the first Byte and the second Byte of the I/O output memory. I want to read the value of the fourth DO output (DO-3). Please refer to the following example:
Examples:
Reference:
RTN_ERR FNTYPE NMC_WriteOutputBit | ( | I32_T | DevID, |
U32_T | OffsetByte, | ||
U32_T | BitIndex, | ||
BOOL_T | BitValue | ||
) |
Write the mapped output memory by bit, word or dword.
DevID | Device ID (DevID) |
OffsetByte | Memory offset (byte) from 0 |
BitIndex | Bit index in a byte, value must be 0~7 |
BitValue | Bit value (0 or 1) to be set |
Usage:
The function can be called after the device is started.
Examples:
Reference:
RTN_ERR FNTYPE NMC_WriteOutputMemory | ( | I32_T | DevID, |
U32_T | OffsetByte, | ||
U32_T | SizeByte, | ||
const void * | PValue | ||
) |
Write the mapped output (Output) memory.
DevID | Device ID (DevID) |
OffsetByte | Memory offset (byte) from 0. |
SizeByte | Size of the memory to be read. |
PValue | set the value into output memory |
Usage:
Please refer to the I/O Control chapter for information on how to map I/O to the controller's internal I/O memory. This function can be called after the controller is started. Suppose an I/O device has its DO-0 to DO-15 set to the first Byte and the second Byte of the I/O output memory. I want to set the value of the fourth output point (DO 3). Refer to the following example:
Examples:
Reference: