IoMgrLockEnter (FUN) ¶ FUNCTION IoMgrLockEnter : RTS_IEC_RESULT This function acquires the mutual-exclusion locks for the given operations for critical sections inside the I/O driver’s implementation of IoDrvReadInputs(), IoDrvWriteOutputs(), and IoDrvStartBusCycle(). The locks can be released with the function IoMgrLockLeave() . While a lock is held, any other thread is blocked from acquiring the lock and waits until the lock is released. IMPLEMENTATION NOTE: The behavior of the dwLockScope parameter can’t be implemented on all platforms. Platforms without synchronization functionality may not be able to implement this behavior. IoMgrEmbedded of the CODESYSControlEmbedded runtime system for example can only disable and enable all interrupts. InOut: Scope Name Type Comment Return IoMgrLockEnter RTS_IEC_RESULT error code ERR_OK: Locks were successfully acquired. ERR_PARAMETER: The pbyIoDrv parameter is NULL (only implementations that use this parameter), or the dwLockScope parameter has none of the GVL LockScopes set (only implementations that use this parameter). ERR_FAILED: No driver entry for pbyIoDrv found in device pool. Input hIoDrv RTS_IEC_HANDLE Handle to the driver instance which is returned by the function IoMgrRegisterInstance2(). dwLockScope DWORD The operations for which to acquire locks. See GVL LockScopes for detailed information.
IoMgrLockLeave (FUN) ¶ FUNCTION IoMgrLockLeave : RTS_IEC_RESULT This function releases the mutual-exclusion locks (that were acquired with the function IoMgrLockEnter() ) for the given operations. IMPLEMENTATION NOTE: The behavior of the dwLockScope parameter can’t be implemented on all platforms. Platforms without synchronization functionality may not be able to implement this behavior. IoMgrEmbedded of the CODESYSControlEmbedded runtime system for example can only disable and enable all interrupts. InOut: Scope Name Type Comment Return IoMgrLockLeave RTS_IEC_RESULT error code ERR_OK: Locks were successfully released. ERR_PARAMETER: The pbyIoDrv parameter is NULL (only implementations that use this parameter), or the dwLockScope parameter has none of the GVL LockScopes set (only implementations that use this parameter). ERR_FAILED: No driver entry for pbyIoDrv found in device pool. Input hIoDrv RTS_IEC_HANDLE Handle to the driver instance which is returned by the function IoMgrRegisterInstance2(). dwLockScope DWORD The operations for which to release the locks. See GVL LockScopes for detailed information.
IoMgrReadInputs (FUN) ¶ FUNCTION IoMgrReadInputs : UDINT InOut: Scope Name Type Return IoMgrReadInputs UDINT Input pTaskMap POINTER TO IoConfigTaskMap
IoMgrScanModules (FUN) ¶ FUNCTION IoMgrScanModules : UDINT InOut: Scope Name Type Return IoMgrScanModules UDINT Input pConnector POINTER TO IoConfigConnector ppConnectorList POINTER TO POINTER TO IoConfigConnector pnCount POINTER TO DINT
IoMgrStartBusCycle (FUN) ¶ FUNCTION IoMgrStartBusCycle : UDINT InOut: Scope Name Type Return IoMgrStartBusCycle UDINT Input pConnector POINTER TO IoConfigConnector
CloseKbus (FUN) ¶ FUNCTION CloseKbus : DINT Closes the device @param deviceId Id of the device. @return Returns 0 on success, -1 otherwise. InOut: Scope Name Type Return CloseKbus DINT Input deviceId DINT
ConfigureDevice (FUN) ¶ FUNCTION ConfigureDevice : DINT Configures a device. @param deviceId Id of the device. @param configData The device specific configuration. @return Returns 0 on success, -1 otherwise. InOut: Scope Name Type Return ConfigureDevice DINT Input deviceId DINT configData POINTER TO BYTE
ConfigureSubdevice (FUN) ¶ FUNCTION ConfigureSubdevice : DINT Configures a sub device. @param deviceId Id of the device. @param subdeviceId Id of the sub device. @param configData The device specific configuration. @return Returns 0 on success, -1 otherwise. InOut: Scope Name Type Return ConfigureSubdevice DINT Input deviceId DINT subdeviceId DINT configData POINTER TO BYTE
DiagnoseGetDeviceState (FUN) ¶ FUNCTION DiagnoseGetDeviceState : DINT Get the state of the device (corresponds to codesys’ bus). @param[in] deviceId Id of the device. @param[in] bufferSize Size of the supplied buffer. @param[out] diagnoseBuffer Buffer where the state is stored in. @param[out] busState The state of the bus. @return Returns 0 on success, -1 otherwise. InOut: Scope Name Type Return DiagnoseGetDeviceState DINT Input deviceId DINT bufferSize UDINT diagnoseBuffer POINTER TO BYTE busState POINTER TO tBusState
DiagnoseGetSubdeviceState (FUN) ¶ FUNCTION DiagnoseGetSubdeviceState : DINT Get the state of a subdevice (corresponds to codesys’ device). @param deviceId Id of the device. @param subdeviceId Id of the device to get the state from. @param[in] bufferSize Size of the supplied buffer. @param[out] diagnoseBuffer Buffer where the state data is stored in. @param[out] diagnoseState The state of the diagnose. @return Returns 0 on success, -1 otherwise. InOut: Scope Name Type Return DiagnoseGetSubdeviceState DINT Input deviceId DINT subdeviceId DINT bufferSize UDINT diagnoseBuffer POINTER TO BYTE diagnoseState POINTER TO tDiagnoseState