PLC SV_SYS_MACRO logic question
Posted: Wed Dec 06, 2023 11:30 am
I'm updating my PLC programs to incorporate the latest revisions included in the Centroid release. Back in 2020 I asked a question about the reset logic on the SV_SYS_MACRO calls in the PLC - see https://centroidcncforum.com/viewtopic. ... CRO#p38333
In the latest Centroid released PLC programs, I see the reset logic has gotten even more complex with a timer now involved.
So, once again I ask what am I missing by implementing the simpler code below?
Thanks - Tom
In the latest Centroid released PLC programs, I see the reset logic has gotten even more complex with a timer now involved.
Code: Select all
IF MpgMacro1_M THEN SV_SYS_MACRO = 1
IF MpgMacro2_M THEN SV_SYS_MACRO = 2
IF MpgMacro3_M THEN SV_SYS_MACRO = 3
IF MpgMacro4_M THEN SV_SYS_MACRO = 4
IF ! (MpgMacro1_M || MpgMacro2_M ||
MpgMacro3_M || MpgMacro4_M || Aux13PD_PD) THEN NoMacroKeyPressedTimer_T = 100,
SET NoMacroKeyPressedTimer_T
IF NoMacroKeyPressedTimer_T THEN SV_SYS_MACRO = 0,
RST NoMacroKeyPressedTimer_T
Code: Select all
IF True_M THEN SV_SYS_MACRO = 0
IF MpgMacro1PD_PD THEN SV_SYS_MACRO = 1
IF MpgMacro2PD_PD THEN SV_SYS_MACRO = 2
IF MpgMacro3PD_PD THEN SV_SYS_MACRO = 3
IF MpgMacro4PD_PD THEN SV_SYS_MACRO = 4