PLC Logic Question

All things related to Centroid Oak, Allin1DC, MPU11 and Legacy products

Moderator: cnckeith

Post Reply
tblough
Posts: 3072
Joined: Tue Mar 22, 2016 10:03 am
Acorn CNC Controller: Yes
Allin1DC CNC Controller: Yes
Oak CNC controller: Yes
CNC Control System Serial Number: 100505
100327
102696
103432
7804732B977B-0624192192
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: Boston, MA
Contact:

PLC Logic Question

Post by tblough »

The Mill standard PLC currently contains the following code:

Code: Select all

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
IF (SV_SYS_MACRO > 0) && !(MpgMacro1PD_PD || MpgMacro2PD_PD || MpgMacro3PD_PD || MpgMacro4PD_PD)
  THEN SV_SYS_MACRO = 0
Could this not be replaced with the simpler version, or am I missing some subtlety of how the PLC process code?

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
Cheers,

Tom
Confidence is the feeling you have before you fully understand the situation.
I have CDO. It's like OCD, but the letters are where they should be.
cncsnw
Posts: 3763
Joined: Wed Mar 24, 2010 5:48 pm

Re: PLC Logic Question

Post by cncsnw »

Yes, it works just fine the way you propose.
tblough
Posts: 3072
Joined: Tue Mar 22, 2016 10:03 am
Acorn CNC Controller: Yes
Allin1DC CNC Controller: Yes
Oak CNC controller: Yes
CNC Control System Serial Number: 100505
100327
102696
103432
7804732B977B-0624192192
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: Boston, MA
Contact:

Re: PLC Logic Question

Post by tblough »

Thanks Marc. It actually seems to work better than the original; sometimes I used to have to push my button firing the macro a couple of times before it would execute. Now it seems to fire every time.
Cheers,

Tom
Confidence is the feeling you have before you fully understand the situation.
I have CDO. It's like OCD, but the letters are where they should be.
Post Reply