Document metadata

Application name

CSK_Module_MultiDataLogger

Version

2.0.0

Date

2024-08-14

Author

SICK AG

Crowns

CSK_Module_MultiDataLogger

Short description

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

CSK_MultiDataLogger

Short description

Module to store / log data like files or images.

Typically, the feature of this module is used like this (check also main script of this module):

1) Setup
- Set instance to configure via 'setSelectedInstance'
- Set data mode and storage path via 'setDataMode' and 'setPath'.
- Set type of data or image via 'setDataType' or 'setImageType'.
- If it should store data in a CSV-formatted file, you should set the CSV filename via 'setCSVFilename', the CSV labels via 'setCSVLabels'. Additionally, choose mode for 'setSaveOnlyChanges' and 'setSaveDataDirectly'.
- Set an event to receive the data / image to store via 'setRegisterEvent'. This event should provide as first parameter the data to store and as second parameter an optional filename (2nd parameter not needed, if data type is 'csv'). Otherwise, it will use the timestamp as filename.

Functions

CSK_MultiDataLogger.addInstance()
Short description

Function to add an additional instance.

Sample (auto-generated)
CSK_MultiDataLogger.addInstance()
CSK_MultiDataLogger.clearFlowConfigRelevantConfiguration()
Short description

Function to clear FlowConfig relevant configurations.

Sample (auto-generated)
CSK_MultiDataLogger.clearFlowConfigRelevantConfiguration()
CSK_MultiDataLogger.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_MultiDataLogger.getInstancesAmount()
CSK_MultiDataLogger.getParameters()
Short description

Function to get all parameters of the client in JSON format.

Parameters
Name Type Multiplicity Description

instanceNo

INT

1

Number of instance to get parameters from.

Return values
Name Type Multiplicity Description

jsonParameters

STRING

1

JSON string with all parameters.

Sample (auto-generated)
jsonParameters = CSK_MultiDataLogger.getParameters(instanceNo)
CSK_MultiDataLogger.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_MultiDataLogger.getStatusModuleActive()
CSK_MultiDataLogger.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_MultiDataLogger.loadParameters()
CSK_MultiDataLogger.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_MultiDataLogger.pageCalled()
CSK_MultiDataLogger.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_MultiDataLogger.resetInstances()
CSK_MultiDataLogger.resetModule()
Short description

Function to reset main configuration of module.

Sample (auto-generated)
CSK_MultiDataLogger.resetModule()
CSK_MultiDataLogger.saveCSVFile()
Short description

Function to manually save CSV file.

Sample (auto-generated)
CSK_MultiDataLogger.saveCSVFile()
CSK_MultiDataLogger.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_MultiDataLogger.sendParameters(noDataSave)
CSK_MultiDataLogger.setCompressionValue()
Short description

Function to set image compression value

Parameters
Name Type Multiplicity Description

value

INT

1

Image compression value.

Sample (auto-generated)
CSK_MultiDataLogger.setCompressionValue(value)
CSK_MultiDataLogger.setCSVFilename()
Short description

Function to set CSV filename.

Parameters
Name Type Multiplicity Description

name

STRING

1

Filename

Sample (auto-generated)
CSK_MultiDataLogger.setCSVFilename(name)
CSK_MultiDataLogger.setCSVLabels()
Short description

Function to set CSV labels.

Parameters
Name Type Multiplicity Description

labels

STRING

1

CSV labels seperated by comma.

Sample (auto-generated)
CSK_MultiDataLogger.setCSVLabels(labels)
CSK_MultiDataLogger.setDataMode()
Short description

Function to set data mode.

Parameters
Name Type Multiplicity Description

mode

ENUM
CSK_MultiDataLogger.DataMode

1

Data mode.

Sample (auto-generated)
CSK_MultiDataLogger.setDataMode(mode)
CSK_MultiDataLogger.setDataType()
Short description

Function to set data type.

Parameters
Name Type Multiplicity Description

dataType

ENUM
null

1

Data type.

Sample (auto-generated)
CSK_MultiDataLogger.setDataType(dataType)
CSK_MultiDataLogger.setFlowConfigPriority()
Short description

Function to configure if FlowConfig should have priority for FlowConfig relevant configuration.

Parameters
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
CSK_MultiDataLogger.setFlowConfigPriority(status)
CSK_MultiDataLogger.setImageType()
Short description

Function to set image type.

Parameters
Name Type Multiplicity Description

imgType

STRING

1

Image type

Sample (auto-generated)
CSK_MultiDataLogger.setImageType(imgType)
CSK_MultiDataLogger.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_MultiDataLogger.setLoadOnReboot(status)
CSK_MultiDataLogger.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_MultiDataLogger.setParameterName(name)
CSK_MultiDataLogger.setPath()
Short description

Function to set storage path.

Parameters
Name Type Multiplicity Description

path

STRING

1

Storage path for incoming data.

Sample (auto-generated)
CSK_MultiDataLogger.setPath(path)
CSK_MultiDataLogger.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_MultiDataLogger.setRegisterEvent(event)
CSK_MultiDataLogger.setSaveDataDirectly()
Short description

Set if data should be saved persistently with every new received data.
If FALSE it is needed to call 'saveLog' manually to store log data.

Parameters
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
CSK_MultiDataLogger.setSaveDataDirectly(status)
CSK_MultiDataLogger.setSaveOnlyChanges()
Short description

Set to TRUE if data should be logged only if value changed.

Parameters
Name Type Multiplicity Description

status

BOOL

1

Status

Sample (auto-generated)
CSK_MultiDataLogger.setSaveOnlyChanges(status)
CSK_MultiDataLogger.setSelectedInstance()
Short description

Select one of the multiple instances.

Parameters
Name Type Multiplicity Description

instance

INT

1

Instance to select.

Sample (auto-generated)
CSK_MultiDataLogger.setSelectedInstance(instance)

Events

CSK_MultiDataLogger.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_MultiDataLogger.OnDataLoadedOnReboot", "handleOnDataLoadedOnReboot")
CSK_MultiDataLogger.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_MultiDataLogger.OnNewInstanceList", "handleOnNewInstanceList")
CSK_MultiDataLogger.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_MultiDataLogger.OnNewParameterName", "handleOnNewParameterName")
CSK_MultiDataLogger.OnNewProcessingParameter
Short description

Event to share processing parameters to the instances.

Callback arguments
Name Type Multiplicity Description

objectNo

INT

1

Numeric identifier of the instance to receive the parameter.

parameter

STRING

1

Name of the parameter.

value

AUTO

1

Value of the parameter.

internalObjectNo

INT

?

Numeric identifier, if parameter is for specific internal used object.

Sample (auto-generated)
function handleOnNewProcessingParameter(objectNo, parameter, value, internalObjectNo)
  -- Do something
end

Script.register("CSK_MultiDataLogger.OnNewProcessingParameter", "handleOnNewProcessingParameter")
CSK_MultiDataLogger.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_MultiDataLogger.OnNewResult", "handleOnNewResult")
CSK_MultiDataLogger.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_MultiDataLogger.OnNewSelectedInstance", "handleOnNewSelectedInstance")
CSK_MultiDataLogger.OnNewStatusAvailableEvents
Short description

Notify available events.

Callback arguments
Name Type Multiplicity Description

listOfEvents

STRING

1

JSON list

Sample (auto-generated)
function handleOnNewStatusAvailableEvents(listOfEvents)
  -- Do something
end

Script.register("CSK_MultiDataLogger.OnNewStatusAvailableEvents", "handleOnNewStatusAvailableEvents")
CSK_MultiDataLogger.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_MultiDataLogger.OnNewStatusCSKStyle", "handleOnNewStatusCSKStyle")
CSK_MultiDataLogger.OnNewStatusCSVFilename
Short description

Notify name of CSV file to store data.

Callback arguments
Name Type Multiplicity Description

name

STRING

1

Name of file.

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

Script.register("CSK_MultiDataLogger.OnNewStatusCSVFilename", "handleOnNewStatusCSVFilename")
CSK_MultiDataLogger.OnNewStatusCSVLables
Short description

Notify CSV labels.

Callback arguments
Name Type Multiplicity Description

labels

STRING

1

CSV labels.

Sample (auto-generated)
function handleOnNewStatusCSVLables(labels)
  -- Do something
end

Script.register("CSK_MultiDataLogger.OnNewStatusCSVLables", "handleOnNewStatusCSVLables")
CSK_MultiDataLogger.OnNewStatusDataMode
Short description

Notify mode of data storage

Callback arguments
Name Type Multiplicity Description

mode

STRING

1

Data mode.

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

Script.register("CSK_MultiDataLogger.OnNewStatusDataMode", "handleOnNewStatusDataMode")
CSK_MultiDataLogger.OnNewStatusDataType
Short description

Notfiy data type.

Callback arguments
Name Type Multiplicity Description

type

STRING

1

Data type

Sample (auto-generated)
function handleOnNewStatusDataType(type)
  -- Do something
end

Script.register("CSK_MultiDataLogger.OnNewStatusDataType", "handleOnNewStatusDataType")
CSK_MultiDataLogger.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_MultiDataLogger.OnNewStatusFlowConfigPriority", "handleOnNewStatusFlowConfigPriority")
CSK_MultiDataLogger.OnNewStatusImageCompressionValue
Short description

Notify value of image compression.

Callback arguments
Name Type Multiplicity Description

imgCompression

INT

1

Image compression value.

Sample (auto-generated)
function handleOnNewStatusImageCompressionValue(imgCompression)
  -- Do something
end

Script.register("CSK_MultiDataLogger.OnNewStatusImageCompressionValue", "handleOnNewStatusImageCompressionValue")
CSK_MultiDataLogger.OnNewStatusImageType
Short description

Notify image type.

Callback arguments
Name Type Multiplicity Description

imageType

STRING

1

Type of image

Sample (auto-generated)
function handleOnNewStatusImageType(imageType)
  -- Do something
end

Script.register("CSK_MultiDataLogger.OnNewStatusImageType", "handleOnNewStatusImageType")
CSK_MultiDataLogger.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_MultiDataLogger.OnNewStatusLoadParameterOnReboot", "handleOnNewStatusLoadParameterOnReboot")
CSK_MultiDataLogger.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_MultiDataLogger.OnNewStatusModuleIsActive", "handleOnNewStatusModuleIsActive")
CSK_MultiDataLogger.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_MultiDataLogger.OnNewStatusModuleVersion", "handleOnNewStatusModuleVersion")
CSK_MultiDataLogger.OnNewStatusRegisteredEvent
Short description

Notify event instance is registered to receive data to process.

Callback arguments
Name Type Multiplicity Description

eventname

STRING

1

Name of event.

Sample (auto-generated)
function handleOnNewStatusRegisteredEvent(eventname)
  -- Do something
end

Script.register("CSK_MultiDataLogger.OnNewStatusRegisteredEvent", "handleOnNewStatusRegisteredEvent")
CSK_MultiDataLogger.OnNewStatusSaveDataDirectly
Short description

Notify status if log file should be saved automatically as soon as it receives a new data entry.

Callback arguments
Name Type Multiplicity Description

status

BOOL

1

Status

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

Script.register("CSK_MultiDataLogger.OnNewStatusSaveDataDirectly", "handleOnNewStatusSaveDataDirectly")
CSK_MultiDataLogger.OnNewStatusSaveOnlyChanges
Short description

Notify status if log file should log received data only if it differs from previous data.

Callback arguments
Name Type Multiplicity Description

status

BOOL

1

Status

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

Script.register("CSK_MultiDataLogger.OnNewStatusSaveOnlyChanges", "handleOnNewStatusSaveOnlyChanges")
CSK_MultiDataLogger.OnNewStatusStoragePath
Short description

Notify path to store incoming data

Callback arguments
Name Type Multiplicity Description

path

STRING

1

Storage path.

Sample (auto-generated)
function handleOnNewStatusStoragePath(path)
  -- Do something
end

Script.register("CSK_MultiDataLogger.OnNewStatusStoragePath", "handleOnNewStatusStoragePath")
CSK_MultiDataLogger.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. "OnNewValueToForward1").

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_MultiDataLogger.OnNewValueToForwardNUM", "handleOnNewValueToForwardNUM")
CSK_MultiDataLogger.OnNewValueUpdateNUM
Short description

Example of dynamically created event to sync parameters between instance threads and Controller part of module.
NUM will be replaced by the number of instance (e.g. "OnNewValueUpdate1").

Callback arguments
Name Type Multiplicity Description

instance

INT

1

Instance new value is coming from.

parameter

STRING

1

Name of the parameter 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_MultiDataLogger.OnNewValueUpdateNUM", "handleOnNewValueUpdateNUM")
CSK_MultiDataLogger.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_MultiDataLogger.OnPersistentDataModuleAvailable", "handleOnPersistentDataModuleAvailable")
CSK_MultiDataLogger.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_MultiDataLogger.OnUserLevelAdminActive", "handleOnUserLevelAdminActive")
CSK_MultiDataLogger.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_MultiDataLogger.OnUserLevelMaintenanceActive", "handleOnUserLevelMaintenanceActive")
CSK_MultiDataLogger.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_MultiDataLogger.OnUserLevelOperatorActive", "handleOnUserLevelOperatorActive")
CSK_MultiDataLogger.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_MultiDataLogger.OnUserLevelServiceActive", "handleOnUserLevelServiceActive")

MultiDataLogger_FC

Short description

Crown to provide CSK_FlowConfig relevant features.

Overview

MultiDataLogger_FC.DataSource

Short description

Set source of data to log.

Functions

MultiDataLogger_FC.DataSource.create()
Short description

Internally used CSK_FlowConfig create function.

Parameters
Name Type Multiplicity Description

Instance

INT

1

Numeric identifier of processing instance (must be >=1).

Return values
Name Type Multiplicity Description

handle

HANDLE

1

Handle to internally used FlowConfig instance.

Sample (auto-generated)
handle = MultiDataLogger_FC.DataSource.create(Instance)
MultiDataLogger_FC.DataSource.dataSource()
Short description

Set source of data to log.

Parameters
Name Type Multiplicity Description

handle

HANDLE

1

Handle to internally used FlowConfig instance.

source

STRING

1

Source of data to log. Parameter: 1: Data source (STRING)

Sample (auto-generated)
MultiDataLogger_FC.DataSource.dataSource(handle, source)

Enumerations

CSK_MultiDataLogger.DataMode

Mode of data to store.

Items
Value Name Description
file

file

Store files

image

image

Store images

CSK_MultiDataLogger.DataType

Data type

Items
Value Name Description
json

json

JSON

csv

csv

CSV

CSK_MultiDataLogger.ImageFormat

Image format

Items
Value Name Description
bmp

bmp

BMP

png

png

PNG

jpg

jpg

JPEG

json

json

JSON

msgpack

msgpack

MSGPACK