PmcEditor 1.0 GENERATOR=LUA Code CYCLE=10 OUTFILE=C:\Mach4\Pmc\DacAirMistTools5to7.lua IO LIST FMachCoolantOn at Signal/Coolant On FMachMistOn at Signal/Mist On FAirTool5 at Signal/Output #12 (TOOL 5 AIR (DO.06.05) (--SWITCHING)) FAirTool6 at Signal/Output #13 (TOOL 6 AIR (DO.06.06) (--SWITCHING)) FAirTool7 at Signal/Output #14 (MILL TOOL 7 AIR (DO.06.07) (--SWITCHING)) FMistTool5 at Signal/Output #28 (TOOL 5 MIST (DO.08.05) (--SWITCHING)) FMistTool6 at Signal/Output #29 (TOOL 6 MIST (DO.08.06) (--SWITCHING)) FMistTool7 at Signal/Output #30 (TOOL 7 MIST (DO.08.07) (--SWITCHING)) END PROGRAM RUNG COMMENT This PMC controls the air and mist on tools 5 - 7. Note the second PMC file for tools 1 - 4. END RUNG COMMENT Reads the current tool number and stores the value in ToolNumber. END RUNG CORE_VALUE_READ 0 ToolNumber 2 END RUNG COMMENT Each tool has its own solenoids for air and mist. Air can be on by itself, but air must be on to get mist.\nIf I turn off mist, I want air to stay on. END RUNG CONTACTS 0 FMachMistOn 0 Signal/1145 COIL 0 RMistRequest 0 0 0 END RUNG COMMENT MachCoolantOn is the Mach "Coolant" output signal. (Flood button), (M08). "Coolant" is the AirRequest for the tools. END RUNG CONTACTS 0 FMachCoolantOn 0 Signal/1144 COIL 0 RAirRequest 0 0 0 END RUNG COMMENT Logic is the same for each tool. END RUNG COMMENT If I request air only, and tool 5 is active, turn on air for that tool.\nIf I request mist, turn on mist for that tool. Air request will already be on from line 5 because mist is requested. END RUNG COMMENT Tool 5 END RUNG CONTACTS 0 RAirRequest 0 Signal/1144 EQU ToolNumber 5 PARALLEL SERIES OSR COIL 0 FAirTool5 0 1 0 Signal/1062 END SERIES CONTACTS 0 RMistRequest 0 OSR COIL 0 FMistTool5 0 1 0 Signal/1078 END END END RUNG COMMENT If air request turns off or we change tools, turn off both air and mist for that tool.\nThe double contacts on AirRequest and ToolNumber are so that MistRequest turning off only turns off mist. END RUNG PARALLEL CONTACTS 0 RAirRequest 1 NEQ ToolNumber 5 CONTACTS 0 RMistRequest 1 END PARALLEL SERIES PARALLEL CONTACTS 0 RAirRequest 1 NEQ ToolNumber 5 END OSR COIL 0 FAirTool5 0 0 1 Signal/1062 END SERIES OSR COIL 0 FMistTool5 0 0 1 Signal/1078 END END END RUNG COMMENT Tool 6 END RUNG CONTACTS 0 RAirRequest 0 Signal/1144 EQU ToolNumber 6 PARALLEL SERIES OSR COIL 0 FAirTool6 0 1 0 Signal/1063 END SERIES CONTACTS 0 RMistRequest 0 OSR COIL 0 FMistTool6 0 1 0 Signal/1079 END END END RUNG PARALLEL CONTACTS 0 RAirRequest 1 NEQ ToolNumber 6 CONTACTS 0 RMistRequest 1 END PARALLEL SERIES PARALLEL CONTACTS 0 RAirRequest 1 NEQ ToolNumber 6 END OSR COIL 0 FAirTool6 0 0 1 Signal/1063 END SERIES OSR COIL 0 FMistTool6 0 0 1 Signal/1079 END END END RUNG COMMENT Tool 7 END RUNG CONTACTS 0 RAirRequest 0 Signal/1144 EQU ToolNumber 7 PARALLEL SERIES OSR COIL 0 FAirTool7 0 1 0 Signal/1064 END SERIES CONTACTS 0 RMistRequest 0 OSR COIL 0 FMistTool7 0 1 0 Signal/1080 END END END RUNG PARALLEL CONTACTS 0 RAirRequest 1 NEQ ToolNumber 7 CONTACTS 0 RMistRequest 1 END PARALLEL SERIES PARALLEL CONTACTS 0 RAirRequest 1 NEQ ToolNumber 7 END OSR COIL 0 FAirTool7 0 0 1 Signal/1064 END SERIES OSR COIL 0 FMistTool7 0 0 1 Signal/1080 END END END