AnsweredAssumed Answered

UFL: how to kill an interface from within ini code

Question asked by ManuDB on Nov 6, 2017
Latest reply on Nov 17, 2017 by cramsey

We are processing long comma separated text files of logging values with a UFL interface. Simplified example:

2017/11/06 15:09:23.428 PLC, A1, 0.00, 1, 1,0,0,      0.0,  8.45, 0.0,-1.09, -3.01, -1.67

 

When new logging values are desired, this string is edited to add them to the end, so it could become:

2017/11/06 15:09:23.428 PLC, A1, 0.00, 1, 1,0,0,      0.0,  8.45, 0.0,-1.09, -3.01, -1.67, 12345

 

Even with the best cooperation, there will always be a moment where the string and the ini file do not match anymore. At the EMEA UC I briefly discussed this with the geeks and Martin Freitag without getting back to them (let's say I was distracted by all the talks and sessions ). Two solutions came to mind:

  • Using a version number in the file name, also prone to human error as it has to be changed during reconfiguration of the string.
  • A check that looks how long the string is and leaves the files alone if they do not match.

I believe the latter is not possible as files that are processed by the interface cannot just be put back as the interface found them, so I think the most interesting solution would be to make the interface stop when the files are not as expected anymore (no point to continue running anyway). To accomplish this, a check would detect if the lines match a certain pattern, and when a number of consecutive lines in a file do not match anymore, the interface stops processing files and we detect the change by noticing the interface went down.

 

IF (input not as expected for a while) THEN

     kill this UFL service instance

ENDIF

 

My question is, can I stop the interface from within the code?

I did not spot a command in the UFL manual that can be used to shut down the interface, and trying to crash the interface also does not work as the parsing during initialisation already crashes the interface on the bit of bad code in an IF statement that would be used to cause a crash. Any suggestions?

Outcomes