Anuncios

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

brian_p1
981 Vistas, 5 Respuestas

Post Variable Question

Hi,

 

I'm wanting to write a post variable for calling sub program on siemens control, I only need the sub program name to be called how do I code it to return the wording entered in the post variable comment to be added to the nc code?

 

SUB_VARIABLE.jpg

; 8 8MM ENDMILL
; 10 6MM SPOT
; 11 6MM CHAMFER GARR
; 12 12MM ENDMILL 3FL
; 14 2.8MM CBD
; 15 M3 ROLL TAP
; 18 4MM BALLNOSE

CYCLE800()
G00 G53 Z610 D0
D1
G00 G53 X-300. Y220.0
G00 G53 B0.0 C0.0

 

PROBE_TOP...............WORDING FROM POST VARIABLE

 

; SETUP1: BOSS ROUGH1 BOSS1 B0. C0.

G55 G17 G40 G71 G90
T="12MM ENDMILL 3FL"

 

 

<IF>[eq(<PVAR:CALL_SUB_PROGRAM>," ............. ")]<THEN>

 

Thanks

 

 

walter.schaefer
en respuesta a: brian_p1

Hello Brian

 

This is the Code for the PP

 

<IF>[neq(<CALL_SUB_PROGRAMM>,"")]<THEN> <BOL>MSG("Probe Top")<EOB><ENDIF>

 

 

brian_p1
en respuesta a: walter.schaefer

@walter.schaefer, thank you for you reply, I would like to be able to have what ever text is entered in the post variable tab to be written into the program, your code will only add probe top to the program as it is hard coded into the post eg if 1234 was written into the tab then 1234 would be output in the program or if abcd was written into the tab then abcd would be output.

It needs to be the same as how seg comment works but im unsure of how to do it.

 

regards,

 

Brian

walter.schaefer
en respuesta a: brian_p1

Hello Brian,

 

at first, i'm from Germany and my English is bad.

 

you can Change the Postvariables in every Operation

In the first Operation you fill the <call_sub_programm> with "Start"

in next Operation you fill the <call_sub_programm> with "next" ……..

 

or

need you an inputbox ?

 

Best regards

 

Walter

 

 

 

 

chrisYPL9Z
en respuesta a: brian_p1

You would just have

;<PVAR:CALL_SUB_PROGRAM>

and it will post what ever is written in that post var.

For safety factor I would add an or function with the available probing cycles so if somebody mistypes the post will give a message.

<IF>[or(eq(<PVAR:CALL_SUB_PROGRAM>,""), eq(<PVAR:CALL_SUB_PROGRAM>,"PROBE_TOP"))]<THEN>

;<PVAR:CALL_SUB_PROGRAM>

<ELSE>

<MESSAGE: INVALID SUB PROGRAM>

<ENDIF>

You can add more sub programs to the if statement as needed.

 

-Chris

brian_p1
en respuesta a: chrisYPL9Z

@chrisYPL9Z 

 

Thanks very much Chris, i thought it would be something easy to get the text posted into the program, :símbolo_del_pulgar_hacia_arriba: