Re: DT02 Tool Touchoff Sensor - SUCCESS
Posted: Wed Feb 20, 2019 7:02 pm
SUCCESS !!!!
For those of you who would like to modify the PLC script to build in a check for the DT02 touchoff tool here is how you do it.
BEFORE YOU START backup these files in a safe directory.
acorn_mill_plc.src
plcmsg.txt
First you need to create a new message to display in CNC12. You do this by opening the file plcmsg.txt with Notepad+ or Notepad. Now there are various kinds of messages if you read the PLC programming manual. Messages in the 9000 range are Faults, those in the 8000 range are Errors, and those in the 5000 range are Warning. For the DT02 touch off sensor we want a warning message. I added message #74, and you add 5074 to indicate it is a warning and message 74, followed by the message you want to see on the screen. Here is the line of code added to plcmsg.txt
74 5074 WARNING: PRESS_DT02_TOUCHOFF_SENSOR_TO_INITIALIZE
Now you can save that file and use Notepad+ to open acorn_mill_plc.src which is located in the C:\cncm directory. We are going to make several changes in the PLC file.
First we need to create a constant definition for the message, the next available one was message 74 so I added the following line in the Constant Definition section.
;------------------------------------------------------------------------------
; CONSTANT DEFINITIONS
;------------------------------------------------------------------------------
DT02_TOUCHOFF_WARNING IS 18946;(2+256*74)
Now we need to create a Stage in the PLC program. Stages are sections of the PLC program and they get executed from the top of the program to the bottom of the program. I need to add a new stage call DT2WakeUpStage, so first we have to add that name to the Stage Definition section. The next available one was STG11 so you can see I added that line.
;------------------------------------------------------------------------------
; Stage Definitions
;------------------------------------------------------------------------------
WatchDogStage IS STG1
InitialStage IS STG2
JogPanelStage IS STG3
MainStage IS STG4
AxesEnableStage IS STG5
StandardSpindleStage IS STG6
G540SpindleStage IS STG7
SpindleBrakeStage IS STG8
MPGStage IS STG9
ShuttleStage IS STG10
DT2WakeUpStage IS STG11
Now before we actually create the stage we need to modify the InitialStage and have it SET the new DT2WakeUpStage, it comes right after PLCBus, make sure you have the common at the end of that line.
;==============================================================================
InitialStage
;==============================================================================
IF SV_MACHINE_PARAMETER_822 > 0 THEN SET HomeAllStage
IF 1==1 THEN SET True,
SET OnAtPowerUp_M,
SET AxesEnableStage,
SET MainStage,
SET JogPanelStage,
SET LoadParametersStage,
SET MPGStage,
SET PLCBus_Oe_M,
SET DT2WakeUpStage,
RST DriveComFltIn_M,
RST DriveComFltOut_M,
RST PLCFault_M,
CycloneStatus_T = 300,
Now we have to create the new stage call DT2WakeUpStage and add this to the PLC program. I added this new stage right after the AxisEnableStage, but that is not critical.
;=============================================================================
DT2WakeUpStage
;=============================================================================
;When the DT02 Touchoff probe is first turned on it needs to have the sensor pressed to walk before use
IF Tooltouchofftriggered THEN InfoMsg_W = DT02_TOUCHOFF_WARNING
; this should print a warning on the screen to tell the user to press the DT02
Now you need to save the acorn_mill_plc.src file. The next step is to compile the new PLC program.
First you want to go to window globe in the bottom left hand corner of the screen and click it and a white box will open. Just type in cmd this will open a DOS prompt in a new window. You now need to get to the C:/cncm directory. Use CD .. a couple times to get back to C: Then cd cncm
Now if you type dir you will see all the files.
you compile the new PLC program using the mpucomp.exe program which is the compiler.
type the following: mpucomp acorn_mill_plc.src mpu.plc
This will start the compiler and if you did not make any typing errors the program will compile successfully.
Now when you start CNC12 it will notify you that the PLC program has changed and you need to power down the Acorn board. Go ahead and power it down and exit CNC12. After you power it back up and see the heartbeat light blinking go ahead and start CNC12. Probably most of you power the DT02 base unit with the Acorn 24V supply, so when you turn on acorn the base unit is powered. The RF touchoff sensor has not yet initialized the base unit. Now when you turn on CNC12 without touching the DT02 you will get the message on the CNC12 screen. Press the touchoff sensor with your finger and you will not see the message anymore until you power the Acorn up the next time.
This was a real learning experience for me but hopefully others will find this useful.
Russ
For those of you who would like to modify the PLC script to build in a check for the DT02 touchoff tool here is how you do it.
BEFORE YOU START backup these files in a safe directory.
acorn_mill_plc.src
plcmsg.txt
First you need to create a new message to display in CNC12. You do this by opening the file plcmsg.txt with Notepad+ or Notepad. Now there are various kinds of messages if you read the PLC programming manual. Messages in the 9000 range are Faults, those in the 8000 range are Errors, and those in the 5000 range are Warning. For the DT02 touch off sensor we want a warning message. I added message #74, and you add 5074 to indicate it is a warning and message 74, followed by the message you want to see on the screen. Here is the line of code added to plcmsg.txt
74 5074 WARNING: PRESS_DT02_TOUCHOFF_SENSOR_TO_INITIALIZE
Now you can save that file and use Notepad+ to open acorn_mill_plc.src which is located in the C:\cncm directory. We are going to make several changes in the PLC file.
First we need to create a constant definition for the message, the next available one was message 74 so I added the following line in the Constant Definition section.
;------------------------------------------------------------------------------
; CONSTANT DEFINITIONS
;------------------------------------------------------------------------------
DT02_TOUCHOFF_WARNING IS 18946;(2+256*74)
Now we need to create a Stage in the PLC program. Stages are sections of the PLC program and they get executed from the top of the program to the bottom of the program. I need to add a new stage call DT2WakeUpStage, so first we have to add that name to the Stage Definition section. The next available one was STG11 so you can see I added that line.
;------------------------------------------------------------------------------
; Stage Definitions
;------------------------------------------------------------------------------
WatchDogStage IS STG1
InitialStage IS STG2
JogPanelStage IS STG3
MainStage IS STG4
AxesEnableStage IS STG5
StandardSpindleStage IS STG6
G540SpindleStage IS STG7
SpindleBrakeStage IS STG8
MPGStage IS STG9
ShuttleStage IS STG10
DT2WakeUpStage IS STG11
Now before we actually create the stage we need to modify the InitialStage and have it SET the new DT2WakeUpStage, it comes right after PLCBus, make sure you have the common at the end of that line.
;==============================================================================
InitialStage
;==============================================================================
IF SV_MACHINE_PARAMETER_822 > 0 THEN SET HomeAllStage
IF 1==1 THEN SET True,
SET OnAtPowerUp_M,
SET AxesEnableStage,
SET MainStage,
SET JogPanelStage,
SET LoadParametersStage,
SET MPGStage,
SET PLCBus_Oe_M,
SET DT2WakeUpStage,
RST DriveComFltIn_M,
RST DriveComFltOut_M,
RST PLCFault_M,
CycloneStatus_T = 300,
Now we have to create the new stage call DT2WakeUpStage and add this to the PLC program. I added this new stage right after the AxisEnableStage, but that is not critical.
;=============================================================================
DT2WakeUpStage
;=============================================================================
;When the DT02 Touchoff probe is first turned on it needs to have the sensor pressed to walk before use
IF Tooltouchofftriggered THEN InfoMsg_W = DT02_TOUCHOFF_WARNING
; this should print a warning on the screen to tell the user to press the DT02
Now you need to save the acorn_mill_plc.src file. The next step is to compile the new PLC program.
First you want to go to window globe in the bottom left hand corner of the screen and click it and a white box will open. Just type in cmd this will open a DOS prompt in a new window. You now need to get to the C:/cncm directory. Use CD .. a couple times to get back to C: Then cd cncm
Now if you type dir you will see all the files.
you compile the new PLC program using the mpucomp.exe program which is the compiler.
type the following: mpucomp acorn_mill_plc.src mpu.plc
This will start the compiler and if you did not make any typing errors the program will compile successfully.
Now when you start CNC12 it will notify you that the PLC program has changed and you need to power down the Acorn board. Go ahead and power it down and exit CNC12. After you power it back up and see the heartbeat light blinking go ahead and start CNC12. Probably most of you power the DT02 base unit with the Acorn 24V supply, so when you turn on acorn the base unit is powered. The RF touchoff sensor has not yet initialized the base unit. Now when you turn on CNC12 without touching the DT02 you will get the message on the CNC12 screen. Press the touchoff sensor with your finger and you will not see the message anymore until you power the Acorn up the next time.
This was a real learning experience for me but hopefully others will find this useful.
Russ