MILLMANM
12-22-2004, 06:49 PM
Yes i am trying to add a call for a manual gear change to my
centriod post mc8. something like an if statment.
If speed is < than 2500 post comment
"M0 (CHANGE TO LOW GEAR)"
IF speed is > than 2500 post comment
" M0(CHANGE TO HIGH GEAR)"
I am runnuing a BP series 2 with inverter and a manual switch to change from high to low which changes the spindle direction ,but would like a statement with a M0 to make the changes
Thanks Brad
Al_The_Man
12-22-2004, 08:53 PM
If your conditional statements (if speed etc) work on the Centroid (or should it be 'if S' ?) and anything between the " " is a comment then I would say that the M0 has to be outside of the comment string to work.
Al
MILLMANM
12-22-2004, 10:55 PM
Al thats what i dont know how to write
it should work ,and I can put the M0 just before after it?
this is the post ihave been messing with
*progno, e
"(PROGRAM NAME - ", progname, ")", e
"(DATE=DD-MM-YY - ", date, " TIME=HH:MM - ", time, ")", e
psof0 # Start of file for tool zero
psof
psof # Start of file for non-zero tool number
pinit
!opcode
n, "G17 G40 ; Setup for XY plane, no cutter comp,"
n, "G20 ; inch measurements"
n, "G80 ; cancel canned cycles,"
n, "G90 ; absolute positioning,"
n, "M25 G49 ; Goto Z home, cancel tool length offset"
n, pinc, *sg28ref, "X0.", "Y0.", e
n, "M0"
n, *t, "(CHANGE TOOL)"
ptoolcomment
pcomment
n, "(CHECK GEAR)" would like to put the if statment here
n, speed, *spdlon
pcan
pcan1, n, pasb, "G00", pwcs, *xr, *yr, strcantext
pcan2
n, ptllncomp, *zr
pcoolon
any ideas?
ak762
12-25-2004, 12:54 PM
pcomment
if speed <= 2500, n, "M0 (CHANGE TO LOW GEAR)", e
if speed > 2500, n, " M0(CHANGE TO HIGH GEAR)", e
n, speed, *spdlon
I think if you add 2 lines it will work as you wish
surface
12-29-2004, 01:15 PM
I think what you want to do to compare the next spindle speed with the current spindle speed and if a high/low range is required, then output your M0 and comment. Otherwise you are going to get a "spindle speed high/low" at each speed change when you don't require a range-change.
masspfei
01-04-2005, 11:05 PM
Put this in ptlchg before the spindle output
"Tested in version 9"
if speed >= 2500,
[
if prv_speed < 2500, "M00", "(CHANGE TO HIGH GEAR)", E
]
if speed < 2500,
[
if prv_speed > 2500, "M00", "(CHANGE TO LOW GEAR)", E
]