Document metadata
Application name |
CSK_Module_TCPIPClient |
---|---|
Version |
3.1.0 |
Date |
2023-09-22 |
Author |
SICK AG |
Crowns
CSK_Module_TCPIPClient
Short description
This is an automatically generated CROWN (description not necessary).
CSK_TCPIPClient
Short description
Module to provide TCP/IP client functionality. Other modules can access its features / settings.
This module provides a UI for all relevant features.
Typically the features of this module are used like this (check also main script of this module):
1) Setup the TCP/IP client configuration
See UI
2) Forward content via TCP/IP, also by other modules
To send content via TCP/IP, there are different possibilities.
You can make use of sendDataViaTCPIP() to directly send the content with this function.
It is also possible to preset the content via setCommand() and after that send the preset content via transmitCommando() (e.g. used within the UI).
Additionally it is possible to configure the module to listen / wait for specific events of other modules/apps and to forward their content via TCP/IP.
This can be used e.g. to listen to "OtherModule.OnNewResult"-events and to forward the results via TCP/IP (data will be converted to data type 'string').
To do so make use of "addEventToForward" (via script) or "addEventToForwardViaUI" (event needs to be preset via "setEventToForward").
3) Wait for incoming triggers
It is possible to define trigger commandos to wait for and to forward this on another event, e.g. to another module.
This can be done e.g. via addTriggerEventPair('TRG', 'OnNewTrigger').
By doing this, it will notify the TCPIPClient.OnNewTrigger event if a TRG is received on the client.
INFO: Events will dynamically created and served. Other modules can check via "Script.isServedAsEvent" if event exists.
If there is additional content following the defined trigger command after a ',' it will also be forwarded withint the data content of the event.
The same can be done via the UI step by step (see setTrigger(), setEventName(), or addTriggerEventPairViaUI()).
4) Listen for incoming content
It is also possible to register on the 'OnNewDataReceived' event by other modules to get the communication content.
Overview
Functions
addEventToForward()
Short description
Add an event to register to and to forward the content of its first parameter (as string) to TCP/IP server.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
event |
STRING |
1 |
Name of event to register to. |
Sample (auto-generated)
CSK_TCPIPClient.addEventToForward(event)
addEventToForwardViaUI()
Short description
Add event to register to and forward content (first event parameter as string) to TCPI/IP server via UI (event needs to be prefilled on UI / via "setEventToForward").
Sample (auto-generated)
CSK_TCPIPClient.addEventToForwardViaUI()
addTriggerEventPair()
Short description
Add a trigger command to wait for and the related event to call if the trigger command was received.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
trigger |
STRING |
1 |
Trigger to listen on TCP/IP connection. |
event |
STRING |
1 |
Name of event to notify if trigger command was received. |
Sample (auto-generated)
CSK_TCPIPClient.addTriggerEventPair(trigger, event)
addTriggerEventPairViaUI()
Short description
Add pair of "trigger" and "event" via UI (parameters are prefilled on UI).
Sample (auto-generated)
CSK_TCPIPClient.addTriggerEventPairViaUI()
deleteEventToForward()
Short description
Remove event to forward content.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
event |
STRING |
1 |
Eventname |
Sample (auto-generated)
CSK_TCPIPClient.deleteEventToForward(event)
deleteEventToForwardViaUI()
Short description
Remove event preselected via UI.
Sample (auto-generated)
CSK_TCPIPClient.deleteEventToForwardViaUI()
deleteTriggerEventPair()
Short description
Remove trigger/event pair via trigger name.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
trigger |
STRING |
1 |
Trigger command |
Sample (auto-generated)
CSK_TCPIPClient.deleteTriggerEventPair(trigger)
deleteTriggerEventPairViaUI()
Short description
Remove trigger/event pair selected via modules UI.
Sample (auto-generated)
CSK_TCPIPClient.deleteTriggerEventPairViaUI()
loadParameters()
Short description
Load parameters for this module from the CSK_PersistentData module if possible and use them.
Sample (auto-generated)
CSK_TCPIPClient.loadParameters()
pageCalled()
Short description
Function to register "OnResume" of the module UI (only as helper function).
Return values
Name | Type | Multiplicity | Description |
---|---|---|---|
emptyString |
STRING |
1 |
Empty string (only needed to simplify binding). |
Sample (auto-generated)
emptyString = CSK_TCPIPClient.pageCalled()
selectEventToForwardViaUI()
Short description
Select an event to forward the content of its first parameter to TCP/IP server via UI.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
selection |
STRING |
1 |
Selected event. |
Sample (auto-generated)
CSK_TCPIPClient.selectEventToForwardViaUI(selection)
selectTriggerEventPairViaUI()
Short description
Select a trigger/event pair via UI.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
selection |
STRING |
1 |
Selected trigger/event pair. |
Sample (auto-generated)
CSK_TCPIPClient.selectTriggerEventPairViaUI(selection)
sendDataViaTCPIP()
Short description
Transmit data via currently active TCP/IP connection.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
data |
STRING |
1 |
Binary string to transmit via TCP/IP. |
Sample (auto-generated)
CSK_TCPIPClient.sendDataViaTCPIP(data)
sendParameters()
Short description
Send parameters to CSK_PersistentData module if possible to save them.
Sample (auto-generated)
CSK_TCPIPClient.sendParameters()
setCommand()
Short description
Set command to transmit via TCP/IP if triggered via "transmitCommando() (used in modules UI).
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
cmd |
STRING |
1 |
Command to transmit. |
Sample (auto-generated)
CSK_TCPIPClient.setCommand(cmd)
setConnectionStatus()
Short description
Set status of TCP/IP connection.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
status |
BOOL |
1 |
Status |
Sample (auto-generated)
CSK_TCPIPClient.setConnectionStatus(status)
setEventToForward()
Short description
Preset event to register to and forward content to TCP/IP server via UI.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
value |
STRING |
1 |
Event to register to. |
Sample (auto-generated)
CSK_TCPIPClient.setEventToForward(value)
setEventValue()
Short description
Set event for trigger/event pair via UI.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
value |
STRING |
1 |
Event to notify. |
Sample (auto-generated)
CSK_TCPIPClient.setEventValue(value)
setInterface()
Short description
Set interface for the TCP/IP connection.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
interface |
STRING |
1 |
Interface |
Sample (auto-generated)
CSK_TCPIPClient.setInterface(interface)
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_TCPIPClient.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 |
Parameter name |
Sample (auto-generated)
CSK_TCPIPClient.setParameterName(name)
setPort()
Short description
Set port of TCP/IP connection.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
port |
INT |
1 |
Port |
Sample (auto-generated)
CSK_TCPIPClient.setPort(port)
setRxFraming()
Short description
Set Rx frame of TCP/IP connection (only 'empty' or 'STX-ETX' supported). Will become active with next connection.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
frame |
1 |
Frame to use. |
Sample (auto-generated)
CSK_TCPIPClient.setRxFraming(frame)
setServerAddress()
Short description
Set IP of TCP/IP server.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
address |
STRING |
1 |
IP |
Sample (auto-generated)
CSK_TCPIPClient.setServerAddress(address)
setTrigger()
Short description
Set trigger command for trigger/event pair via UI.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
value |
STRING |
1 |
Trigger command |
Sample (auto-generated)
CSK_TCPIPClient.setTrigger(value)
setTxFraming()
Short description
Set Tx frame of TCP/IP connection (only 'empty' or 'STX-ETX' supported). Will become active with next connection.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
frame |
1 |
Frame to use. |
Sample (auto-generated)
CSK_TCPIPClient.setTxFraming(frame)
startTCPIPClient()
Short description
Start TCP/IP client.
Sample (auto-generated)
CSK_TCPIPClient.startTCPIPClient()
stopTCPIPClient()
Short description
Stop TCP/IP client.
Sample (auto-generated)
CSK_TCPIPClient.stopTCPIPClient()
transmitCommando()
Short description
Transmit preset commando via TCP/IP (used in module UI). See also "setCommand".
Sample (auto-generated)
CSK_TCPIPClient.transmitCommando()
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_TCPIPClient.OnDataLoadedOnReboot", "handleOnDataLoadedOnReboot")
OnNewCommand
Short description
Notify command to send.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
cmd |
STRING |
1 |
Command to transmit. |
Sample (auto-generated)
function handleOnNewCommand(cmd)
-- Do something
end
Script.register("CSK_TCPIPClient.OnNewCommand", "handleOnNewCommand")
OnNewConnectionStatus
Short description
Notify configuration setup of TCP/IP connection status.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
status |
BOOL |
1 |
Status |
Sample (auto-generated)
function handleOnNewConnectionStatus(status)
-- Do something
end
Script.register("CSK_TCPIPClient.OnNewConnectionStatus", "handleOnNewConnectionStatus")
OnNewCurrentConnectionStatus
Short description
Notify current status of TCP/IP connection.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
status |
BOOL |
1 |
Status |
Sample (auto-generated)
function handleOnNewCurrentConnectionStatus(status)
-- Do something
end
Script.register("CSK_TCPIPClient.OnNewCurrentConnectionStatus", "handleOnNewCurrentConnectionStatus")
OnNewDataReceived
Short description
Notify received data.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
data |
STRING |
1 |
Received data. |
Sample (auto-generated)
function handleOnNewDataReceived(data)
-- Do something
end
Script.register("CSK_TCPIPClient.OnNewDataReceived", "handleOnNewDataReceived")
OnNewEventToForwardList
Short description
Notify list of events to register to and to forward its content to TCP/IP server.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
list |
STRING |
1 |
List |
Sample (auto-generated)
function handleOnNewEventToForwardList(list)
-- Do something
end
Script.register("CSK_TCPIPClient.OnNewEventToForwardList", "handleOnNewEventToForwardList")
OnNewInterface
Short description
Notify selected interface for TCP/IP connection.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
interface |
STRING |
1 |
Interface |
Sample (auto-generated)
function handleOnNewInterface(interface)
-- Do something
end
Script.register("CSK_TCPIPClient.OnNewInterface", "handleOnNewInterface")
OnNewInterfaceList
Short description
Notify list of available interfaces for TCP/IP connection.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
list |
STRING |
1 |
List of interfaces. |
Sample (auto-generated)
function handleOnNewInterfaceList(list)
-- Do something
end
Script.register("CSK_TCPIPClient.OnNewInterfaceList", "handleOnNewInterfaceList")
OnNewLog
Short description
Notfiy latest log.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
log |
STRING |
1 |
Log entries. |
Sample (auto-generated)
function handleOnNewLog(log)
-- Do something
end
Script.register("CSK_TCPIPClient.OnNewLog", "handleOnNewLog")
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_TCPIPClient.OnNewParameterName", "handleOnNewParameterName")
OnNewPort
Short description
Notify port of TCP/IP connection.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
port |
INT |
1 |
Port |
Sample (auto-generated)
function handleOnNewPort(port)
-- Do something
end
Script.register("CSK_TCPIPClient.OnNewPort", "handleOnNewPort")
OnNewRxFrame
Short description
Notify RxFrame.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
frame |
STRING |
1 |
frame |
Sample (auto-generated)
function handleOnNewRxFrame(frame)
-- Do something
end
Script.register("CSK_TCPIPClient.OnNewRxFrame", "handleOnNewRxFrame")
OnNewServerIP
Short description
Notify TCP/IP server IP.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
serverIP |
STRING |
1 |
IP |
Sample (auto-generated)
function handleOnNewServerIP(serverIP)
-- Do something
end
Script.register("CSK_TCPIPClient.OnNewServerIP", "handleOnNewServerIP")
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_TCPIPClient.OnNewStatusLoadParameterOnReboot", "handleOnNewStatusLoadParameterOnReboot")
OnNewTestTrigger
Short description
Internal test event to be notified if test trigger cmd was received ('TRG').
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
data |
STRING |
? |
Data content to forward. |
Sample (auto-generated)
function handleOnNewTestTrigger(data)
-- Do something
end
Script.register("CSK_TCPIPClient.OnNewTestTrigger", "handleOnNewTestTrigger")
OnNewTriggerEventPairList
Short description
Notify list of trigger/event pairs.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
list |
STRING |
1 |
List |
Sample (auto-generated)
function handleOnNewTriggerEventPairList(list)
-- Do something
end
Script.register("CSK_TCPIPClient.OnNewTriggerEventPairList", "handleOnNewTriggerEventPairList")
OnNewTxFrame
Short description
Notify TxFrame.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
frame |
STRING |
1 |
frame |
Sample (auto-generated)
function handleOnNewTxFrame(frame)
-- Do something
end
Script.register("CSK_TCPIPClient.OnNewTxFrame", "handleOnNewTxFrame")
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_TCPIPClient.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_TCPIPClient.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_TCPIPClient.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_TCPIPClient.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_TCPIPClient.OnUserLevelServiceActive", "handleOnUserLevelServiceActive")
Enumerations
CSK_TCPIPClient.Communication_Frame
TCP/IP communication frame.
Value | Name | Description |
---|---|---|
empty |
empty |
No frame. |
STX-ETX |
STX_ETX |
STX / ETX framing. |