# Thread: Macro B To Heidenhain Q parameter Conversion

1. ## Macro B To Heidenhain Q parameter Conversion

I have a macro I wrote in Fanuc Macro B (& converted to okuma) and need to convert it to a Hiedenhain TNC426 control now. I see the use of the FN0: to FN?: to declare the variables or math operation. Is it possible to combine different math operations ?.

FN0: Q20=-8.5;CENTER OF PORT ON X-AXIS FROM TOUCH OFF POINT
FN1: Q29=Q29+Q26;STEP DOWN COUNTER

FN?: Q38=Q22/2-Q30-Q35
FN?: Q32=Q25-[.5*Q25]

IF [[Q38]GT[Q23/2-Q30]] GOTO N1000 ???????

Also where can I find more info on Q parameter programming, the manuals from the machine are rather basic.

Thanks,

Ed

2. As I recall the older controls were pretty basic 'one function at a time' affairs (but the ANG and LEN functions made applying trig easier).

The newer controls (white screen display, qwerty keypad, don't know the numbers) are a lot better, being able to write whole formulas out on one line. I think you GOTO a LBL rather than a line number, and that's where it may get confusing, I don't know whether there a need to close the LBLs or not...

DP

3. actually you don't need to use FN (functions) to declare vairable or math functions .
using FN to do these things is to prevent mistakes in syntax so if you use FN1 noboby can make a change to multiply.
So you can write your code like this

Q20=-8.5;CENTER OF PORT ON X-AXIS FROM TOUCH OFF POINT
Q29=Q29+Q26;STEP DOWN COUNTER

Q38=Q22/2-Q30-Q35
Q32=Q25-(.5*Q25)
Q33= Q23/2-Q30 ;
FN 11: IF Q38 GT Q33 GOTO LBL 10

I'm assuming you're looking at the Heidenhain control manuals. If you have other questions ask...

4. Hey Ed,

Just a question, and not intending to confuse you, but is your heidenhain file in ISO or conversational format?

if you're in ISO then your code would look like this:

Q20=-8.5;CENTER OF PORT ON X-AXIS FROM TOUCH OFF POINT
G98L10;or where ever you want this line label to be...
Q29=Q29+Q26;STEP DOWN COUNTER

Q38=Q22/2-Q30-Q35
Q32=Q25-(.5*Q25)
Q33= Q23/2-Q30 ;
D11 P01+Q38 P02+Q33 P03+10

Personally I always found macro easier in ISO mode, but whatever suits your fancy...

If you'd like a few examples of a bit more advanced macro's in ISO, I can send you some files I've used at work...

Let me know.
Al.

5. Another thought, if you'd like email me your file to be converted and I'll do it for you, with side notes etc. so you can see the changes and how the occur.

Some times this can be a good way to learn. I have a 426 at work, and I do the converting back and forth between the 426, a fanuc15m and a fanuc18m.

Not to bad to do, once you get the hang of it...

I've got a large NPT milling file I use on both the 426 and fanuc's. Same mathematical functions, perform the same on 426 and fanuc's, interested?

Al

6. Thanks guys,

I loaded the program & tried to run it & had a few errors.

IF [[Q38]GT[Q23/2-Q30]] GOTO N1000 had to change the calc in the if loop to a variable Q41=Q23/2-Q30 ; FN 11: IF Q38 GT Q41 GOTO LBL 10 to get the loop to work.

Thanks Hansdie I was wondering about the FN? commands whether they were required or not. The machine manual shows them & I found a couple of very basic examples on the net that did not use them, so wasn't sure.

Hi Al, we're running the controls in conversational a 426 & a 530 control. I understand they can be ran in ISO also but I haven't had time to sit down & read the manuals let alone mess around on the controls, far to busy on the floor, earn while learn. Is it possible to mix & match the two ?.

Ya I'd love some examples in ISO or EIA & the NPT macro, that would be great. I've wrote some Macro B programs in the past (fairly basic prog's) for family of parts with the help of Peter Smids book "Fanuc Custom Macros" excellent resource.

So why is there not a forum for the Heidenhain controls like Fanuc, etc. I'm new to these controls, but am liking them the more I get in to it.

Ed

7. you can't mix g-code with Heidenhain clear-code within the same program but you can use PGM CALL to call a g-code pgm or Heidenhain pgm.

also unless you have a good reason to use g-code just use Heidenhain code it's more powerful than the g-code, especially if you're using tables and touch probe cycles.

8. ok thanks Hansdie