Issue
When Forcing a value from SBO, it is just overwritten by the Lua script all the time.
Product Line
EcoStruxure Building Expert
Environment
- MPM
- SE8000
Cause
By default, the MPM executes the program once every second, so if written simply like:
Output_1 = Off
the output will be turned Off every second.
Resolution
Declare a few variables in the Lua script that will help you implement the logic you need, here is an example:
var("Override_Status","ME.BV1")
var("Override_Value","ME.BV2")
if changed.Override_Status and Override_Status == 1 then
ME.BO1 = Override_Value
elseif changed.Override_Status and Override_Status == 0 then
ME.BO1 = ME.BI1
end
Basically, an override status points will act as a "Override button", and when it is active, The output will be equal to override value specified in SBO.
Else, if it is disabled, the output will be set to what ever you currently have in your script. In the example above, the output will be equal to the input.