@@ -87,6 +87,9 @@ Script.serveEvent('CSK_MultiIOLinkSMI.OnNewStatusModuleVersion', 'M
8787Script .serveEvent (' CSK_MultiIOLinkSMI.OnNewStatusCSKStyle' , ' MultiIOLinkSMI_OnNewStatusCSKStyle' )
8888Script .serveEvent (' CSK_MultiIOLinkSMI.OnNewStatusModuleIsActive' , ' MultiIOLinkSMI_OnNewStatusModuleIsActive' )
8989
90+ Script .serveEvent (' CSK_MultiIOLinkSMI.OnNewStatusShowIODDInterpreterInfo' , ' MultiIOLinkSMI_OnNewStatusShowIODDInterpreterInfo' )
91+ Script .serveEvent (' CSK_MultiIOLinkSMI.OnNewStatusListIODD' , ' MultiIOLinkSMI_OnNewStatusListIODD' )
92+
9093Script .serveEvent (' CSK_MultiIOLinkSMI.OnNewSelectedTab' , ' MultiIOLinkSMI_OnNewSelectedTab' )
9194
9295Script .serveEvent (' CSK_MultiIOLinkSMI.OnNewDeviceIdentificationApplied' , ' MultiIOLinkSMI_OnNewDeviceIdentificationApplied' )
@@ -138,7 +141,8 @@ Script.serveEvent('CSK_MultiIOLinkSMI.OnNewStatusReadMessageProcessDataStartByte
138141Script .serveEvent (' CSK_MultiIOLinkSMI.OnNewStatusReadMessageProcessDataEndByte' , ' MultiIOLinkSMI_OnNewStatusReadMessageProcessDataEndByte' )
139142Script .serveEvent (' CSK_MultiIOLinkSMI.OnNewStatusReadMessageProcessDataUnpackFormat' , ' MultiIOLinkSMI_OnNewStatusReadMessageProcessDataUnpackFormat' )
140143Script .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
143147Script .serveEvent (' CSK_MultiIOLinkSMI.OnNewSelectedIODDReadMessage' , ' MultiIOLinkSMI_OnNewSelectedIODDReadMessage' )
144148Script .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)
12411274end
12421275Script .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+
12441287local function processDataInRowSelectedCSKIODDInterpreter (rowData )
12451288 if CSK_IODDInterpreter then
12461289 local jsonTemplate , jsonDataInfo = CSK_IODDInterpreter .processDataInRowSelected (rowData , ' readIOLink_' )
0 commit comments