The following functions manage the application lifecycle of the logic applications on the target device.
With these functions you can start, stop, reset and even load new logic applications onto the target. The following functions are not necessary if you prefer to download your applications from within IndraWorks.
MLPIRESULT mlpiLogicGetNumberOfApplications | ( | const MLPIHANDLE | connection, |
ULONG * | number | ||
) |
This function will return the number of applications.
[in] | connection | Handle for multiple connections. |
[out] | number | Pointer to variable where the number of applications will be stored. |
MLPIRESULT mlpiLogicGetNameOfApplication | ( | const MLPIHANDLE | connection, |
const ULONG | index, | ||
WCHAR16 * | application, | ||
const ULONG | numElements | ||
) |
This function will return the name of an application selected by index 0 until (number-1).
[in] | connection | Handle for multiple connections. |
[in] | index | Index of application. |
[out] | application | Pointer to variable where the name of application will be stored. |
[in] | numElements | Number of WCHAR16 elements in 'application' available to read. |
MLPIRESULT mlpiLogicLoadBootApplication | ( | const MLPIHANDLE | connection, |
const WCHAR16 * | file, | ||
const WCHAR16 * | path, | ||
WCHAR16 * | application, | ||
const ULONG | numElements | ||
) |
This function will load an application from the device file system. The application files can be created from within IndraWorks by creating a boot project when not logged in to the device. This file *.app together with a corresponding *.crc checksum file can be copied to the flash card of the device (e.g. using FTP transfer). Use this function to load it and to replace the current application.
[in] | connection | Handle for multiple connections. |
[in] | file | Filename of the new application file without file extension, e.g. "Application". |
[in] | path | Path to the file of the new application. The default root paths can be determined by using the function mlpiSystemGetSpecialPath. |
[out] | application | Pointer to variable where the name of the new application will be stored. The name of the application is stored inside the application project file (.app) and will be returned here. Use the application name as a handle for other function calls which need the application name to identify which application you want to access on the control. |
[in] | numElements | Number of WCHAR16 elements in 'application' available to read. |
0xF0360011
(E_LIMIT_MAX) if there are already too many applications loaded on the target. Remove an application by calling mlpiLogicResetApplication with MLPI_RESET_ORIGIN and try again.MLPIRESULT mlpiLogicStopApplication | ( | const MLPIHANDLE | connection, |
const WCHAR16 * | application = 0 |
||
) |
This function will stop an application. All motion that is assigned to the application will stop!
[in] | connection | Handle for multiple connections. |
[in] | application | Name of application. Use 0 to stop all applications. |
MLPIRESULT mlpiLogicStartApplication | ( | const MLPIHANDLE | connection, |
const WCHAR16 * | application = 0 |
||
) |
This function will start an application.
[in] | connection | Handle for multiple connections. |
[in] | application | Name of application. Use 0 to start all applications. |
MLPIRESULT mlpiLogicRunSingleCycleApplication | ( | const MLPIHANDLE | connection, |
const WCHAR16 * | application = 0 |
||
) |
This function will run an application for one single cycle.
[in] | connection | Handle for multiple connections. |
[in] | application | Name of application. Use 0 to run all applications for one single cycle. |
MLPIRESULT mlpiLogicResetApplication | ( | const MLPIHANDLE | connection, |
const MlpiApplicationResetMode | resetMode, | ||
const WCHAR16 * | application = 0 |
||
) |
This function will reset an application. All motion that is assigned to the application will stop!
[in] | connection | Handle for multiple connections. |
[in] | resetMode | Reset mode |
[in] | application | Name of application. Use 0 to reset all applications. |
MLPIRESULT mlpiLogicGetStateOfApplication | ( | const MLPIHANDLE | connection, |
const WCHAR16 * | application, | ||
MlpiApplicationState * | state | ||
) |
This function will return the state of an application.
[in] | connection | Handle for multiple connections. |
[in] | application | Name of application. |
[out] | state | Pointer to variable where the state will be stored. |
MLPIRESULT mlpiLogicGetOperationStateOfApplicationUlong | ( | const MLPIHANDLE | connection, |
const WCHAR16 * | application, | ||
ULONG * | state | ||
) |
This function will return the extended operation state of an application by using an unsigned 4 byte variable. Evaluate the state by using respective definitions (e.g. MLPI_APPLICATION_OP_STATE_PROGRAM_LOADED).
[in] | connection | Handle for multiple connections. |
[in] | application | Name of application. |
[out] | state | Pointer to variable where the extended operation state will be stored. |
MLPIRESULT mlpiLogicGetOperationStateOfApplication | ( | const MLPIHANDLE | connection, |
const WCHAR16 * | application, | ||
MlpiApplicationOpState * | state | ||
) |
This function will return the extended operation state of an application by using struct MlpiApplicationOpState.
[in] | connection | Handle for multiple connections. |
[in] | application | Name of application. |
[out] | state | Pointer to variable where the extended operation state will be stored. |
MLPIRESULT mlpiLogicGetTaskInfoOfApplication | ( | const MLPIHANDLE | connection, |
const WCHAR16 * | application, | ||
MlpiApplicationTaskInfo * | taskInfo, | ||
const ULONG | numElements, | ||
ULONG * | numElementsRet = 0 |
||
) |
This function will return information about all running IEC tasks of an application.
[in] | connection | Handle for multiple connections. |
[in] | application | Name of application. |
[out] | taskInfo | Pointer to an array of structure where the information will be stored. |
[in] | numElements | Number of MlpiApplicationTaskInfo elements available in 'taskInfo' to read. |
[out] | numElementsRet | Number of elements used. |
MLPIRESULT mlpiLogicGetInfoOfApplication | ( | const MLPIHANDLE | connection, |
const WCHAR16 * | application, | ||
MlpiApplicationInfo * | info | ||
) |
This function will return information about the given application.
[in] | connection | Handle for multiple connections. |
[in] | application | Name of application. |
[out] | info | Pointer to struct where the information will be stored. |
MLPIRESULT mlpiLogicSaveRetainOfApplication | ( | const MLPIHANDLE | connection, |
const WCHAR16 * | application, | ||
const WCHAR16 * | path = 0 |
||
) |
This function will save the retain data of an application to default storage or to a user-defined file.
[in] | connection | Handle for multiple connections. |
[in] | application | Name of application. |
[in] | path | Path and name of retain data file. Use 0 to select default storage to load it on next reboot. |
MLPIRESULT mlpiLogicRestoreRetainOfApplication | ( | const MLPIHANDLE | connection, |
const WCHAR16 * | application, | ||
const WCHAR16 * | path | ||
) |
This function will restore the retain data of an application from a user-defined file.
[in] | connection | Handle for multiple connections. |
[in] | application | Name of application. |
[in] | path | Path and name of retain data file. |
MLPIRESULT mlpiLogicWaitForEventOfApplication | ( | const MLPIHANDLE | connection, |
const WCHAR16 * | application, | ||
const MlpiApplicationEvent | event, | ||
const ULONG | timeout | ||
) |
This function pends the calling task until the given event occurs.
[in] | connection | Handle for multiple connections. |
[in] | application | Name of application (unused). |
[in] | event | Event to wait for. |
[in] | timeout | The timeout after which the function should return an error if the event did not raise. Use MLPI_INFINITE to wait forever. |
MLPIRESULT mlpiLogicGetStopAxesConfiguration | ( | const MLPIHANDLE | connection, |
WCHAR16 * | configuration, | ||
const ULONG | numElements, | ||
ULONG * | numElementsRet | ||
) |
This function will return the active "StopAxes" and "StopAxesCommon" configuration of all applications.
[in] | connection | Handle for multiple connections. |
[out] | configuration | Pointer to variable where the configuration of applications will be stored. |
[in] | numElements | Number of WCHAR16 elements in 'configuration' available to read. |
[out] | numElementsRet | Number of elements used. |
MLPIRESULT mlpiLogicGetSymbolsOfApplication | ( | const MLPIHANDLE | connection, |
const WCHAR16 * | application, | ||
PROCESSHANDLE * | node, | ||
WCHAR16 * | symbols, | ||
const ULONG | numElements | ||
) |
This function will read all symbols of an application. The symbols themselves are separated from each other by a semicolon. The argument 'node' will be used as a token for further requests, if the buffer size is insufficient for all symbols.
[in] | connection | Handle for multiple connections. |
[in] | application | Name of application. |
[out] | node | Token to control the requests. Use on first request the value 0 to sign it as first, use on all following requests the return value you get from last call until you get ((PROCESSHANDLE) -1). This value signals the last response. |
[out] | symbols | Pointer to variable where the symbols will be stored. |
[in] | numElements | Number of WCHAR16 elements in 'symbols' available to read. |
{attribute
'symbol' := 'readwrite'} above your variable declaration to add it explicit to the symbol configuration.MLPIRESULT mlpiLogicGetTypeOfSymbol | ( | const MLPIHANDLE | connection, |
const WCHAR16 * | symbol, | ||
MlpiLogicType * | type, | ||
MlpiLogicType * | subtype = 0 |
||
) |
This function reads the type and sybtype of a symbol variable of PLC application. This and further information can also be read by mlpiLogicGetInformationOfSymbol.
[in] | connection | Handle for multiple connections. |
[in] | symbol | Symbol variable of PLC application. |
[out] | type | Pointer to variable where the type will be stored. |
[out] | subtype | Pointer to variable where in case of array the sybtype will be stored. |
MLPIRESULT mlpiLogicGetSizeOfSymbol | ( | const MLPIHANDLE | connection, |
const WCHAR16 * | symbol, | ||
ULONG * | dataSize | ||
) |
This function reads the size in bytes of a symbol variable of PLC application. This and further information can also be read by mlpiLogicGetInformationOfSymbol.
[in] | connection | Handle for multiple connections. |
[in] | symbol | Symbol variable of PLC application. |
[out] | dataSize | Pointer to variable where the size in bytes will be stored. |
MLPIRESULT mlpiLogicGetNumElementsOfSymbol | ( | const MLPIHANDLE | connection, |
const WCHAR16 * | symbol, | ||
ULONG * | numElements | ||
) |
This function reads the number of elements of an array or user type of a symbol variable of PLC application. This and further information can also be read by mlpiLogicGetInformationOfSymbol.
[in] | connection | Handle for multiple connections. |
[in] | symbol | Symbol variable of PLC application. |
[out] | numElements | Pointer to variable where the number of elements will be stored. |
MLPIRESULT mlpiLogicGetDimensionOfSymbol | ( | const MLPIHANDLE | connection, |
const WCHAR16 * | symbol, | ||
ULONG * | dimension | ||
) |
This function reads the array dimension of a symbol variable of PLC application. This and further information can also be read by mlpiLogicGetInformationOfSymbol.
[in] | connection | Handle for multiple connections. |
[in] | symbol | Symbol variable of PLC application. |
[out] | dimension | Pointer to variable where the dimension will be stored. |
MLPIRESULT mlpiLogicGetArrayRangeOfSymbol | ( | const MLPIHANDLE | connection, |
const WCHAR16 * | symbol, | ||
const ULONG | index, | ||
MlpiLogicArrayRange * | range | ||
) |
This function reads the minimum index and maximum index resp. the range of an array dimension of a symbol variable of PLC application. This and further information can also be read by mlpiLogicGetInformationOfSymbol.
[in] | connection | Handle for multiple connections. |
[in] | symbol | Symbol variable of PLC application. |
[in] | index | Index of dimension of array. |
[out] | range | Pointer to variable where the range of array will be stored. |
MLPIRESULT mlpiLogicGetAccessRightsOfSymbol | ( | const MLPIHANDLE | connection, |
const WCHAR16 * | symbol, | ||
MlpiLogicSymbolAccessRights * | accessrights | ||
) |
This function reads the access rights of a symbol variable of PLC application. This and further information can also be read by mlpiLogicGetInformationOfSymbol.
[in] | connection | Handle for multiple connections. |
[in] | symbol | Symbol variable of PLC application. |
[out] | accessrights | Pointer to variable where the access rights of array will be stored. |
MLPIRESULT mlpiLogicGetAddressOfSymbol | ( | const MLPIHANDLE | connection, |
const WCHAR16 * | symbol, | ||
ULONG * | address | ||
) |
This function reads the physical kernel space address of a symbol variable of a PLC application.
[in] | connection | Handle for multiple connections. |
[in] | symbol | Symbol variable of PLC application. |
[out] | address | Pointer to variable where the physical address of symbol will be stored. |
MLPIRESULT mlpiLogicGetInformationOfSymbol | ( | const MLPIHANDLE | connection, |
const WCHAR16 * | symbol, | ||
MlpiLogicSymbolInformation * | info | ||
) |
This function reads the types, size, number of elements, array information and access rights of a symbol variable of PLC application. It therefore combines the functionality of mlpiLogicGetTypeOfSymbol, mlpiLogicGetSizeOfSymbol, mlpiLogicGetNumElementsOfSymbol, mlpiLogicGetDimensionOfSymbol, mlpiLogicGetArrayRangeOfSymbol, mlpiLogicGetAccessRightsOfSymbol in a single call.
[in] | connection | Handle for multiple connections. |
[in] | symbol | Symbol variable of PLC application. |
[out] | info | Pointer to struct array where the information will be stored. |
MLPIRESULT mlpiLogicGetInformationOfUserType | ( | const MLPIHANDLE | connection, |
const WCHAR16 * | symbol, | ||
MlpiLogicUserTypeInformation * | info, | ||
const ULONG | numElements, | ||
ULONG * | numElementsRet = 0 |
||
) |
This function reads names and information of variables (MlpiLogicSymbolInformation) of a symbol variable of PLC application if type of symbol equal MLPI_LOGIC_TYPE_USERDEF.
[in] | connection | Handle for multiple connections. |
[in] | symbol | Symbol variable of PLC application. |
[out] | info | Pointer to struct array where the names and information of the variables will be stored. |
[in] | numElements | Number of MlpiLogicUserTypeInformation elements available in 'info' to read. |
[out] | numElementsRet | Number of elements used. |
MLPIRESULT mlpiLogicSetCapabilityOfOperation | ( | const MLPIHANDLE | connection, |
const MlpiLogicCapabilityOperation | operation, | ||
const MlpiLogicCapabilityOperationValue | value | ||
) |
This function enables or disables the execution capability of operations MlpiLogicCapabilityOperation. The capability will be set to global for all applications. After reboot, the capability will be set to default.
[in] | connection | Handle for multiple connections. |
[in] | operation | Operation which can be enabled or disabled. |
[in] | value | Target capability of execution of operation. |
MLPIRESULT mlpiLogicGetCapabilityOfOperation | ( | const MLPIHANDLE | connection, |
const MlpiLogicCapabilityOperation | operation, | ||
MlpiLogicCapabilityOperationValue * | value | ||
) |
This function reads the current execution capability of operations MlpiLogicCapabilityOperation.
[in] | connection | Handle for multiple connections. |
[in] | operation | Operation which can be enabled or disabled. |
[out] | value | Pointer to variable where the current capability of execution of operation will be stored. |