Logic Machine Forum
Script restart after powerloss: ERWIN - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: Script restart after powerloss: ERWIN (/showthread.php?tid=1652)



Script restart after powerloss: ERWIN - SnMa - 12.10.2018

Hello.
I have a project where vi run some scripts on a LM.
The problem is that when we experience a power loss or do a reboot on the LM the scrips do not start up automatically. Is there a need for a boot script, and is there an example on how to make this available?

Regard Snorre Malvik, Oslo


RE: Script restart after powerloss: ERWIN - Daniel - 12.10.2018

Hi
It depend of type of the script, event will run only if new telegram is received. Resident and Scheduled will run as setup while device will boot up. If you need to run something on boot up then use init script.
BR
Daniel


RE: Script restart after powerloss: ERWIN - adigornik - 14.10.2018

Hello Daniel
Let me ask you in a different way.
How should I write this script to work after recovering the voltage ?

require('custom.fbeditor20.Comparator')

Input_1 = event.getvalue()
Input_2 = 5000
out, out_not = fbe_less(Input_1, Input_2, 'fb__Bad___lys_over_speil_blokering_kanal_1__fbe_less__id')
if out_not ~= nil then
grp.write('5/1/1', out_not)
end

Best Regards adigornik


RE: Script restart after powerloss: ERWIN - Erwin van der Zwart - 14.10.2018

Hi,

You make things more complex then needed..

On the (event) object settings you can enable “Read during startup”

Make sure the read flag is enabled in the ETS for this object.

When the controller reboots it will send a read request and the object will get the correct value from the installation and the event script will be executed and the output result should be as wanted.

BR,

Erwin


RE: Script restart after powerloss: ERWIN - adigornik - 15.10.2018

(14.10.2018, 17:37)Erwin van der Zwart Wrote: Hi,

You make things more complex then needed..

On the (event) object settings you can enable “Read during startup”

Make sure the read flag is enabled in the ETS for this object.

When the controller reboots it will send a read request and the object will get the correct value from the installation and the event script will be executed and the output result should be as wanted.

BR,

Erwin

Hi Erwin 

You mean *Execute on group read:* ?
Because I did not find anything that is called “Read during startup”

How can I do it less complicated ?

BR Adam


RE: Script restart after powerloss: ERWIN - Daniel - 15.10.2018

He means this
Read during start-up