Page 1 of 1

how to set parameters on single lines to save space for program readability

Posted: Fri Aug 23, 2024 10:17 am
by rjtechserv
I'd like to set parameters on a few lines instead of individual lines like the following. It doesn't cause an error but the parameters don't set

This! Is it possible?
N150 (#29056=#29158) AND (#29057=#29154)
N160 (#29058=#29150) AND (#29101=#29016) AND (#29102=#29017)
N190 (#29118=0) AND (#29119=0) AND (#29040=27) AND (#29103=0)

Not This
#29056=#29158
#29057=#29154
#29058=#29150
#29101=#29016
#29102=#29017
#29118=0
#29119=0
#29040=27
#29103=0


you'll see a portion of my code makes the program get very long below.


N444444 ; N444444 Always the start/top of fixture checks

N111 IF #29001 != 1712 THEN GOTO 1712099 ; ** FIXTURES 26 AND 27

: 1712 Fixture 27 -----------------
N1712001 IF #50017 && #29106==1 THEN GOTO 1712091 ELSE GOTO 1712002
N1712091 #310="C:\cncm\ncfiles\RS2\Subroutines\L1712_FRONT.cnc" ; Rack1 Right Side
N120 #29116=-2.500 ;FRONT RADIUS X-AXIS OFFSET
N130 #29117=-1.400 ;FRONT RADIUS Y-AXIS OFFSET
N140 #29121=-1.001 ;FRONT Rotation ANGLE
N150 (#29056=#29158) AND (#29057=#29154)
N160 (#29058=#29150) AND (#29101=#29016) AND (#29102=#29017)
N190 (#29118=0) AND (#29119=0) AND (#29040=27) AND (#29103=0)

M98 "C:\CNCm\ncfiles\RS2\Part_Programs\Zauto_Duller.CNC"
;-- End of FIXTURE #0 - 1712 Handle Program Parameters

N1712002 IF #50017 && #29106==2 THEN GOTO 1712092 ELSE GOTO 1712003
N1712092 #310="C:\cncm\ncfiles\RS2\Subroutines\L1712_BACK.cnc" ; RACK 1 Left Side
N230 #29116=-9.700 ;BACK RADIUS X-AXIS OFFSET
N240 #29117=-1.400 ;BACK RADIUS Y-AXIS OFFSET
N250 #29121=-.002 ;BACK Rotation ANGLE
N260 (#29056=#29159) AND (#29057=#29155) AND (#29058=#29151)
N270 (#29101=#29016) AND (#29102=#29017)
N290 (#29118=0) AND (#29119=0) AND (#29040=27) && #29103=-88.500
IF #50001
;-- End of FIXTURE #1 - 1712 Handle Program Parameters

: 1712 Fixture 26 ----------------
N1712003 IF #50018 && #29106==1 THEN GOTO 1712093 ELSE GOTO 1712004
N1712093 #310="C:\cncm\ncfiles\RS2\Subroutines\L1712_FRONT.cnc" ; RACK 2 Right Side
N330 #29116=-2.300 ;FRONT RADIUS X-AXIS OFFSET
N340 #29117=-1.350 ;FRONT RADIUS Y-AXIS OFFSET
N350 #29121=-.6 ;FRONT Rotation ANGLE
N360 (#29056=#29160) AND (#29057=#29156) AND (#29058=#29152)
N370 (#29101=#29066) AND (#29102=#29067)
N390 (#29118=0) AND (#29119=0) AND (#29040=26) AND (#29103=0)
IF #50001
;-- End of FIXTURE #2 - 1712 Handle Program Parameters

N1712004 IF #50018 && #29106==2 THEN GOTO 1712094 ELSE GOTO 1712099
N1712094 #310="C:\cncm\ncfiles\RS2\Subroutines\L1712_BACK.cnc" ; RACK 2 Left Side
N430 #29116=-9.700 ;BACK RADIUS X-AXIS OFFSET
N440 #29117=-1.350 ;BACK RADIUS Y-AXIS OFFSET
N450 #29121=.6 ;BACK Rotation ANGLE
N460 (#29056=#29161) AND (#29057=#29157) AND (#29058=#29153)
N470 (#29101=#29066) AND (#29102=#29067)
N490 (#29118=0) AND (#29119=0) AND (#29040=26) AND (#29103=-8.500)
N1712099 ; Skip to Next Pattern Check
;-- End of FIXTURE #3 - 1712 Handle Program Parameters

; ***** LOOP Logic ***************************
N555555
;--------------------------------
(#29106=#29009) ;TOOL RADIUS
(#29194=#29010) ;SPINDEL RPM
(#29107=#29012) ;PIECE PER CYCLE

;*** No Program Detected - Goto Load Point - "NO_PROGRAM"****
;If (#50017==0 && #50018==0) THEN
;M98 "#310" P1
;************************************************************

;......................................................................................
#29114=[#29110]+[#29118]+[#29057]+[#29103] ;X-AXIS Rotation POINT, Guage+PattBlock+OperOffset
#29115=[#29111]+[#29119]+[#29058] ;Y-AXIS Rotation POINT, Guage+PattBlock+OperOffset
#29112=[#29114]+[#29116]+[#29103] ;X-AXIS START POINT
#29113=[#29115]+[#29117] ;Y-AXIS START POINT
#2501=[#29114] ; X Axis Translation Point
#2601=[#29115] ; Y Axis Translation Point
#2401=-([#29056]+[#29121]) ; ROT RPL #2401 G54
IF #50001 ; Catchup Calculations : Seimens "STOPRE"

Re: how to set parameters on single lines to save space for program readability

Posted: Sun Aug 25, 2024 12:48 am
by cncsnw
As far as I know, CNC12 has no provision for multiple variable assignments on a single line.

Text in parentheses (probably everything from the first open parenthesis to either the last closing parenthesis, or perhaps to the end of the line) is a comment. That is why you do not get any error messages.

You could write a G65 macro that accepts multiple variable numbers or values and makes the assignments (up to 10 assignments per line if you use I, J and/or K arguments); but that seems unnecessarily obscure. A reader would have to go look up the macro to understand what it was doing, where five or six lines with individual variable assignments can be clearly understood by anyone.

Re: how to set parameters on single lines to save space for program readability

Posted: Mon Aug 26, 2024 11:15 am
by rjtechserv
Thanks Mark,

By the time I'm done I'll have 120 of these conditional paragraphs so I was trying to keep the code tight like we can on the Siemens controls. I'll have to concede to looonnnnggggg program. :shock:

Re: how to set parameters on single lines to save space for program readability

Posted: Mon Aug 26, 2024 3:54 pm
by cnckeith
rjtechserv wrote: Mon Aug 26, 2024 11:15 am Thanks Mark,

By the time I'm done I'll have 120 of these conditional paragraphs so I was trying to keep the code tight like we can on the Siemens controls. I'll have to concede to looonnnnggggg program. :shock:
rob, sounds like an interesting project, what are you trying to accomplish?

Re: how to set parameters on single lines to save space for program readability

Posted: Tue Aug 27, 2024 7:04 am
by rjtechserv
Keith,

This is for an industrial customer that has 25 of these Siemens CNC machines. My intent was to make the programming as similar as possible for their support staff.

So, we are using these parameters to create a custom skinning App the CNC operators can make adjustments within limits. We keep the profile shape locked down but we allow them X, Y, and Rotation Angle adjustments to fit the shape to a knife handle. The input "checks" determine with rack is in the CNC and there are two profile paths on each rack it runs. So each knife pattern has 4 blocks * 30 handle patterns. So I may change a little from the original intention of reading so exactly similar to the Siemens make it read better.

Re: how to set parameters on single lines to save space for program readability

Posted: Tue Aug 27, 2024 9:34 am
by cnckeith
cool.
sounds like similar process to the family of parts being made on this machine which also has Centroid Api add to allow user to select different variations for the production run that day.

viewtopic.php?f=57&t=9469