Document metadata

Application name

CSK_Module_Commands

Version

1.0.1

Date

2024-10-11

Author

SICK AG

Crowns

CSK_Commands

Short description

Module to dynamically call served functions or notify served events during runtime.
By using this module it is possible to adapt the application without the need to stop it and to adapt the code.
Check UI of this module for most available features.

Typically the features of this module are used like this:

1) Setup the command
Select the type of command via 'setMode'.
Set the name of the function to call or event to notify ('setFunctionName' or 'setEventName').
Optionally you can add parameters to the function / event. To do so, add parameters via 'setParameterAmount', selecte a parameter via 'setSelectedParameter', set the type of the parameter via 'setParameterType' and set the value via 'setParameterValue'.
After that you can call / notify the function / event via 'callFunctionViaUI' / 'notifyEventViaUI'.

2) List of commands
It is possible to set a list of commands to be called / notified one after another.
This can be very helpful to summarize a procedure to configure the system by predefined function calls / events.
You can add a predefined command via 'addCommandViaUI' to that list and start the processing via 'runCommands'.

Functions

CSK_Commands.addCommandViaUI()
Short description

Function to add a command via UI.

Sample (auto-generated)
CSK_Commands.addCommandViaUI()
CSK_Commands.callFunctionViaUI()
Short description

Function to call preconfigured function incl. optional set parameters.

Sample (auto-generated)
CSK_Commands.callFunctionViaUI()
CSK_Commands.clearFlowConfigRelevantConfiguration()
Short description

Function to clear FlowConfig relevant configurations.

Sample (auto-generated)
CSK_Commands.clearFlowConfigRelevantConfiguration()
CSK_Commands.getStatusModuleActive()
Short description

Function to get status if module is active.

Return values
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
status = CSK_Commands.getStatusModuleActive()
CSK_Commands.loadParameters()
Short description

Load parameters for this module from the CSK_PersistentData module if possible and use them.

Return values
Name Type Multiplicity Description

success

BOOL

1

Success to load parameters.

Sample (auto-generated)
success = CSK_Commands.loadParameters()
CSK_Commands.notifyEventViaUI()
Short description

Function to notify preconfigured event via UI.

Sample (auto-generated)
CSK_Commands.notifyEventViaUI()
CSK_Commands.pageCalled()
Short description

Function to register "OnResume" of the module UI (only as helper function).

Return values
Name Type Multiplicity Description

empty

STRING

1

Empty string (only needed to simplify binding).

Sample (auto-generated)
empty = CSK_Commands.pageCalled()
CSK_Commands.print()
Short description

Function to print dynamic content.

Parameters
Name Type Multiplicity Description

content

STRING

?

Content to print.

Sample (auto-generated)
CSK_Commands.print(content)
CSK_Commands.removeCommandViaUI()
Short description

Function to remove command within command list.

Sample (auto-generated)
CSK_Commands.removeCommandViaUI()
CSK_Commands.resetModule()
Short description

Function to reset main configuration of module.

Sample (auto-generated)
CSK_Commands.resetModule()
CSK_Commands.runCommands()
Short description

Function to run all commands of currently active list.

Sample (auto-generated)
CSK_Commands.runCommands()
CSK_Commands.selectCommandViaUI()
Short description

Function to select a specific Command in UI table.

Parameters
Name Type Multiplicity Description

selection

STRING

1

Selection

Sample (auto-generated)
CSK_Commands.selectCommandViaUI(selection)
CSK_Commands.sendParameters()
Short description

Send parameters to CSK_PersistentData module if possible to save them.

Parameters
Name Type Multiplicity Description

noDataSave

BOOL

?

[Optional] Set to TRUE if the data should NOT be saved immediately after sending.

Sample (auto-generated)
CSK_Commands.sendParameters(noDataSave)
CSK_Commands.setEventName()
Short description

Function to set name of event to notify.

Parameters
Name Type Multiplicity Description

name

STRING

1

Name of event.

Sample (auto-generated)
CSK_Commands.setEventName(name)
CSK_Commands.setFlowConfigPriority()
Short description

Function to configure if FlowConfig should have priority for FlowConfig relevant configuration.
INFO: FlowConfig has currently no effect for this module.

Parameters
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
CSK_Commands.setFlowConfigPriority(status)
CSK_Commands.setFunctionName()
Short description

Function to set function name to execute.

Parameters
Name Type Multiplicity Description

functionName

STRING

1

Name of function (like CSK_Module.FunctionName)

Sample (auto-generated)
CSK_Commands.setFunctionName(functionName)
CSK_Commands.setLoadOnReboot()
Short description

Configure if this module should load its saved parameters at app/device boot up.

Parameters
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
CSK_Commands.setLoadOnReboot(status)
CSK_Commands.setMode()
Short description

Function to set mode of command.

Parameters
Name Type Multiplicity Description

mode

STRING

1

Mode (Function or Event)

Sample (auto-generated)
CSK_Commands.setMode(mode)
CSK_Commands.setParameterAmount()
Short description

Function to set amount of parameters to use for function call.

Parameters
Name Type Multiplicity Description

amount

INT

1

Amount of parameters.

Sample (auto-generated)
CSK_Commands.setParameterAmount(amount)
CSK_Commands.setParameterName()
Short description

Function to set the name of the parameters if saved/loaded via the CSK_PersistentData module.

Parameters
Name Type Multiplicity Description

name

STRING

1

Name of the parameter.

Sample (auto-generated)
CSK_Commands.setParameterName(name)
CSK_Commands.setParameterType()
Short description

Function to set type of parameter.

Parameters
Name Type Multiplicity Description

paramType

STRING

1

Type to use.

Sample (auto-generated)
CSK_Commands.setParameterType(paramType)
CSK_Commands.setParameterValue()
Short description

Function to set value of selected parameter.

Parameters
Name Type Multiplicity Description

paramValue

AUTO

1

Value to use.

Sample (auto-generated)
CSK_Commands.setParameterValue(paramValue)
CSK_Commands.setSelectedParameter()
Short description

Function to select a parameter to edit for function / event call.

Parameters
Name Type Multiplicity Description

selection

INT

1

Parameter to edit.

Sample (auto-generated)
CSK_Commands.setSelectedParameter(selection)
CSK_Commands.sleep()
Short description

Function to call 'Script.sleep'.

Parameters
Name Type Multiplicity Description

time

INT

1

Time to sleep in ms.

Sample (auto-generated)
CSK_Commands.sleep(time)

Events

CSK_Commands.OnDataLoadedOnReboot
Short description

Event to call if module tried to load parameters and should be ready.

Sample (auto-generated)
function handleOnDataLoadedOnReboot()
  -- Do something
end

Script.register("CSK_Commands.OnDataLoadedOnReboot", "handleOnDataLoadedOnReboot")
CSK_Commands.OnNewFunctionName
Short description

Event to notify name of function to execute.

Callback arguments
Name Type Multiplicity Description

functionName

STRING

1

Name of function (like CSK_ModuleName.FunctionName).

Sample (auto-generated)
function handleOnNewFunctionName(functionName)
  -- Do something
end

Script.register("CSK_Commands.OnNewFunctionName", "handleOnNewFunctionName")
CSK_Commands.OnNewLog
Short description

Notify log messages.

Callback arguments
Name Type Multiplicity Description

log

STRING

1

Log messages.

Sample (auto-generated)
function handleOnNewLog(log)
  -- Do something
end

Script.register("CSK_Commands.OnNewLog", "handleOnNewLog")
CSK_Commands.OnNewParameterName
Short description

Notify name of persistent data parameter.

Callback arguments
Name Type Multiplicity Description

name

STRING

1

Parameter name

Sample (auto-generated)
function handleOnNewParameterName(name)
  -- Do something
end

Script.register("CSK_Commands.OnNewParameterName", "handleOnNewParameterName")
CSK_Commands.OnNewStatusBoolParameterValue
Short description

Notify boolean value of parameter.

Callback arguments
Name Type Multiplicity Description

value

BOOL

1

Value

Sample (auto-generated)
function handleOnNewStatusBoolParameterValue(value)
  -- Do something
end

Script.register("CSK_Commands.OnNewStatusBoolParameterValue", "handleOnNewStatusBoolParameterValue")
CSK_Commands.OnNewStatusCommandList
Short description

Notify list of commands.

Callback arguments
Name Type Multiplicity Description

list

STRING

1

List of commands.

Sample (auto-generated)
function handleOnNewStatusCommandList(list)
  -- Do something
end

Script.register("CSK_Commands.OnNewStatusCommandList", "handleOnNewStatusCommandList")
CSK_Commands.OnNewStatusCSKStyle
Short description

Notify UI style to use for CSK modules.

Callback arguments
Name Type Multiplicity Description

theme

STRING

1

UI style

Sample (auto-generated)
function handleOnNewStatusCSKStyle(theme)
  -- Do something
end

Script.register("CSK_Commands.OnNewStatusCSKStyle", "handleOnNewStatusCSKStyle")
CSK_Commands.OnNewStatusEventName
Short description

Notify name of event to notify.

Callback arguments
Name Type Multiplicity Description

name

STRING

1

Name of event.

Sample (auto-generated)
function handleOnNewStatusEventName(name)
  -- Do something
end

Script.register("CSK_Commands.OnNewStatusEventName", "handleOnNewStatusEventName")
CSK_Commands.OnNewStatusFlowConfigPriority
Short description

Notify if FlowConfig should have priority for FlowConfig relevant configurations.

Callback arguments
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
function handleOnNewStatusFlowConfigPriority(status)
  -- Do something
end

Script.register("CSK_Commands.OnNewStatusFlowConfigPriority", "handleOnNewStatusFlowConfigPriority")
CSK_Commands.OnNewStatusLoadParameterOnReboot
Short description

Notify status if parameters should be loaded on app/device boot up.

Callback arguments
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
function handleOnNewStatusLoadParameterOnReboot(status)
  -- Do something
end

Script.register("CSK_Commands.OnNewStatusLoadParameterOnReboot", "handleOnNewStatusLoadParameterOnReboot")
CSK_Commands.OnNewStatusMode
Short description

Notfiy what mode to use

Callback arguments
Name Type Multiplicity Description

mode

STRING

1

Mode to call Function or notfiy event

Sample (auto-generated)
function handleOnNewStatusMode(mode)
  -- Do something
end

Script.register("CSK_Commands.OnNewStatusMode", "handleOnNewStatusMode")
CSK_Commands.OnNewStatusModuleIsActive
Short description

Notify if module can be used on device.

Callback arguments
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
function handleOnNewStatusModuleIsActive(status)
  -- Do something
end

Script.register("CSK_Commands.OnNewStatusModuleIsActive", "handleOnNewStatusModuleIsActive")
CSK_Commands.OnNewStatusModuleVersion
Short description

Notify version of module.

Callback arguments
Name Type Multiplicity Description

version

STRING

1

Version

Sample (auto-generated)
function handleOnNewStatusModuleVersion(version)
  -- Do something
end

Script.register("CSK_Commands.OnNewStatusModuleVersion", "handleOnNewStatusModuleVersion")
CSK_Commands.OnNewStatusNumberParameterValue
Short description

Notify number value of parameter.

Callback arguments
Name Type Multiplicity Description

value

INT

1

Value

Sample (auto-generated)
function handleOnNewStatusNumberParameterValue(value)
  -- Do something
end

Script.register("CSK_Commands.OnNewStatusNumberParameterValue", "handleOnNewStatusNumberParameterValue")
CSK_Commands.OnNewStatusParameterAmount
Short description

Notify amount of parameters to use for function call.

Callback arguments
Name Type Multiplicity Description

amount

INT

1

Amount of parameters.

Sample (auto-generated)
function handleOnNewStatusParameterAmount(amount)
  -- Do something
end

Script.register("CSK_Commands.OnNewStatusParameterAmount", "handleOnNewStatusParameterAmount")
CSK_Commands.OnNewStatusParameterList
Short description

Notify list of available parameters for command / event.

Callback arguments
Name Type Multiplicity Description

list

STRING

1

List

Sample (auto-generated)
function handleOnNewStatusParameterList(list)
  -- Do something
end

Script.register("CSK_Commands.OnNewStatusParameterList", "handleOnNewStatusParameterList")
CSK_Commands.OnNewStatusParameterType
Short description

Event to notify currently selected parameter values to use for function call.

Callback arguments
Name Type Multiplicity Description

parameterType

STRING

1

Type of parameter.

Sample (auto-generated)
function handleOnNewStatusParameterType(parameterType)
  -- Do something
end

Script.register("CSK_Commands.OnNewStatusParameterType", "handleOnNewStatusParameterType")
CSK_Commands.OnNewStatusSelectedParameter
Short description

Notify selected parameter to edit.

Callback arguments
Name Type Multiplicity Description

selection

STRING

1

Selected parameter.

Sample (auto-generated)
function handleOnNewStatusSelectedParameter(selection)
  -- Do something
end

Script.register("CSK_Commands.OnNewStatusSelectedParameter", "handleOnNewStatusSelectedParameter")
CSK_Commands.OnNewStatusStringParameterValue
Short description

Notify string value of parameter.

Callback arguments
Name Type Multiplicity Description

values

STRING

1

Value

Sample (auto-generated)
function handleOnNewStatusStringParameterValue(values)
  -- Do something
end

Script.register("CSK_Commands.OnNewStatusStringParameterValue", "handleOnNewStatusStringParameterValue")
CSK_Commands.OnPersistentDataModuleAvailable
Short description

Notify status if features of CSK_PersistendData module are available.

Callback arguments
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
function handleOnPersistentDataModuleAvailable(status)
  -- Do something
end

Script.register("CSK_Commands.OnPersistentDataModuleAvailable", "handleOnPersistentDataModuleAvailable")
CSK_Commands.OnUserLevelAdminActive
Short description

Status of Admin userlevel. Used internally in combination with the CSK_UserManagement module if available.

Callback arguments
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
function handleOnUserLevelAdminActive(status)
  -- Do something
end

Script.register("CSK_Commands.OnUserLevelAdminActive", "handleOnUserLevelAdminActive")
CSK_Commands.OnUserLevelMaintenanceActive
Short description

Status of Maintenance userlevel. Used internally in combination with the CSK_UserManagement module if available.

Callback arguments
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
function handleOnUserLevelMaintenanceActive(status)
  -- Do something
end

Script.register("CSK_Commands.OnUserLevelMaintenanceActive", "handleOnUserLevelMaintenanceActive")
CSK_Commands.OnUserLevelOperatorActive
Short description

Status of Operator userlevel. Used internally in combination with the CSK_UserManagement module if available.

Callback arguments
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
function handleOnUserLevelOperatorActive(status)
  -- Do something
end

Script.register("CSK_Commands.OnUserLevelOperatorActive", "handleOnUserLevelOperatorActive")
CSK_Commands.OnUserLevelServiceActive
Short description

Status of Service userlevel. Used internally in combination with the CSK_UserManagement module if available.

Callback arguments
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
function handleOnUserLevelServiceActive(status)
  -- Do something
end

Script.register("CSK_Commands.OnUserLevelServiceActive", "handleOnUserLevelServiceActive")

CSK_Module_Commands

Short description

This is an automatically generated CROWN (description not necessary).