Skip to content

Commit 8fb0767

Browse files
Release 3.3.0 (#9)
# Version 3.3.0 ## Improvements - Show result of pattern search within the IO-Link payload on UI - Show status info of IODD Interpreter on UI
1 parent e284fbe commit 8fb0767

6 files changed

Lines changed: 384 additions & 135 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# Changelog
22
All notable changes to this project will be documented in this file.
33

4+
## Release 3.3.0
5+
6+
### Improvements
7+
- Show result of pattern search within the IO-Link payload on UI
8+
- Show status info of IODD Interpreter on UI
9+
410
## Release 3.2.0
511

612
### New features

CSK_Module_MultiIOLinkSMI/pages/pages/CSK_Module_MultiIOLinkSMI/CSK_Module_MultiIOLinkSMI.html

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,30 @@ <h6 id="H61_SavedDeviceIdentification">
433433
</crown-set>
434434
</appspace-file-upload-button>
435435
</layout-row>
436+
<layout-row id="RowLayout92"
437+
style="align-items: center">
438+
<layout-column id="ColumnLayout93"
439+
style="align-items: stretch">
440+
<davinci-value-display
441+
id="VD_IODDInterpreterInfo"
442+
label="IODD Interpreter Info">
443+
<crown-on property="value"
444+
crown-event="CSK_MultiIOLinkSMI/OnNewStatusShowIODDInterpreterInfo">
445+
</crown-on>
446+
</davinci-value-display>
447+
</layout-column>
448+
<layout-column id="ColumnLayout94"
449+
style="align-items: stretch">
450+
<davinci-drop-down
451+
id="DD_AvailableIODDs"
452+
label="Available IODDs">
453+
<crown-on property="data"
454+
crown-event="CSK_MultiIOLinkSMI/OnNewStatusListIODD"
455+
converter="convertToList">
456+
</crown-on>
457+
</davinci-drop-down>
458+
</layout-column>
459+
</layout-row>
436460
</layout-column>
437461
</layout-row>
438462
</stacked-pane>
@@ -1157,6 +1181,13 @@ <h6 id="H61_SavedDeviceIdentification">
11571181
crown-event="CSK_MultiIOLinkSMI/OnNewStatusProcessDataTestResult">
11581182
</crown-on>
11591183
</davinci-value-display>
1184+
<davinci-value-display
1185+
id="VD_ProcessDataFinalTest">
1186+
<crown-on
1187+
property="value"
1188+
crown-event="CSK_MultiIOLinkSMI/OnNewStatusProcessDataFinalTestResult">
1189+
</crown-on>
1190+
</davinci-value-display>
11601191
</layout-column>
11611192
<layout-column
11621193
id="ColumnLayout87"

CSK_Module_MultiIOLinkSMI/project.mf.xml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,18 @@ INFO: Other modules can check via "Script.isServedAsEvent" if event exists.</des
514514
<desc>Notify amount of extra bytes to add to byte length of process data output.</desc>
515515
<param desc="Amount of extra bytes." multiplicity="1" name="extraBytes" type="int"/>
516516
</event>
517+
<event name="OnNewStatusShowIODDInterpreterInfo">
518+
<desc>Notify info regarding IODD Interpreter.</desc>
519+
<param desc="Status" multiplicity="1" name="status" type="string"/>
520+
</event>
521+
<event name="OnNewStatusListIODD">
522+
<desc>Notify list of available IODDs.</desc>
523+
<param desc="List of available IODDs." multiplicity="1" name="list" type="string"/>
524+
</event>
525+
<event name="OnNewStatusProcessDataFinalTestResult">
526+
<desc>Notfiy payload after searched and cut relevant part within payload.</desc>
527+
<param desc="Final payload." multiplicity="1" name="payload" type="string"/>
528+
</event>
517529
<function name="setParameterName">
518530
<desc>Function to set the name of the parameters if saved/loaded via the CSK_PersistentData module.</desc>
519531
<param desc="Name of the parameter" multiplicity="1" name="name" type="string"/>
@@ -1240,7 +1252,7 @@ Set source event of incoming data to use for writeMessage.</desc>
12401252
</crown>
12411253
</crown>
12421254
<meta key="author">SICK AG</meta>
1243-
<meta key="version">3.2.0</meta>
1255+
<meta key="version">3.3.0</meta>
12441256
<meta key="priority">low</meta>
12451257
<meta key="copy-protected">false</meta>
12461258
<meta key="read-protected">false</meta>

CSK_Module_MultiIOLinkSMI/scripts/Communication/MultiIOLinkSMI/MultiIOLinkSMI_Controller.lua

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ Script.serveEvent('CSK_MultiIOLinkSMI.OnNewStatusModuleVersion', 'M
8787
Script.serveEvent('CSK_MultiIOLinkSMI.OnNewStatusCSKStyle', 'MultiIOLinkSMI_OnNewStatusCSKStyle')
8888
Script.serveEvent('CSK_MultiIOLinkSMI.OnNewStatusModuleIsActive', 'MultiIOLinkSMI_OnNewStatusModuleIsActive')
8989

90+
Script.serveEvent('CSK_MultiIOLinkSMI.OnNewStatusShowIODDInterpreterInfo', 'MultiIOLinkSMI_OnNewStatusShowIODDInterpreterInfo')
91+
Script.serveEvent('CSK_MultiIOLinkSMI.OnNewStatusListIODD', 'MultiIOLinkSMI_OnNewStatusListIODD')
92+
9093
Script.serveEvent('CSK_MultiIOLinkSMI.OnNewSelectedTab', 'MultiIOLinkSMI_OnNewSelectedTab')
9194

9295
Script.serveEvent('CSK_MultiIOLinkSMI.OnNewDeviceIdentificationApplied', 'MultiIOLinkSMI_OnNewDeviceIdentificationApplied')
@@ -138,7 +141,8 @@ Script.serveEvent('CSK_MultiIOLinkSMI.OnNewStatusReadMessageProcessDataStartByte
138141
Script.serveEvent('CSK_MultiIOLinkSMI.OnNewStatusReadMessageProcessDataEndByte', 'MultiIOLinkSMI_OnNewStatusReadMessageProcessDataEndByte')
139142
Script.serveEvent('CSK_MultiIOLinkSMI.OnNewStatusReadMessageProcessDataUnpackFormat', 'MultiIOLinkSMI_OnNewStatusReadMessageProcessDataUnpackFormat')
140143
Script.serveEvent('CSK_MultiIOLinkSMI.OnNewStatusUnpackDataTestResult', 'MultiIOLinkSMI_OnNewStatusUnpackDataTestResult')
141-
Script.serveEvent('CSK_MultiIOLinkSMI.OnNewStatusProcessDataTestResult', 'MultiIOLinkSMI_OnNewStatusProcessDataTestResult')
144+
Script.serveEvent('CSK_MultiIOLinkSMI.OnNewStatusProcessDataTestResult', 'MultiIOLinkSMI_OnNewStatusProcessDataTestResult')
145+
Script.serveEvent('CSK_MultiIOLinkSMI.OnNewStatusProcessDataFinalTestResult', 'MultiIOLinkSMI_OnNewStatusProcessDataFinalTestResult')
142146

143147
Script.serveEvent('CSK_MultiIOLinkSMI.OnNewSelectedIODDReadMessage', 'MultiIOLinkSMI_OnNewSelectedIODDReadMessage')
144148
Script.serveEvent('CSK_MultiIOLinkSMI.OnNewTriggerType', 'MultiIOLinkSMI_OnNewTriggerType')
@@ -360,7 +364,9 @@ local function handleOnExpiredTmrMultiIOLinkSMI()
360364
Script.notifyEvent('MultiIOLinkSMI_OnNewProductName', "")
361365
Script.notifyEvent('MultiIOLinkSMI_OnNewProductText', "")
362366
end
367+
363368
Script.notifyEvent('MultiIOLinkSMI_OnNewStatusNewDeviceFound', (multiIOLinkSMI_Instances[selectedInstance].parameters.newDeviceIdentification ~= nil))
369+
364370
if multiIOLinkSMI_Instances[selectedInstance].parameters.newDeviceIdentification then
365371
local deviceInfo = multiIOLinkSMI_Instances[selectedInstance].parameters.newDeviceIdentification
366372
Script.notifyEvent('MultiIOLinkSMI_OnNewNewDeviceFirmwareVersion', deviceInfo.firmwareVersion)
@@ -374,8 +380,12 @@ local function handleOnExpiredTmrMultiIOLinkSMI()
374380
Script.notifyEvent('MultiIOLinkSMI_OnNewNewDeviceProductName', deviceInfo.productName)
375381
Script.notifyEvent('MultiIOLinkSMI_OnNewNewDeviceProductText', deviceInfo.productText)
376382
end
383+
377384
Script.notifyEvent('MultiIOLinkSMI_OnNewStatusCSKIODDInterpreterAvailable', (CSK_IODDInterpreter ~= nil))
378385
Script.notifyEvent('MultiIOLinkSMI_OnNewStatusIODDMatchFound', (multiIOLinkSMI_Instances[selectedInstance].parameters.ioddInfo ~= nil))
386+
if CSK_IODDInterpreter then
387+
CSK_IODDInterpreter.pageCalledInstances()
388+
end
379389

380390
if not multiIOLinkSMI_Instances[selectedInstance].parameters.ioddInfo then
381391
Script.notifyEvent('MultiIOLinkSMI_OnNewStatusProcessDataVariable', false)
@@ -398,6 +408,8 @@ local function handleOnExpiredTmrMultiIOLinkSMI()
398408

399409
Script.notifyEvent('MultiIOLinkSMI_OnNewStatusUnpackDataTestResult', '')
400410
Script.notifyEvent('MultiIOLinkSMI_OnNewStatusProcessDataTestResult', '')
411+
Script.notifyEvent('MultiIOLinkSMI_OnNewStatusProcessDataFinalTestResult', '')
412+
401413
Script.notifyEvent('MultiIOLinkSMI_OnNewStatusReadMessageMode', multiIOLinkSMI_Instances[selectedInstance].readMessageMode)
402414
Script.notifyEvent('MultiIOLinkSMI_OnNewListIODDReadMessages', json.encode(nameList))
403415
Script.notifyEvent('MultiIOLinkSMI_OnNewStatusIODDReadMessageSelected', selectedIODDReadMessage ~= '')
@@ -1066,6 +1078,27 @@ local function triggerProcessDataTestViaUI()
10661078
local _, readSuccess, data = Script.callFunction('CSK_MultiIOLinkSMI.readIODDMessage' .. tostring(selectedInstance), selectedIODDReadMessage)
10671079
if readSuccess then
10681080
Script.notifyEvent('MultiIOLinkSMI_OnNewStatusProcessDataTestResult', 'Payload = ' .. tostring(data))
1081+
1082+
if data and multiIOLinkSMI_Instances[selectedInstance].parameters.ioddReadMessages[selectedIODDReadMessage].searchBegin ~= '' then
1083+
local findString = string.find(data, multiIOLinkSMI_Instances[selectedInstance].parameters.ioddReadMessages[selectedIODDReadMessage].searchBegin, 0)
1084+
if findString then
1085+
if multiIOLinkSMI_Instances[selectedInstance].parameters.ioddReadMessages[selectedIODDReadMessage].searchEnd == '' then
1086+
data = string.sub(data, findString + #multiIOLinkSMI_Instances[selectedInstance].parameters.ioddReadMessages[selectedIODDReadMessage].searchBegin)
1087+
else
1088+
local findString2 = string.find(data, multiIOLinkSMI_Instances[selectedInstance].parameters.ioddReadMessages[selectedIODDReadMessage].searchEnd, findString + #multiIOLinkSMI_Instances[selectedInstance].parameters.ioddReadMessages[selectedIODDReadMessage].searchBegin)
1089+
if findString2 then
1090+
data = string.sub(data, findString + #multiIOLinkSMI_Instances[selectedInstance].parameters.ioddReadMessages[selectedIODDReadMessage].searchBegin, findString2 - 1)
1091+
else
1092+
data = 'NO_MATCH'
1093+
end
1094+
end
1095+
else
1096+
data = 'NO_MATCH'
1097+
end
1098+
Script.notifyEvent('MultiIOLinkSMI_OnNewStatusProcessDataFinalTestResult', 'Final payload = ' .. tostring(data))
1099+
else
1100+
Script.notifyEvent('MultiIOLinkSMI_OnNewStatusProcessDataFinalTestResult', '')
1101+
end
10691102
else
10701103
Script.notifyEvent('MultiIOLinkSMI_OnNewStatusProcessDataTestResult', 'Something went wrong...')
10711104
end
@@ -1241,6 +1274,16 @@ local function uploadFinishedCSKIODDInterpreter(uploadSuccess)
12411274
end
12421275
Script.serveFunction('CSK_MultiIOLinkSMI.uploadFinishedCSKIODDInterpreter', uploadFinishedCSKIODDInterpreter)
12431276

1277+
local function handleOnNewCalloutValue(Value)
1278+
Script.notifyEvent('MultiIOLinkSMI_OnNewStatusShowIODDInterpreterInfo', Value)
1279+
end
1280+
Script.register('CSK_IODDInterpreter.OnNewCalloutValue', handleOnNewCalloutValue)
1281+
1282+
local function handleOnNewListIODD(jsonIODDList)
1283+
Script.notifyEvent('MultiIOLinkSMI_OnNewStatusListIODD', jsonIODDList)
1284+
end
1285+
Script.register('CSK_IODDInterpreter.OnNewListIODD', handleOnNewListIODD)
1286+
12441287
local function processDataInRowSelectedCSKIODDInterpreter(rowData)
12451288
if CSK_IODDInterpreter then
12461289
local jsonTemplate, jsonDataInfo = CSK_IODDInterpreter.processDataInRowSelected(rowData, 'readIOLink_')

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ Tested on
6060

6161
|Device|Firmware version|Module version|
6262
|--|--|--|
63+
|SIM300|V1.1.0|V3.3.0|
6364
|SIM300|V1.1.0|V3.2.0|
6465
|SIM300|V0.2.1|V3.1.0|
6566
|SIM300|V0.2.1|V3.0.1|

0 commit comments

Comments
 (0)