Skip to content

Commit e2919b5

Browse files
Release 3.1.0 (#7)
# Release 3.1.0 ## New features - OnNewRawReadMessage_INSTANCE_PORT_MESSAGENAME provides timestamp as 2nd event parameter (used for FlowConfig) ## Improvements - Minor docu improvements - Minor update of readMessageName check ## Bugfix - DeviceID was shown as ProductID in UI - 'OnNewDataAuto' FlowConfig block did not work with initial load of persistent data - Legacy bindings of ValueDisplay elements and FileUpload feature within UI did not work if deployed with VS Code AppSpace SDK - UI differs if deployed via Appstudio or VS Code AppSpace SDK - Fullscreen icon of iFrame was visible
1 parent 90df4a6 commit e2919b5

12 files changed

Lines changed: 206 additions & 123 deletions

File tree

CHANGELOG.md

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

4+
## Release 3.1.0
5+
6+
### New features
7+
- OnNewRawReadMessage_INSTANCE_PORT_MESSAGENAME provides timestamp as 2nd event parameter (used for FlowConfig)
8+
9+
### Improvements
10+
- Minor docu improvements
11+
- Minor update of readMessageName check
12+
13+
### Bugfix
14+
- DeviceID was shown as ProductID in UI
15+
- 'OnNewDataAuto' FlowConfig block did not work with initial load of persistent data
16+
- Legacy bindings of ValueDisplay elements and FileUpload feature within UI did not work if deployed with VS Code AppSpace SDK
17+
- UI differs if deployed via Appstudio or VS Code AppSpace SDK
18+
- Fullscreen icon of iFrame was visible
19+
420
## Release 3.0.1
521

622
### Bugfix

CSK_Module_MultiIOLinkSMI/pages/pages/CSK_Module_MultiIOLinkSMI/CSK_Module_MultiIOLinkSMI.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,5 +100,5 @@
100100

101101
.myCustomButton_CSK_Module_MultiIOLinkSMI {
102102
border-radius: 30px;
103-
padding-right: 0px;
103+
padding: 11px;
104104
}

CSK_Module_MultiIOLinkSMI/pages/pages/CSK_Module_MultiIOLinkSMI/CSK_Module_MultiIOLinkSMI.html

Lines changed: 104 additions & 74 deletions
Large diffs are not rendered by default.

CSK_Module_MultiIOLinkSMI/pages/src/converter.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ export function extractFilenames(files: FileList): Array<string> {
1616
export function changeStyle(theme) {
1717
const style: HTMLStyleElement = document.createElement('style');
1818
style.id ='blub'
19+
20+
const toggleSW = document.querySelectorAll("davinci-toggle-switch")
21+
toggleSW.forEach((userItem) => {
22+
const shadowToggle = userItem.shadowRoot
23+
const finalToggleSW = shadowToggle?.querySelector('div')
24+
finalToggleSW?.classList.add('hasIcon')
25+
});
26+
1927
if (theme == 'CSK_Style'){
2028
var headerToolbar = `.sopasjs-ui-header-toolbar-wrapper { background-color: #FFFFFF; }`
2129
var uiHeader = `.sopasjs-ui-header>.app-logo { margin-right:0px; }`

CSK_Module_MultiIOLinkSMI/pages/src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ document.addEventListener('sopasjs-ready', () => {
1212
page_Setup.remove();
1313

1414
setTimeout(() => {
15+
const element = document.querySelector("div.sjs-wrapper > div > div.sjs-fullscreen-toggle")
16+
if(element) {
17+
element.parentElement.removeChild(element)
18+
}
1519
document.title = 'CSK_Module_MultiIOLinkSMI'
1620
}, 500);
1721
})

CSK_Module_MultiIOLinkSMI/project.mf.xml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,7 @@ INFO: Other modules can check via "Script.isServedAsEvent" if event exists.</des
499499
INSTANCE and PORT will be replaced by the instanceIdentifier and sensor port the device is connected to (S1,S2 ...) and MESSAGENAME by the configured name of the message (e.g. "OnNewRawReadMessage_1_S1_MyMessage"). +
500500
INFO: Other modules can check via "Script.isServedAsEvent" if event exists.</desc>
501501
<param desc="Manually unpacked part of process data (no IODD Interpreter used)." multiplicity="?" name="data" type="auto"/>
502+
<param desc="Timestamp" multiplicity="1" name="timestamp" type="int"/>
502503
</event>
503504
<event name="OnNewWriteMessageEventName">
504505
<trait>released</trait>
@@ -1149,13 +1150,13 @@ Provide IO-Link data of created readMessages.</desc>
11491150

11501151
Provide IO-Link data of created readMessages.</desc>
11511152
<param desc="Handle to internally used FlowConfig instance." multiplicity="1" name="handle" type="handle"/>
1152-
<param desc="'CSK_MultiIOLinkSMI.OnNewRawReadMessage_[PORT]_[READMESSAGENAME]'&#10;&#10;Parameter:&#10;1: Data (auto)" multiplicity="1" name="OnNewData" type="string"/>
1153+
<param desc="'CSK_MultiIOLinkSMI.OnNewRawReadMessage_[INSTANCE]_[PORT]_[READMESSAGENAME]'&#10;&#10;Parameter:&#10;1: Data (auto)&#10;2: Timestamp (INT)" multiplicity="1" name="OnNewData" type="string"/>
11531154
</event>
11541155
<function name="create">
11551156
<trait>released</trait>
11561157
<desc>Internally used CSK_FlowConfig create function.</desc>
11571158
<param desc="IO-Link port." multiplicity="1" name="Port" ref="MultiIOLinkSMI_FC.IOLinkMasterPorts" type="enum"/>
1158-
<param desc="Name of read message to receive data.&#10;IMPORTANT: Please make sure that related readMessage already exists." multiplicity="1" name="ReadMessageName" type="string"/>
1159+
<param desc="Name of read message (e.g. 'Distance') to receive data.&#10;IMPORTANT: Please make sure that related readMessage already exists." multiplicity="1" name="ReadMessageName" type="string"/>
11591160
<return desc="Handle to internally used FlowConfig instance." multiplicity="1" name="handle" type="handle"/>
11601161
</function>
11611162
<function name="register">
@@ -1184,7 +1185,7 @@ Might get in conflict with parallel done configurations!
11841185

11851186
Provide IO-Link data.</desc>
11861187
<param desc="Handle to internally used FlowConfig instance." multiplicity="1" name="handle" type="handle"/>
1187-
<param desc="'CSK_MultiIOLinkSMI.OnNewRawReadMessage_[PORT]_[READMESSAGENAME]'&#10;&#10;Parameter:&#10;1: Data (auto)" multiplicity="1" name="OnNewData" type="string"/>
1188+
<param desc="'CSK_MultiIOLinkSMI.OnNewRawReadMessage_[INSTANCE]_[PORT]_[READMESSAGENAME]'&#10;&#10;Parameter:&#10;1: Data (AUTO)&#10;2: Timestamp (INT)" multiplicity="1" name="OnNewData" type="string"/>
11881189
</event>
11891190
<function name="create">
11901191
<trait>released</trait>
@@ -1231,7 +1232,7 @@ Set source event of incoming data to use for writeMessage.</desc>
12311232
</crown>
12321233
</crown>
12331234
<meta key="author">SICK AG</meta>
1234-
<meta key="version">3.0.1</meta>
1235+
<meta key="version">3.1.0</meta>
12351236
<meta key="priority">low</meta>
12361237
<meta key="copy-protected">false</meta>
12371238
<meta key="read-protected">false</meta>

CSK_Module_MultiIOLinkSMI/scripts/CSK_MultiIOLinkSMI_Processing.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -654,14 +654,14 @@ local function updateIODDReadMessages()
654654
end
655655
end
656656
Script.notifyEvent(localEventName, success, queueSize, timestamp2-timestamp1, messageContent, errorMessage)
657-
Script.notifyEvent(localEventName2, messageContent)
657+
Script.notifyEvent(localEventName2, messageContent, timestamp1)
658658
end
659659

660660
if not Script.isServedAsEvent(crownEventName) then
661661
Script.serveEvent(crownEventName, localEventName, 'bool:1:,int:1:,int:1:,string:?:,string:?:')
662662
end
663663
if not Script.isServedAsEvent(crownEventName2) then
664-
Script.serveEvent(crownEventName2, localEventName2, 'auto:1:')
664+
Script.serveEvent(crownEventName2, localEventName2, 'auto:1:,int:1')
665665
end
666666
if messageInfo.triggerType == "Periodic" then
667667
ioddReadMessagesTimers[messageName] = Timer.create()

CSK_Module_MultiIOLinkSMI/scripts/Communication/MultiIOLinkSMI/FlowConfig/MultiIOLinkSMI_OnNewDataAuto.lua

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ local function handleIOLinkSetup()
5454
end
5555

5656
for key, value in ipairs(portInfos) do
57+
value.portActive = false
5758
local instanceAmount = CSK_MultiIOLinkSMI.getInstancesAmount()
5859
if instanceAmount < key then
5960
CSK_MultiIOLinkSMI.addInstance()
@@ -83,14 +84,14 @@ local function handleOnNewIOLinkPortStatus(instance, status, port)
8384

8485
-- Add readMessages
8586
for subKey, subValue in ipairs(value.messageInfos.names) do
86-
CSK_MultiIOLinkSMI.setIODDReadMessageName(subValue)
87-
CSK_MultiIOLinkSMI.setReadMessageMode('NO_IODD')
88-
CSK_MultiIOLinkSMI.createIODDReadMessage()
89-
CSK_MultiIOLinkSMI.setTriggerType('Periodic')
90-
CSK_MultiIOLinkSMI.setTriggerValue(value.messageInfos.cycleTimes[subKey])
91-
CSK_MultiIOLinkSMI.setReadMessageProcessDataStartByte(value.messageInfos.startBytes[subKey])
92-
CSK_MultiIOLinkSMI.setReadMessageProcessDataEndByte(value.messageInfos.endBytes[subKey])
93-
CSK_MultiIOLinkSMI.setReadMessageProcessDataUnpackFormat(value.messageInfos.unpackFormats[subKey])
87+
CSK_MultiIOLinkSMI.setIODDReadMessageName(subValue)
88+
CSK_MultiIOLinkSMI.setReadMessageMode('NO_IODD')
89+
CSK_MultiIOLinkSMI.createIODDReadMessage()
90+
CSK_MultiIOLinkSMI.setTriggerType('Periodic')
91+
CSK_MultiIOLinkSMI.setTriggerValue(value.messageInfos.cycleTimes[subKey])
92+
CSK_MultiIOLinkSMI.setReadMessageProcessDataStartByte(value.messageInfos.startBytes[subKey])
93+
CSK_MultiIOLinkSMI.setReadMessageProcessDataEndByte(value.messageInfos.endBytes[subKey])
94+
CSK_MultiIOLinkSMI.setReadMessageProcessDataUnpackFormat(value.messageInfos.unpackFormats[subKey])
9495
end
9596
end
9697
end

CSK_Module_MultiIOLinkSMI/scripts/Communication/MultiIOLinkSMI/MultiIOLinkSMI_Controller.lua

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,8 @@ local function handleOnExpiredTmrMultiIOLinkSMI()
343343
Script.notifyEvent('MultiIOLinkSMI_OnNewVendorId', deviceInfo.vendorId)
344344
Script.notifyEvent('MultiIOLinkSMI_OnNewVendorName', deviceInfo.vendorName)
345345
Script.notifyEvent('MultiIOLinkSMI_OnNewVendorText', deviceInfo.vendorText)
346-
Script.notifyEvent('MultiIOLinkSMI_OnNewProductId', deviceInfo.deviceId)
346+
Script.notifyEvent('MultiIOLinkSMI_OnNewProductId', deviceInfo.productID)
347+
Script.notifyEvent('MultiIOLinkSMI_OnNewDeviceId', deviceInfo.deviceId)
347348
Script.notifyEvent('MultiIOLinkSMI_OnNewProductName', deviceInfo.productName)
348349
Script.notifyEvent('MultiIOLinkSMI_OnNewProductText', deviceInfo.productText)
349350
else
@@ -354,6 +355,7 @@ local function handleOnExpiredTmrMultiIOLinkSMI()
354355
Script.notifyEvent('MultiIOLinkSMI_OnNewVendorName', "")
355356
Script.notifyEvent('MultiIOLinkSMI_OnNewVendorText', "")
356357
Script.notifyEvent('MultiIOLinkSMI_OnNewProductId', "")
358+
Script.notifyEvent('MultiIOLinkSMI_OnNewDeviceId', "")
357359
Script.notifyEvent('MultiIOLinkSMI_OnNewProductName', "")
358360
Script.notifyEvent('MultiIOLinkSMI_OnNewProductText', "")
359361
end
@@ -366,7 +368,8 @@ local function handleOnExpiredTmrMultiIOLinkSMI()
366368
Script.notifyEvent('MultiIOLinkSMI_OnNewNewDeviceVendorId', deviceInfo.vendorId)
367369
Script.notifyEvent('MultiIOLinkSMI_OnNewNewDeviceVendorName', deviceInfo.vendorName)
368370
Script.notifyEvent('MultiIOLinkSMI_OnNewNewDeviceVendorText', deviceInfo.vendorText)
369-
Script.notifyEvent('MultiIOLinkSMI_OnNewNewDeviceProductId', deviceInfo.deviceId)
371+
Script.notifyEvent('MultiIOLinkSMI_OnNewNewDeviceProductId', deviceInfo.productID)
372+
Script.notifyEvent('MultiIOLinkSMI_OnNewNewDeviceDeviceId', deviceInfo.deviceId)
370373
Script.notifyEvent('MultiIOLinkSMI_OnNewNewDeviceProductName', deviceInfo.productName)
371374
Script.notifyEvent('MultiIOLinkSMI_OnNewNewDeviceProductText', deviceInfo.productText)
372375
end
@@ -877,35 +880,40 @@ end
877880
Script.serveFunction('CSK_MultiIOLinkSMI.setSelectedIODDReadMessage', setSelectedIODDReadMessage)
878881

879882
local function createIODDReadMessage()
880-
if newReadMessageName ~= '' and multiIOLinkSMI_Instances[selectedInstance].parameters.ioddReadMessages[newReadMessageName] == nil then
881-
if multiIOLinkSMI_Instances[selectedInstance].readMessageMode == 'NO_IODD' then
882-
multiIOLinkSMI_Instances[selectedInstance]:createIODDReadMessage(newReadMessageName, true)
883-
setSelectedIODDReadMessage(newReadMessageName)
884-
Script.notifyEvent('MultiIOLinkSMI_OnNewProcessingParameter', selectedInstance, 'readMessages', json.encode(multiIOLinkSMI_Instances[selectedInstance].parameters.ioddReadMessages))
885-
else
886-
if not multiIOLinkSMI_Instances[selectedInstance].parameters.ioddInfo then
887-
_G.logger:info(nameOfModule .. ": No IODD info to create readMessage")
888-
return
883+
if newReadMessageName ~= '' then
884+
if multiIOLinkSMI_Instances[selectedInstance].parameters.ioddReadMessages[newReadMessageName] == nil then
885+
if multiIOLinkSMI_Instances[selectedInstance].readMessageMode == 'NO_IODD' then
886+
multiIOLinkSMI_Instances[selectedInstance]:createIODDReadMessage(newReadMessageName, true)
887+
setSelectedIODDReadMessage(newReadMessageName)
888+
Script.notifyEvent('MultiIOLinkSMI_OnNewProcessingParameter', selectedInstance, 'readMessages', json.encode(multiIOLinkSMI_Instances[selectedInstance].parameters.ioddReadMessages))
889889
else
890-
if CSK_IODDInterpreter then
891-
multiIOLinkSMI_Instances[selectedInstance]:createIODDReadMessage(newReadMessageName)
892-
setSelectedIODDReadMessage(newReadMessageName)
890+
if not multiIOLinkSMI_Instances[selectedInstance].parameters.ioddInfo then
891+
_G.logger:info(nameOfModule .. ": No IODD info to create readMessage")
892+
return
893893
else
894-
_G.logger:info(nameOfModule .. ": CSK_IODDInterpreter not available.")
894+
if CSK_IODDInterpreter then
895+
multiIOLinkSMI_Instances[selectedInstance]:createIODDReadMessage(newReadMessageName)
896+
setSelectedIODDReadMessage(newReadMessageName)
897+
else
898+
_G.logger:info(nameOfModule .. ": CSK_IODDInterpreter not available.")
899+
end
895900
end
896901
end
902+
else
903+
setSelectedIODDReadMessage(newReadMessageName)
904+
_G.logger:info(nameOfModule .. ": ReadMessage already exists.")
905+
handleOnExpiredTmrMultiIOLinkSMI()
897906
end
898907
else
899-
_G.logger:info(nameOfModule .. ": No name for readMessage")
908+
_G.logger:info(nameOfModule .. ": No name for readMessage.")
900909
end
901910
end
902911
Script.serveFunction('CSK_MultiIOLinkSMI.createIODDReadMessage', createIODDReadMessage)
903912

904913
local function setIODDReadMessageName(newName)
914+
newReadMessageName = newName
905915
if multiIOLinkSMI_Instances[selectedInstance].parameters.ioddReadMessages[newName] then
906916
handleOnExpiredTmrMultiIOLinkSMI()
907-
else
908-
newReadMessageName = newName
909917
end
910918
end
911919
Script.serveFunction('CSK_MultiIOLinkSMI.setIODDReadMessageName', setIODDReadMessageName)

CSK_Module_MultiIOLinkSMI/scripts/Communication/MultiIOLinkSMI/MultiIOLinkSMI_Model.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ function multiIOLinkSMI.getDeviceIdentification(port)
7373
vendorText = '',
7474
deviceId = '',
7575
productName = '',
76+
productID = '',
7677
productText = '',
7778
statusInfo = ''
7879
}
@@ -93,6 +94,10 @@ function multiIOLinkSMI.getDeviceIdentification(port)
9394
if productName then
9495
deviceInfo.productName = converter.toDataType(productName, 'StringT')
9596
end
97+
local productID = multiIOLinkSMI.IOLinkSMIhandle:deviceRead(port, 19, 0)
98+
if productID then
99+
deviceInfo.productID = converter.toDataType(productID, 'StringT')
100+
end
96101
local productText = multiIOLinkSMI.IOLinkSMIhandle:deviceRead(port, 20, 0)
97102
if productText then
98103
deviceInfo.productText = converter.toDataType(productText, 'StringT')

0 commit comments

Comments
 (0)