Not sure what's changed but I just noticed this. Upon first start of the instrument the subscribe reports 0 even though the strobe light is switched on. The corresponding AM switch is therefore placed in the incorrect position. If the in sim switch is set off then on the subscribe works as normal. Upon first start of the instrument the event viewer also shows the sim switch position as 0 (off) when it is in fact 1 (on). It seems as though the subscribe is not doing the first read correctly. Tried with AM 4.0.2 and AM4.1 with both the stable and beta plugins.
Code: Select all
strobe_sw = switch_add(switch_off_img, switch_on_img, 30, 205, 50, 70, function(pos)
fs2020_event("K:STROBES_SET", pos ~ 1)
end)
function switch_update_fs(strobe)
print(strobe)
--strobe
switch_set_position(strobe_sw, strobe)
end
fs2020_variable_subscribe("L:LIGHTING_STROBE_1", "Enum", switch_update_fs)