Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

Switching Probe On/Off with M96 and M97


Recommended Posts

7 hours ago, cncappsjames said:

In order for the M-Codes to "just turn the probe on and off", the installer would have to wire it in to the machine and do some stuff in the ladder.

Hah thanks. Apart from the installation, the 9833 probe off has alot of logic related to the active TLO and the current Z position, I think in both the WCS and MCS. It seems to throw off some machines for some reason, and appears to be related to the way that the macro uses the #116 parameter. Anyways it turns in to a real science project on some machines.

I am currently in a position where I'm not approved to upgrade these legacy macros on some crappy machinery that has limited tech support. I have to sift through them and make them work. I'm tempted to start writing macros completely from scratch utilizing the G31 skip signal command. I also find Renishaw's coding style hard to read - that's just my opinion. Making things worse is that the technicians include their own macros, which build off of Renishaw's macros, and these are even harder to read. Of course the technicians say they're good-to-go.

Link to comment
Share on other sites

Here is a typical O9832 I see. 

I don't see anything in there that isn't necessary besides the comments. 

When starting a probe, It's best to enable ALL the things it may need to ensure proper use so the resulting data is not corrupt. Renishaw has been doing this for a long time. There is reasoning behind what they do and why they do it. That doesn't mean their stuff can't be improved upon though. 

Be cautious when making large scale changes. 

O9832(REN*PROBE*START)
(F-4012-0519-AA)
(COPYRIGHT*1990-2017*RENISHAW*PLC.*ALL*RIGHTS*RESERVED)
(-->USER*M/C*START*CODE)
M19
(<--USER*M/C*START*CODE)
()
#3=1
#6=2
#8=1
M98P9724
N1
#2=#5043-#116
#4=0
#32=#2-[0.10*#129]
()
GOTO4(DELETE*TO*ENABLE*MULTI*PROBES)
()
#147=#147+9832
IF[#147NE[9832+2]]GOTO2
M98P9712
GOTO9
N2
IF[#147NE[9832+3]]GOTO3
M98P9713
GOTO9
N3
IF[#147NE[9832+4]]GOTO4
M98P9714
GOTO9
N4
#31=0(PROBE*STATUS*ON*CHECKING*1=ON/0=OFF)
M5
N5
()
(-->*PROBE*ON)
IF[#5NE#0]GOTO55
M19
N55
M108(PROBE*ON)
G04X1.(PROBE*DWELL)
(<--*PROBE*ON)
()
IF[#5NE#0]GOTO9
IF[#31EQ0]GOTO9
G65P9725Z#32F[100*#129]
IF[ABS[#5043-#116-#32]LT#123]GOTO8
G0Z#2
IF[#4EQ8]GOTO7
#4=#4+1
GOTO5
N7
G65P9700E380.
N8
G0Z#2
N9
#147=#0
#149=0
IF[#23EQ#0]GOTO10
POPEN
N10
M99

  • Like 2
Link to comment
Share on other sites
1 hour ago, cncappsjames said:

Here is a typical O9832 I see. 

I don't see anything in there that isn't necessary besides the comments. 

When starting a probe, It's best to enable ALL the things it may need to ensure proper use so the resulting data is not corrupt. Renishaw has been doing this for a long time. There is reasoning behind what they do and why they do it. That doesn't mean their stuff can't be improved upon though. 

Be cautious when making large scale changes.

Thanks for sharing that. I guess I'm referring to the 9833 probe-off macro. You make a good point about Renishaw's expertise in the game. In my opinion they use too much branching (GOTO statements) and too many subs, even for simple tasks.

Here's a legacy 9833 from a machine of ours. At the end you'll see a loop that tries to deactivate the probe, which always causes alarms. As far as I can see the probe is off, but still throws an alarm. All this just to turn the thing off?

The newest version of 9833 may allow you to disable the loop but it doesn't appear possible with the older versions.

Would you mind posting your 9833? Thanks again for your time.

(REN SWITCH OFF)
G65P9724
#148=0
#149=0
#2=#5043-#116
#4=0
#3=#2-[0.10*#129]
N2

M97(* M CODE TO TURN OFF PROBE)

G4X0.5
G31Z#3F[100*#129]
IF[ABS[#5043-#116-#3]GT#123]GOTO5
G00Z#2
#4=#4+1
IF[#4EQ4]GOTO4
GOTO2
N4
#149=560(* PROBE SWITCH OFF FAILURE)
G65P9700
N5
G00Z#2
M99

 

Link to comment
Share on other sites

Branching, GOTO, looping, subs, etc.... that is so they can use many things in many ways for many situations. Maybe not the most "efficient", but, definitely quite flexible. 

 

O9833(REN*PROBE*STOP)
(F-4012-0519-AH) 
(COPYRIGHT*1990-2019*RENISHAW*PLC.*ALL*RIGHTS*RESERVED)
IF[#1EQ1.]GOTO4
#31=0(PROBE*STATUS*OFF*CHECKING*1=ON/0=OFF)
IF[#23EQ#0]GOTO1 
() 
PCLOS
N1 
M19
#8=1 
M98P9724 
IF[#5NE#0]GOTO15 
#2=#5043-#116
#4=0 
#32=#2-[0.10*#129] 
#[#111+5]=#[#111+5]OR576 
#[#111+5]=#[#111+5]XOR576
N15
() 
GOTO4(DELETE*TO*ENABLE*MULTI*PROBES) 
() 
#147=#147+9833 
IF[#147NE[9833+2]]GOTO2
M98P9712 
GOTO6
N2 
IF[#147NE[9833+4]]GOTO3
M98P9713 
GOTO6
N3 
IF[#147NE[9833+6]]GOTO4
M98P9714 
GOTO6
N4 
(-->PROBE*OFF) 
M85(PROBE*OFF) 
(<--PROBE*OFF) 
() 
IF[#5NE#0]GOTO6
IF[#1EQ1.]GOTO7
IF[#31EQ0]GOTO6
G65P9725Z#32F[100*#129]
IF[ABS[#5043-#116-#32]GT#123]GOTO5 
G0Z#2
#4=#4+1
IF[#4LT8]GOTO4 
G65P9700E460.
N5 
G0Z#2
N6 
#147=#0
#149=0 
#[#111+5]=#[#111+5]OR256 
#[#111+5]=#[#111+5]XOR256
IF[#5NE#0]GOTO7
() 
(-->USER*M/C*STOP*CODE)
 
(<--USER*M/C*STOP*CODE)
() 
N7 
G53
M99

  • Like 1
Link to comment
Share on other sites
On 12/13/2020 at 6:48 PM, cncappsjames said:

O9833(REN*PROBE*STOP)

The legacy O9833 above (the one I posted) just times out at the loop:

IF[#4EQ4]GOTO4

Can't figure out what condition it is checking for - it's just a counter for #4. Don't understand what it's counting. The probe turns on successfully but will not turn off. I wrote a quick program that positions 500mm above Z0 in the WCS and turns the probe on and off. I put M00s in the program and wrote down the value every variable that's used in every affiliated macro. The math checks out to me. Just don't see what's missing here.

These macros were installed years ago by a tech that is out of state and is MIA. Renishaw doesn't respond to my emails for over a week.

Link to comment
Share on other sites

Your O9833 looks similar to ours.

O9833(REN SPIN OFF) 
G65P9724
#148=0
#149=0
#2=#5043-#116 
#4=0
#3=#2-[.10*#129]
N2
G04X.1
G31Z#3F[100*#129] 
IF[ABS[#5043-#116-#3]GT#123]GOTO5 
G0Z#2 
IF[#4EQ4]GOTO4
IF[#4EQ0]GOTO3
#3001=0 
WHILE[#3001LT9000]DO1 
END1
N3
S500M3
#3001=0 
WHILE[#3001LT1000]DO1 
END1
M05 
#4=#4+1 
GOTO2 
N4
#[3006-[[#120AND8]/8*6]]=1(PROBE SWITCH OFF FAILURE)
N5
G0Z#2 
M99 

Our probes activate once they enter the work area and turn off a certain amount of time (30 seconds?) after they leave the work area.

You may need to set/reset the probe parameters on the probe itself to get it to work.

 

  • Thanks 1
  • Like 1
Link to comment
Share on other sites
2 hours ago, cncappsjames said:

For programming a probe, you can get the Renishaw Trigger Logic app...

The current settings are

Radio On  - Radio Off/Spin Off

I'm interpreting this as meaning that the switch-off method can be either radio-off or spin-off.

IMG_5570.thumb.jpg.3d68ee9d77ffc87bc364eacb0781885b.jpg

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...