I'm working on a lua script to convert IO Link data into MQTT. When I debugged the script, I got following runtime error on the function client:register : Runtime error: attempt to call a table value (global 'string')
I understood that out of the 3 parameters needed, the eventname has to be in string. Coming from Java, I tried converting it directly in the function. It looks like this:
client:register( deviceHandle, string(IOhandleOnDisconnected) , IOhandleOnDisconnected )
It still does not work though. Does anybody have an idea how to fix this?
Greetings.
IOhandleOnDisconnected? provide more context or we cannot help you fix it - Piglettostringinstead? - lhfIOhandleOnDisconnectedis meant to be the function that is called if the connection to the IO Link device is interrupted. The code to the function is:local function IOhandleOnDisconnected() gTimer:stop() print('[IO-Link 2 MQTT] IO-Link device disconnected.') end client:register( deviceHandle, string(IOhandleOnDisconnected) , IOhandleOnDisconnected )- WhatIsProtocoll