Document metadata
Application name |
CSK_Module_FTPClient |
---|---|
Version |
4.0.0 |
Date |
2024-08-14 |
Author |
SICK AG |
Crowns
CSK_FTPClient
Short description
Module to provide FTP client functionality
Typically the features of this module are used like this (check also main script of this module):
1) Setup the configuration
E. g. via:
CSK_FTPClient.setUsername('tester')
CSK_FTPClient.setPassword('password')
CSK_FTPClient.setPassiveMode(status)
2) Try to connect to the FTP server
CSK_FTPClient.connectFtpClient()
3) If connection was possible, send content to FTP server
E.g. via function "sendData", "sendImage"
4) Optioanlly use Async mode
Per default this module sends the content via FTP and waits till the process was finished.
If it is supported by the device and firmware, it is also possible to use the asynchronous mode.
It will send the content then in its own thread, but other apps can further run in parallel.
CSK_FTPClient.setAsyncMode(status)
5) Register to events to receive data
It is possible to register to events of other apps to put the received data to the FTP server via 'addRegistration'.
Overview
Functions
addRegistration()
Short description
Function to add event registration.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
eventName |
STRING |
1 |
Name of event to receive data. |
dataType |
STRING |
1 |
Type of received data. |
autoFilename |
BOOL |
1 |
Status if filename of received data (via registered events) to put to FTP server should be generated by timestamp. |
Sample (auto-generated)
CSK_FTPClient.addRegistration(eventName, dataType, autoFilename)
addRegistrationViaUI()
Short description
Function to register to preconfigured event via UI.
Sample (auto-generated)
CSK_FTPClient.addRegistrationViaUI()
clearFlowConfigRelevantConfiguration()
Short description
Function to clear FlowConfig relevant configurations.
Sample (auto-generated)
CSK_FTPClient.clearFlowConfigRelevantConfiguration()
connectFTPClient()
Short description
Try to connect to FTP server by making use of the predefined configration.
Return values
Name | Type | Multiplicity | Description |
---|---|---|---|
connected |
BOOL |
1 |
Status of connection success. |
Sample (auto-generated)
connected = CSK_FTPClient.connectFTPClient()
deleteRegistration()
Short description
Function to delete event registration.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
eventName |
STRING |
1 |
Name of event to deregister from. |
Sample (auto-generated)
CSK_FTPClient.deleteRegistration(eventName)
deleteRegistrationViaUI()
Short description
Function to delete via UI selected event registration.
Sample (auto-generated)
CSK_FTPClient.deleteRegistrationViaUI()
disconnectFTPClient()
Short description
Disconnect from FTP server
Sample (auto-generated)
CSK_FTPClient.disconnectFTPClient()
getAsyncMode()
Short description
Get current setting of async transfer mode.
Return values
Name | Type | Multiplicity | Description |
---|---|---|---|
status |
BOOL |
1 |
Status |
Sample (auto-generated)
status = CSK_FTPClient.getAsyncMode()
getFTPPort()
Short description
Get current setting of FTP port.
Return values
Name | Type | Multiplicity | Description |
---|---|---|---|
port |
INT |
1 |
Port |
Sample (auto-generated)
port = CSK_FTPClient.getFTPPort()
getFTPServerIP()
Short description
Get current setting of FTP server IP.
Return values
Name | Type | Multiplicity | Description |
---|---|---|---|
ip |
STRING |
1 |
IP |
Sample (auto-generated)
ip = CSK_FTPClient.getFTPServerIP()
getFTPStatus()
Short description
Get current FTP connection status.
Return values
Name | Type | Multiplicity | Description |
---|---|---|---|
status |
BOOL |
1 |
Status |
Sample (auto-generated)
status = CSK_FTPClient.getFTPStatus()
getImageName()
Short description
Get suffix of image names to store.
Return values
Name | Type | Multiplicity | Description |
---|---|---|---|
imageName |
STRING |
1 |
Suffix of image names. |
Sample (auto-generated)
imageName = CSK_FTPClient.getImageName()
getParameters()
Short description
Function to get all parameters of the client in JSON format.
Return values
Name | Type | Multiplicity | Description |
---|---|---|---|
jsonParameters |
STRING |
1 |
JSON string with all parameters. |
Sample (auto-generated)
jsonParameters = CSK_FTPClient.getParameters()
getPassiveMode()
Short description
Get current setting of FTP passive connection mode.
Return values
Name | Type | Multiplicity | Description |
---|---|---|---|
status |
BOOL |
1 |
Status |
Sample (auto-generated)
status = CSK_FTPClient.getPassiveMode()
getPassword()
Short description
Get currently used connection password.
Return values
Name | Type | Multiplicity | Description |
---|---|---|---|
password |
STRING |
1 |
Password |
Sample (auto-generated)
password = CSK_FTPClient.getPassword()
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_FTPClient.getStatusModuleActive()
getUsername()
Short description
Get currently used connection user.
Return values
Name | Type | Multiplicity | Description |
---|---|---|---|
user |
STRING |
1 |
User |
Sample (auto-generated)
user = CSK_FTPClient.getUsername()
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_FTPClient.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_FTPClient.pageCalled()
resetModule()
Short description
Function to reset main configuration of module.
Sample (auto-generated)
CSK_FTPClient.resetModule()
sendData()
Short description
Send data to connected FTP server.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
data |
AUTO |
1 |
Data to send. |
filename |
STRING |
1 |
Filename to store send data on FTP server. |
Sample (auto-generated)
CSK_FTPClient.sendData(data, filename)
sendImage()
Short description
Send image.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
img |
OBJECT |
1 |
Image to send |
filename |
STRING |
? |
Sample (auto-generated)
CSK_FTPClient.sendImage(img, filename)
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_FTPClient.sendParameters(noDataSave)
setAsyncMode()
Short description
Set if async FTP sending should be used.
If TRUE it will send the content in its own thread, but other apps can further run in parallel.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
status |
BOOL |
1 |
Status |
Sample (auto-generated)
CSK_FTPClient.setAsyncMode(status)
setAutoFilename()
Short description
Function to set status if filename of received data (via registered events) to put to FTP server should be generated by timestamp.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
status |
BOOL |
1 |
Status |
Sample (auto-generated)
CSK_FTPClient.setAutoFilename(status)
setDataType()
Short description
Function to preconfigure type of data which is received via event to store on FTP server.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
dataType |
STRING |
1 |
Type of data. |
Sample (auto-generated)
CSK_FTPClient.setDataType(dataType)
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_FTPClient.setFlowConfigPriority(status)
setFTPPort()
Short description
Set FTP port.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
port |
INT |
1 |
Port |
Sample (auto-generated)
CSK_FTPClient.setFTPPort(port)
setFTPServerIP()
Short description
Set FTP srever IP.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
ip |
STRING |
1 |
IP of FTP server. |
Sample (auto-generated)
CSK_FTPClient.setFTPServerIP(ip)
setImageName()
Short description
Set a image name to send the image with a known name to FTP Server.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
imageName |
STRING |
1 |
Image name |
Sample (auto-generated)
CSK_FTPClient.setImageName(imageName)
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_FTPClient.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_FTPClient.setParameterName(name)
setPassiveMode()
Short description
Set if passive FTP connection should be used.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
status |
BOOL |
1 |
Status |
Sample (auto-generated)
CSK_FTPClient.setPassiveMode(status)
setPassword()
Short description
Set FTP connection password.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
password |
STRING |
1 |
Password |
Sample (auto-generated)
CSK_FTPClient.setPassword(password)
setRegistereEventName()
Short description
Function to preset event name to register to receive content to save on FTP server.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
name |
STRING |
1 |
Event name. |
Sample (auto-generated)
CSK_FTPClient.setRegistereEventName(name)
setUITableSelection()
Short description
Function to set selection via UI table.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
selection |
STRING |
1 |
Selection content. |
Sample (auto-generated)
CSK_FTPClient.setUITableSelection(selection)
setUsername()
Short description
Set FTP connection user.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
user |
STRING |
1 |
Username |
Sample (auto-generated)
CSK_FTPClient.setUsername(user)
setVerboseMode()
Short description
Function to configure verbose mode of FTP connection.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
status |
BOOL |
1 |
Status |
Sample (auto-generated)
CSK_FTPClient.setVerboseMode(status)
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_FTPClient.OnDataLoadedOnReboot", "handleOnDataLoadedOnReboot")
OnNewIPCheck
Short description
Notify if string has valid IP format (used for UI).
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
status |
BOOL |
1 |
Status |
Sample (auto-generated)
function handleOnNewIPCheck(status)
-- Do something
end
Script.register("CSK_FTPClient.OnNewIPCheck", "handleOnNewIPCheck")
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_FTPClient.OnNewParameterName", "handleOnNewParameterName")
OnNewPassiveModeStatus
Short description
Notify passive mode status.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
status |
BOOL |
1 |
Status |
Sample (auto-generated)
function handleOnNewPassiveModeStatus(status)
-- Do something
end
Script.register("CSK_FTPClient.OnNewPassiveModeStatus", "handleOnNewPassiveModeStatus")
OnNewPassword
Short description
Notify password.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
password |
STRING |
1 |
Password |
Sample (auto-generated)
function handleOnNewPassword(password)
-- Do something
end
Script.register("CSK_FTPClient.OnNewPassword", "handleOnNewPassword")
OnNewPort
Short description
Notify FTP connection port.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
port |
INT |
1 |
Port |
Sample (auto-generated)
function handleOnNewPort(port)
-- Do something
end
Script.register("CSK_FTPClient.OnNewPort", "handleOnNewPort")
OnNewServerIP
Short description
Notify FTP server IP.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
serverIP |
STRING |
1 |
IP of FTP server. |
Sample (auto-generated)
function handleOnNewServerIP(serverIP)
-- Do something
end
Script.register("CSK_FTPClient.OnNewServerIP", "handleOnNewServerIP")
OnNewStatusAsyncMode
Short description
Notify if asynchronous FTP transfer is used.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
status |
BOOL |
1 |
Status |
Sample (auto-generated)
function handleOnNewStatusAsyncMode(status)
-- Do something
end
Script.register("CSK_FTPClient.OnNewStatusAsyncMode", "handleOnNewStatusAsyncMode")
OnNewStatusAutoFilename
Short description
Notify if filename should be generated by timestamp.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
status |
BOOL |
1 |
Status |
Sample (auto-generated)
function handleOnNewStatusAutoFilename(status)
-- Do something
end
Script.register("CSK_FTPClient.OnNewStatusAutoFilename", "handleOnNewStatusAutoFilename")
OnNewStatusConnected
Short description
Notify FTP connection status.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
status |
BOOL |
1 |
Status |
Sample (auto-generated)
function handleOnNewStatusConnected(status)
-- Do something
end
Script.register("CSK_FTPClient.OnNewStatusConnected", "handleOnNewStatusConnected")
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_FTPClient.OnNewStatusCSKStyle", "handleOnNewStatusCSKStyle")
OnNewStatusDataType
Short description
Notify preset type of data for registered event.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
dataType |
STRING |
1 |
Type of data. |
Sample (auto-generated)
function handleOnNewStatusDataType(dataType)
-- Do something
end
Script.register("CSK_FTPClient.OnNewStatusDataType", "handleOnNewStatusDataType")
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_FTPClient.OnNewStatusFlowConfigPriority", "handleOnNewStatusFlowConfigPriority")
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_FTPClient.OnNewStatusLoadParameterOnReboot", "handleOnNewStatusLoadParameterOnReboot")
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_FTPClient.OnNewStatusModuleIsActive", "handleOnNewStatusModuleIsActive")
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_FTPClient.OnNewStatusModuleVersion", "handleOnNewStatusModuleVersion")
OnNewStatusRegisteredEventName
Short description
Notify preset name of event to register for incoming data.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
eventName |
STRING |
1 |
Name of event. |
Sample (auto-generated)
function handleOnNewStatusRegisteredEventName(eventName)
-- Do something
end
Script.register("CSK_FTPClient.OnNewStatusRegisteredEventName", "handleOnNewStatusRegisteredEventName")
OnNewStatusRegistrationList
Short description
Notify JSON list of registered events incl. related type of data.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
list |
STRING |
1 |
List of content. |
Sample (auto-generated)
function handleOnNewStatusRegistrationList(list)
-- Do something
end
Script.register("CSK_FTPClient.OnNewStatusRegistrationList", "handleOnNewStatusRegistrationList")
OnNewStatusVerboseMode
Short description
Notify if FTP connection is running in verbose mode.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
status |
BOOL |
1 |
Status |
Sample (auto-generated)
function handleOnNewStatusVerboseMode(status)
-- Do something
end
Script.register("CSK_FTPClient.OnNewStatusVerboseMode", "handleOnNewStatusVerboseMode")
OnNewUsername
Short description
Notify FTP username.
Callback arguments
Name | Type | Multiplicity | Description |
---|---|---|---|
username |
STRING |
1 |
Username |
Sample (auto-generated)
function handleOnNewUsername(username)
-- Do something
end
Script.register("CSK_FTPClient.OnNewUsername", "handleOnNewUsername")
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_FTPClient.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_FTPClient.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_FTPClient.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_FTPClient.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_FTPClient.OnUserLevelServiceActive", "handleOnUserLevelServiceActive")
CSK_Module_FTPClient
Short description
This is an automatically generated CROWN (description not necessary).
Overview
FTPClient_FC
Short description
Crown to provide CSK_FlowConfig relevant features.
Overview
FTPClient_FC.Put
Short description
Set source of incoming data to put to FTP server.
Functions
create()
Short description
Internally used CSK_FlowConfig create function.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
dataType1 |
? |
Data type of data1 ('DATA' per default). 'DATA' = Store STRING data as .dat file 'JPG' = Store data as JPG image file. |
|
dataType2 |
? |
Data type of data2 ('DATA' per default). 'DATA' = Store STRING data as .dat file 'JPG' = Store data as JPG image file. |
|
dataType3 |
? |
Data type of data3 ('DATA' per default). 'DATA' = Store STRING data as .dat file 'JPG' = Store data as JPG image file. |
|
dataType4 |
? |
Data type of data4 ('DATA' per default). 'DATA' = Store STRING data as .dat file 'JPG' = Store data as JPG image file. |
|
autoName1 |
BOOL |
? |
Status if filename should be generated by date/time or is provided via source of data1 (TRUE per default). |
autoName2 |
BOOL |
? |
Status if filename should be generated by date/time or is provided via source of data2 (TRUE per default). |
autoName3 |
BOOL |
? |
Status if filename should be generated by date/time or is provided via source of data3 (TRUE per default). |
autoName4 |
BOOL |
? |
Status if filename should be generated by date/time or is provided via source of data4 (TRUE per default). |
Return values
Name | Type | Multiplicity | Description |
---|---|---|---|
handle |
HANDLE |
1 |
Handle to internally used FlowConfig instance. |
Sample (auto-generated)
handle = FTPClient_FC.Put.create(dataType1, dataType2, dataType3, dataType4, autoName1, autoName2, autoName3, autoName4)
put()
Short description
Set source of incoming data to put to FTP server.
Parameters
Name | Type | Multiplicity | Description |
---|---|---|---|
handle |
HANDLE |
1 |
Handle to internally used FlowConfig instance. |
data1 |
STRING |
? |
Source of data to put to FTP server. Parameter: 1: Data (STRING or IMAGE) 2: Optional name to store data (STRING) |
data2 |
STRING |
? |
Source of data to put to FTP server. Parameter: 1: Data (STRING or IMAGE) 2: Optional name to store data (STRING) |
data3 |
STRING |
? |
Source of data to put to FTP server. Parameter: 1: Data (STRING or IMAGE) 2: Optional name to store data (STRING) |
data4 |
STRING |
? |
Source of data to put to FTP server. Parameter: 1: Data (STRING or IMAGE) 2: Optional name to store data (STRING) |
Sample (auto-generated)
FTPClient_FC.Put.put(handle, data1, data2, data3, data4)
Enumerations
CSK_FTPClient.DataType
Type of data to save on FTP server.
Value | Name | Description |
---|---|---|
DATA |
DATA |
Store STRING data as .dat file |
JPG |
JPG |
Store data as JPG image file. |