Document metadata
Application name |
CSK_Module_ModuleName |
---|---|
Version |
3.5.0 |
Date |
2023-06-29 |
Author |
SICK AG |
Crowns
CSK_Module_ModuleName
Short description
This is an automatically generated CROWN (description not necessary).
CSK_ModuleName
Short description
Please fill in information regarding: What is the idea of this module and its features?
How to use this module in general…. like:
Typically the features of this module are used like this (check also main script of this module):
1) Setup
ToDo
2) Something else….
Overview
Functions
addInstance()
Short description
Function to add an additional instance.
Sample (auto-generated)
CSK_ModuleName.addInstance()
getInstancesAmount()
Short description
Get the amount of created instances of this module.
Return values
Name | Type | Multiplicity | Description |
---|---|---|---|
amount |
INT |
1 |
Amount of created instances. |
Sample (auto-generated)
amount = CSK_ModuleName.getInstancesAmount()
loadParameters()
Short description
Load parameters for this module from the CSK_PersistentData module if possible and use them.
Sample (auto-generated)
CSK_ModuleName.loadParameters()
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_ModuleName.pageCalled()
processInstanceNUM()
Short description
Example of dynamically served function to process internally coded function.
NUM will be replaced by the number of instance (e.g. "processInstance1").
INFO: Other modules can check via "Script.isServedAsFunction" if function of sepecific instance exists.
Needs then to be called via "Script.callFunction".
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
object |
OBJECT |
? |
Transferred object (optional) |
Return values
Name | Type | Multiplicity | Description |
---|---|---|---|
result |
BOOL |
? |
Processing result (optional). |
Sample (auto-generated)
result = CSK_ModuleName.processInstanceNUM(object)
resetInstances()
Short description
Function to reset instances to one single instance.
IMPORTANT: As instances start their own threads, the module needs to be restarted if new instances are needed… (see AppEngine docu for "Script.startScript").
Sample (auto-generated)
CSK_ModuleName.resetInstances()
sendParameters()
Short description
Send parameters to CSK_PersistentData module if possible to save them.
Sample (auto-generated)
CSK_ModuleName.sendParameters()
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 |
Set status |
Sample (auto-generated)
CSK_ModuleName.setLoadOnReboot(status)
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_ModuleName.setParameterName(name)
setRegisterEvent()
Short description
Configure event that this module should listen to. If this one is notified, it will be linked to internal processing function.
(Will be set to currently active instance, see "setSelectedObject")
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
event |
STRING |
1 |
(external) Event name to listen to. |
Sample (auto-generated)
CSK_ModuleName.setRegisterEvent(event)
setSelectedInstance()
Short description
Select one of the multiple instances.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
instance |
INT |
1 |
Instance to select. |
Sample (auto-generated)
CSK_ModuleName.setSelectedInstance(instance)
Events
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_ModuleName.OnDataLoadedOnReboot", "handleOnDataLoadedOnReboot")
OnNewInstanceList
Short description
Event to provide list of created instances.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
list |
STRING |
1 |
List of created instances. |
Sample (auto-generated)
function handleOnNewInstanceList(list)
-- Do something
end
Script.register("CSK_ModuleName.OnNewInstanceList", "handleOnNewInstanceList")
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_ModuleName.OnNewParameterName", "handleOnNewParameterName")
OnNewProcessingParameter
Short description
Event to share processing parameters to the instances.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
objectNo |
INT |
1 |
Number of the instance to receive the parameter. |
parameter |
STRING |
1 |
Name of the parameter. |
value |
AUTO |
1 |
Value of the parameter. |
internalObjectNo |
INT |
? |
If parameter is for specifici internal used object, its number. |
Sample (auto-generated)
function handleOnNewProcessingParameter(objectNo, parameter, value, internalObjectNo)
-- Do something
end
Script.register("CSK_ModuleName.OnNewProcessingParameter", "handleOnNewProcessingParameter")
OnNewResult
Short description
Generic event to notify results. E.g. to forward results from single instances.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
result |
BOOL |
1 |
Result |
Sample (auto-generated)
function handleOnNewResult(result)
-- Do something
end
Script.register("CSK_ModuleName.OnNewResult", "handleOnNewResult")
OnNewResultNUM
Short description
Example of dynamically created event to provide result of instance.
NUM will be replaced by the number of instance (e.g. "OnNewResult1").
INFO: Other modules can check via "Script.isServedAsEvent" if event of sepecific instance exists.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
result |
BOOL |
1 |
Result |
Sample (auto-generated)
function handleOnNewResultNUM(result)
-- Do something
end
Script.register("CSK_ModuleName.OnNewResultNUM", "handleOnNewResultNUM")
OnNewSelectedInstance
Short description
Notify if new instance is selected.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
selectedObject |
INT |
1 |
Selected instance. |
Sample (auto-generated)
function handleOnNewSelectedInstance(selectedObject)
-- Do something
end
Script.register("CSK_ModuleName.OnNewSelectedInstance", "handleOnNewSelectedInstance")
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_ModuleName.OnNewStatusLoadParameterOnReboot", "handleOnNewStatusLoadParameterOnReboot")
OnNewValueToForwardNUM
Short description
Example of dynamically created event to forward data from instance thread to Controller part of module, e.g. to forward values to UI.
NUM will be replaced by the number of instance (e.g. "OnNewResult1").
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
eventname |
STRING |
1 |
Eventname to use to forward value. |
value |
AUTO |
1 |
Value to forward. |
Sample (auto-generated)
function handleOnNewValueToForwardNUM(eventname, value)
-- Do something
end
Script.register("CSK_ModuleName.OnNewValueToForwardNUM", "handleOnNewValueToForwardNUM")
OnNewValueUpdateNUM
Short description
Example of dynamically created event to sync paramters between instance threads and Controller part of module.
NUM will be replaced by the number of instance (e.g. "OnNewResult1").
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
instance |
INT |
1 |
Instance new value is coming from. |
parameter |
STRING |
1 |
Name of the paramter to update/sync. |
value |
AUTO |
1 |
Value to update. |
selectedObject |
INT |
? |
Optionally if internal parameter should be used for internal objects. |
Sample (auto-generated)
function handleOnNewValueUpdateNUM(instance, parameter, value, selectedObject)
-- Do something
end
Script.register("CSK_ModuleName.OnNewValueUpdateNUM", "handleOnNewValueUpdateNUM")
OnPersistentDataModuleAvailable
Short description
Notify status if features of CSK_PersistentData 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_ModuleName.OnPersistentDataModuleAvailable", "handleOnPersistentDataModuleAvailable")
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_ModuleName.OnUserLevelAdminActive", "handleOnUserLevelAdminActive")
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_ModuleName.OnUserLevelMaintenanceActive", "handleOnUserLevelMaintenanceActive")
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_ModuleName.OnUserLevelOperatorActive", "handleOnUserLevelOperatorActive")
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_ModuleName.OnUserLevelServiceActive", "handleOnUserLevelServiceActive")