ConSysLoader Manual
Status:
This information applies to ConSysLoader version 1.48.855.197 (18/12 2024)
Contents:
- Overview
- Starting as a service
- Starting as an application
- Application Control and Status
- Startup options
Other links:
Overview:
The ConSysLoader program is used for starting the ConSys-Kernel on a computer. The program can operate in two modes: Either the program can run as an application, or it can be installed to run as a service. When the kernel is debugged it is usually started an application. This enables the debugger to access the program for single step debugging. When the system is running in a production environment, the loader is usually installed as a service.
To install the ConSysLoader as a service, use the ConSysManager program. When the kernel is installed as a service, it can be started and stopped with the Service manager in the Control Panel.
REMARK: during computer shutdown, the service is killed if the shutdown time exceeds the maximum service kill timeout set in/ HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\WaitToKillServiceTimeout
The default value is 20 seconds (20000). At ISA this value is changed to 38 seconds (38000) through ConSys group policy in the AD.
To start the ConSysLoader in application mode, execute the command 'ConSysLoader /a'. It is necessary to use the option '/a' (or one of the similar options) for the ConSysLoader start up as an application. If the option is omitted, the program starts as a service, but never receives the start service notification. After startup the program simply exits. Se below for more information on the options available for the ConSysLoader application.
Application Control and Status:

Read only:
When 'Read only' checked: Write operations to remote systems from local applications and local devices will not be send. Writings from local applications and from remote systems to local devices will be written to the local device.
Remark that writings from local devices to other local devices will not be written (unless 'local device write to local devices' checked).
Also remark that applications and local devices are not informed of blocked sending of values in read-only mode.
Local device write to local devices:
Works together with 'Read only'. By default, writing from local devices to other local devices are not allowed in read-only mode. Setting ‘Local device write to local devices’ writing from local devices to local devices will be allowed. This feature is typical used when developing multiple local devices that depend on each other. (for example: error fix devices, storage device with test parameters for this and scheduler device).
Local device list:
Devices running on this instance, as defined in the ConSys database/configuration file.
Local copy of Remote Device(s):
Devices running as a local copy at this instance (typical for debugging). See also startup option /l.
Main Status
WinMain (connect) idle alive cnt: Alive counter for the main connect thread. This should keep icrementing during the lifetime of the ConSysLoader application.
Thread count: Current number of threads used by the ConSysLoader.
Connections to remote clients: The actual number of connections to remote ConSys kernels.
Number of client connections: The number of clients that is currently connected to this ConSysLoader kernel.
#Thread create fails: If the creation of a new thread fails by any failure this counter is incremented. It is a fatal error if a thread can fails to start so this counter should be zero for everything to be ok. In case of failure, a log entry will be written to the ConSysLoader log file if the ‘Warning’ log flag is enabled.
#Connect fail (due to limit rchd): The total number of connections that have failed to be established because the limit of number of connections or number of threads has been reached. In the current version of ConSys the limit of allowed connections is 400 and the limit on number of threads is 1700.
Was here flags below: The 'Was here' flags are bit flags set when specific places in the ConSys code has been executed. These flags are also cleared when 'ResetCount' is called.
WinMain (connect) flags:
0x01: Set when a new connection is established
0x02: Unhandled exception in WinMain thread create
0x04: Unhandled exception in CWinMainThread::NewConnection
0x08: Unhandled exception in CWinMainThread::Initialize
0x10: Abort called
0x20: Endthread called
WinMain Idle (connect) flags:
0x01: Start listening
0x02: Empty request received
0x04: Multi connection request received
0x08: Win Main End thread called
0x10: Abort/Abort connections
0x20: Continue to call idle FALSE
0x40: Exception thrown
0x80: The transport connect correct (service thread not running or other failure)
Device 'was here' flags: Can be used in devices as 'was here' flags for debugging. See notes in 'CsCounters.h' at define CS_DEVICE_WAS_HERE_FLAGS for details on how to implement use in device code.
CsLog2020
Status of the logging to the parameter log database fom this ConSysLoader instance.
The startup options when the ConSysLoader starts as an application:
/app or /a
Starts the ConSysLoader as an application.
/readonly or /r
The ConSysLoader/Kernel starts in a read-only mode. The readonly mode can not be disabled in the ConSysLoader application when started with this option.
See also startup options /u and /w.
/w
Device allow write to local devices in read only:
When started by this setting ‘Local device write to local devices’ will be set initially, see above. To be used together with /r.
/ru or /u
The ConSysLoader/kernel starts in a read
only mode, but with the readonly flag unlocked (so it can be disabled).
/a and /w is implicit included this option.
/ld
Use local instance(s) of devices located on remote computers. If a device defined on a remote computer has a local definition (either in the local configuration file (MSL) or defined with a positive alternative computer id matching the local computer and instance (ISA)) it is loaded locally and local request to that device is directed to the local instance of the device. Typical used for debugging of a device. This option is typically used together with /r (to avoid accidental write to remote locations). See also /w, /r and /u
/info or /i
Starts the ConSysLoader with more information in the dialog window (larger window).
/log
When programs are developed for the control system a lot of error messages is created. Therefore the consysloader started as application as default does NOT log error messages. Use this option to enable message logging. (When running ConSysas a service logging is always enabled).
/debug
This option only has consequence when the program is compiled in _DEBUG mode. When used this option puts the kernel into a memory debug mode. Memory is only used ones, and is not deleted until the program is exited. When the memory is deleted, it is marked as deleted, but the contents are not altered. It is now possible to examine the memory when a dangling pointer is encountered. This option takes a severe toll on the computers resources.
/c<computer name>
This option is disabled in the ISA build of ConSys.
Start with the configuration file from <computer name>. If this option is specified, the
kernel will load with the device settings and database settings from the specified
computer. The device configuration file is loaded from the ConSysExe share on the specified computer.
Remark, that data request to parameters on <ComputerName> will go to the
local device on debugging computer. For all other computers accessing the
<ComputerName> parameters, the request will go to the correct front-end.
In this way devices and database configurations can be tested on debug machines
independent of the running system. WARNING: Always be careful when this
option is used - if some devices has active feedback on the system, the option
should be used with extremely care - and preferable with the /readonly option.
/v or /vcruntime
Visual Studio C++ redestribute runtime version check. Will check the Visual Studio run time versions (x86 and x64) and try to update if runtime version(s) are old. The ConSysLoader will not be started. Used as part of the ISA ConSys installation script.
/device <device id>
Unique device id of single device to load. To be used in debug where only the single device should be loaded. The purpose is to avoid disabling devices that are configured enabled for when needing to debug a single device. The device should be enabled in the configuration in order to be loaded (to avoid mistakes with wrong device ids). New option from version 1.48.855.197
Examples of typical startup commands:
ConSysLoader /a
ConSysLoader /r
ConSysLoader /r /w
ConSysLoader /u
ConSysLoader /u /ld
Last Modified 18 December 2024