PDA

View Full Version : Problem Citizen A220 sub-programs



jmichaud1
08-08-2010, 10:37 PM
Has any out there running a Citizen A220 experienced problems getting a sub-program to work. I load the main program and the sub-program in the control. I call the sub-program up in the main program with a M98 P1162. I have the sub-program,O1162, loaded in the control, but when the program gets to M98 P1162 it alarms out saying the file doesn't exist. The information in the sub-program is only in $1 and I wrote it using WIN-CNC. W doesn't my program see the sub-program?

Main program:(section)

(LETTERING-1ST SEGMENT)
M5
M18C0.
M80 S3=4500
T909(1/32 BALL)
G50 W-.5905
G98
M98 P1162
G50 W.5905
M82
G99


Sub-program:
O1162(C)
(C)G0C-23.291Z.6394
H11.6455W.0833
G1X.3075F5.
H-11.6455F2000.
H11.6455
H-11.6455W-.0208
W-.0416F5.
H11.6455W-.0208F2000.
H23.291
H11.6455W.0208
W.0416F5.
H-11.6455W.0208F2000.
G0X.4075
M99

g-code_junkie
08-09-2010, 07:38 AM
I do not see it in the posted example but man readables at the end of the m98p line sometimes cause the machine to see it as part of the program name that you are trying to call up.Precent signs in the wrong place can cause issues as well.I have opened the program in notepad and found characters not shown in win-cnc.Also I have seen multiple asteriks in man readables that have caused issues as well.
Good luck

UK-Engineer
08-09-2010, 09:49 AM
You could try using simple macro command and use a subroutine rather than loading external subprogram. This way all data is kept in one program - eg

(LETTERING-1ST SEGMENT)
M5
M18C0.
M80 S3=4500
T909(1/32 BALL)
G50 W-.5905
G98

#500=0 - Set up variable argument
GOTO100 - Jump to line N100
N200 - After subroutine is run machine jumps back to here

G50 W.5905
M82
G99


End of $1 program

N100
(C)G0C-23.291Z.6394
H11.6455W.0833
G1X.3075F5.
H-11.6455F2000.
H11.6455
H-11.6455W-.0208
W-.0416F5.
H11.6455W-.0208F2000.
H23.291
H11.6455W.0208
W.0416F5.
H-11.6455W.0208F2000.
G0X.4075

IF[#500EQ0]GOTO200 - We set #500 to 0 earlier so argument is correct

If you see macro softkey under offset page you have macro option enabled

good luck

jmichaud1
08-10-2010, 02:09 PM
Thanks for the response to my problem. What are "man readables"? I think there is something the machine sees that I do not see on the screen. I do need to add a percent sign at the end of the sub-program that WIN-CNC outputs. I talked to the distributer aplications engineer and he doesn't see a problem with the code but experienced the same problem on his machine when I sent him my programs. He loaded my programs on his machine, physically deleted the M98 P line and rewrote the code on the machine and it worked fine. I don't want to have to do that everytime I want to run a sub-routine. If the code looks good on the computer, it should work on the machine.

jmichaud1
08-10-2010, 02:19 PM
Thank UK-Engineer,

I ended up writing the programs like you had suggested and it worked good. The sub-programs are text that change all the time and I don't want to have to keep editing the main program. For now the program is working fine but I really want to know why my machine won't read a simple M98 command. Sometimes it works and sometimes it doesn't. There must be something behind the scene that I'm not seeing. Thanks again for your help.

UK-Engineer
08-11-2010, 03:50 AM
Typical A20 inch machining data - raw data viewed in windows notepad or similar (you won't see #016,#020 on screen only values in mc data screen)

D
#016=0000007500 - Bar size
#020=0000001000 - Tool pos pnt
#024=0000015000 - Mc Length
#028=0000001000 - Pcs per chuck
#032=0000001000 - Cut off tool
#036=0003000000 - Cut off rpm
#040=0000000020 - Cut off feed
#044=-000000800 - Cut off end point
#076=0000000000 - Front mc holder name
#048=0000005000 - Back drill holder
#052=0000004000 - Back spindle
#060=0000601000 - Back chuck extend length
#064=0000201000 - Back work extend length
#068=0000000000 - Unused

the control on your machine is quite intolerant if some of the above data is incorrect.

If i was to hazard a guess as to your M98 problem i'd say it was some of this data was in wrong format or even missing from your subprogram