Professional Documents
Culture Documents
CoDeSys V 3.x
SysProcess.library
CONTENT
1 OVERVIEW 4
2 LIBRARY MODULES 5
2.1 SysProcessCreate 5
2.2 SysProcessCreate2 5
2.3 SysProcessExecuteCommand 5
2.4 SysProcessFreeHandle 6
2.5 SysProcessGetCurrentHandle 6
2.6 SysProcessGetOSId 6
2.7 SysProcessGetPriority 6
2.8 SysProcessGetState 7
2.9 SysProcessResume 7
2.10 SysProcessSetPriority 7
2.11 SysProcessTerminate 8
2.12 Global_Constants 8
CHANGE HISTORY 9
libdoc_e.dot / V1.0
1 Overview
Note: It depends on the target system, which system libraries can be used in the application program.
This library allows to manage the processes on the target system provided the target system
is working with single processes and admits their handling.
The functions:
SysProcessCreate
SysProcessCreate2
SysProcessExecuteCommand
SysProcessFreeHandle
SysProcessGetCurrentHandle
SysProcessGetOSId
SysProcessGetPriority
SysProcessGetState
SysProcessSetPriority
SysProcessTerminate
SYSPROCESS_INVALID_HANDLE
SYSPROCESS_CREATEFLAG_HIDDEN
SYSPROCESS_CREATEFLAG_INTERACTIVE
SYSPROCESS_CREATEFLAG_CREATESUSPENDED
libdoc_e.dot / V1.0
2 Library Modules
2.1 SysProcessCreate
This function starts the specified application as new process, optionally either in the fore- or in
the background.
The return of type UDINT contains a handle of the newly created process.
Input variable Data type Description
2.2 SysProcessCreate2
This functions creates and eventually starts a new process for the specified application. The
properties of the created process can be defined by appropriate flags (see 2.12)
The return of type UDINT contains a handle of the newly created process.
Input variable Data type Description
2.3 SysProcessExecuteCommand
This function starts the execution of a system command. The realization of the command
execution depends on the operating system.
The return of type UDINT contains the result of the command execution (Pay attention to the
explicit cast to type UDINT!).
Input variable Data type Description
libdoc_e.dot / V1.0
2.4 SysProcessFreeHandle
By use of this function a process handle is released.
The return of type UDINT is an error code indicating success or failure of the operation
(ERR_OK or ERR_PARAMETER for invalid handle).
Input variable Data type Description
2.5 SysProcessGetCurrentHandle
This function retrieves the handle of the process actually run by the processor.
2.6 SysProcessGetOSId
This function retrieves the operating system specific identification of the process. This
identification always has to be unique within the system. SysProcessGetOSId can only
applied to the process actually executed or to processes having been generated by
SysProcessCreate.
The return of type UDINT contains the operating system specific identification of the process.
Input variable Data type Description
2.7 SysProcessGetPriority
This function retrieves the priority of the process specified by its handle.
The return of type UDINT is an error code indicating success or failure of the operation
(ERR_OK or ERR_PARAMETER for invalid handle).
Input variable Data type Description
2.8 SysProcessGetState
This function retrieves the status of the process specified by its handle.
The return of type UDINT is an error code indicating success or failure of the operation
(ERR_OK or ERR_PARAMETER for invalid handle).
Input variable Data type Description
2.9 SysProcessResume
This function starts the process specified by its handle. For example, the function can be used
for processes having been created in suspended mode by use of the flag
SYSPROCESS_CREATEFLAG_CREATESUSPENDED (see 2.2).
The return of type UDINT is an error code indicating success or failure of the operation
(ERR_OK or ERR_PARAMETER for invalid handle).
Input variable Data type Description
2.10 SysProcessSetPriority
This function sets the priority of the process specified by its handle.
The return of type UDINT is an error code indicating success or failure of the operation
(ERR_OK or ERR_PARAMETER for invalid handle).
Input variable Data type Description
minor 224..255
2.11 SysProcessTerminate
This function terminates the process specified by its handle.
The return of type UDINT is an error code indicating success or failure of the operation
(ERR_OK or ERR_PARAMETER for invalid handle).
Input variable Data type Description
2.12 Global_Constants
This variable list contains global variables that are used within the management of processes.
To build a combination of the flags, which represents all desired properties, the values of the
corresponding flag variables must been added. The flags are not supported by every runtime
system.
Name of variable Data type Description
The following constants are only used by the function SysProcessCreate2 (2.2):
Name of variable Data type Description
Change History
Version Description Date