What's new
What's new

Trying to run code for the first time, and its not working

STJ7780

Cast Iron
Joined
Jul 9, 2009
Location
Dallas, Ga
Well I finally figured out the cable and I was able to send my short program to my VF-1. When I try to start the program I get an alarm for invalid G code. Any ideas? Below is my code;

%
O0( TRACK FEET 1 )
( DATE=DD-MM-YY - 15-05-12 TIME=HH:MM - 23:34 )
( MCX FILE - C:\MCAMX\MCX\ADJUSTABLE TRACK FEET 1.MCX )
( NC FILE - C:\MCAMX\MILL\NC\TRACK FEET 1.NC )
( MATERIAL - ALUMINUM INCH - 2024 )
( T1 | 1/4 CENTERDRILL | H1 )
( T2 | 1/4 DRILL | H2 )
( T3 | 1/4 FLAT ENDMILL | H3 )
N100 G20
N110 G0 G17 G40 G49 G80 G90
N120 T1 M6
N130 G0 G90 G54 X.675 Y.875 C0. S3667 M3
N140 G43 H1 Z2.
N150 M8
N160 Z.3
N170 G99 G81 Z-.15 R.3 F7.3
N180 X3.75
N190 X6.25
N200 X9.325
N210 G80
N220 Z2.
N230 M5
N240 G91 G28 Z0. M9
N250 C0.
N260 M01
N270 T2 M6
N280 G0 G90 G54 X.675 Y.875 C0. S3667 M3
N290 G43 H2 Z2.
N300 M8
N310 Z.3
N320 G99 G83 Z-.7751 R.3 Q.075 F8.8
N330 X3.75
N340 X6.25
N350 X9.325
N360 G80
N370 Z2.
N380 M5
N390 G91 G28 Z0. M9
N400 C0.
N410 M01
N420 T3 M6
N430 G0 G90 G54 X-1.25 Y-.5 C0. S2000 M3
N440 G43 H3 Z.5
N450 M8
N460 Z.1
N470 G1 Z0. F6.1
N480 X-.75 F12.2
N490 G3 X-.25 Y0. I0. J.5
N500 G1 Y1.75
N510 G3 X-.75 Y2.25 I-.5 J0.
N520 G1 X-1.25
N530 Z.1 F6.1
N540 G0 Z.5
N550 X11.25
N560 Z.1
N570 G1 Z0.
N580 X10.75 F12.2
N590 G3 X10.25 Y1.75 I0. J-.5
N600 G1 Y0.
N610 G3 X10.75 Y-.5 I.5 J0.
N620 G1 X11.25
N630 Z.1 F6.1
N640 G0 Z.5
N650 M5
N660 G91 G28 Z0. M9
N670 G28 X0. Y0. C0.
N680 M30
%


Steve
 
I'm not too familiar with Haas mills. Is it possible your machine requires a longer program name? Our Yasnac controlled Matsuura 3 axis mill requires five digit program names when running programs from an ethernet connection. Sorry I can't be of more help.
 
Last edited:
I'm not too familiar with Haas mills. Is it possible your machine requires a longer program name? Our Yasnac controlled Matsuura 3 axis mill requires five digit program names when running programs from an ethernet connection. Sorry I can't be of more help.

I completely forgot to mention, I changed the name to the Haas recognized o9999 name and I still got an invalid G code alarm.

Steve
 
Do you have a 4th axis on the machine If not then remove all your "C0." on your program and give it a try. Also I can't really remember if the Haas machines I worked with used an "A" instead of a C for the 4th Axis.

HTH
 
try removing the "C0."


%
O0( TRACK FEET 1 )
( DATE=DD-MM-YY - 15-05-12 TIME=HH:MM - 23:34 )
( MCX FILE - C:\MCAMX\MCX\ADJUSTABLE TRACK FEET 1.MCX )
( NC FILE - C:\MCAMX\MILL\NC\TRACK FEET 1.NC )
( MATERIAL - ALUMINUM INCH - 2024 )
( T1 | 1/4 CENTERDRILL | H1 )
( T2 | 1/4 DRILL | H2 )
( T3 | 1/4 FLAT ENDMILL | H3 )
N100 G20
N110 G0 G17 G40 G49 G80 G90
N120 T1 M6
N130 G0 G90 G54 X.675 Y.875 C0. S3667 M3
N140 G43 H1 Z2.
N150 M8
N160 Z.3
N170 G99 G81 Z-.15 R.3 F7.3
N180 X3.75
N190 X6.25
N200 X9.325
N210 G80
N220 Z2.
N230 M5
N240 G91 G28 Z0. M9
N250 C0.
N260 M01
N270 T2 M6
N280 G0 G90 G54 X.675 Y.875 C0. S3667 M3
N290 G43 H2 Z2.
N300 M8
N310 Z.3
N320 G99 G83 Z-.7751 R.3 Q.075 F8.8
N330 X3.75
N340 X6.25
N350 X9.325
N360 G80
N370 Z2.
N380 M5
N390 G91 G28 Z0. M9
N400 C0.
N410 M01
N420 T3 M6
N430 G0 G90 G54 X-1.25 Y-.5 C0. S2000 M3
N440 G43 H3 Z.5
N450 M8
N460 Z.1
N470 G1 Z0. F6.1
N480 X-.75 F12.2
N490 G3 X-.25 Y0. I0. J.5
N500 G1 Y1.75
N510 G3 X-.75 Y2.25 I-.5 J0.
N520 G1 X-1.25
N530 Z.1 F6.1
N540 G0 Z.5
N550 X11.25
N560 Z.1
N570 G1 Z0.
N580 X10.75 F12.2
N590 G3 X10.25 Y1.75 I0. J-.5
N600 G1 Y0.
N610 G3 X10.75 Y-.5 I.5 J0.
N620 G1 X11.25
N630 Z.1 F6.1
N640 G0 Z.5
N650 M5
N660 G91 G28 Z0. M9
N670 G28 X0. Y0. C0.
N680 M30
%
 
Thank you for the help guys. I was actually going through the code line by line and I found out the every 10 lines or so there was just a bunch of random letters and numbers thrown in. I am not sure why but I am sure its related to how I sent it to the mill. I sent it RS232 from NCLink from OneCNC, their free DNC program. I must have the settings wrong. What DNC are you guys using to transmit to your machines?

There is another problem I have that will keep me from making any chips any time soon. I started a thread a couple of weeks ago titled "VF-1 Almost caught on fire!!!"
http://www.practicalmachinist.com/vb/haas/vf-1-almost-caught-fire-247173/
Well I thought I had the problem solved but it came back again so I will need to deal with that before I can get back to my programming issues. Thanks again for all of the input. :D

Steve
 
First, : Your post really sucks

Second: Eliminate any and all references to a C axis

When done, just use the free TeraTerm serial comm package. link: Tera Term Home Page
Settings for a Haas: 9600, 8, N 1, flow control: none
Protocol: Xmodem

will work with 56000Kb but cable lengths will limit reliability.

Unlike Fanuck, Haas don't care where you initiate the transfer from. It will either wait or time out.


If you have multiple machines, just create a shortcut to TeraTerm, edit the properties to use a specific .INI file\
Each .INI file can load different subdirectories and COMM settings.

For example my FV4 shortcut has:
Target: (drive):\ttermpro\ttermpro.exe /F=VF4.ini

Where the partial contents of VF4.ini is:

""""
; Serial port parameters
; Port number
ComPort=2
; Baud rate
BaudRate=9600
; Parity (even/odd/none)
Parity=none
; Data (7/8)
DataBit=8
; Stop (1/2)
StopBit=1
; Flow control (x/hard/none)
FlowCtrl=none
; Transmit delay per character (in msec)
DelayPerChar=0
; Transmit delay per line (in msec)
DelayPerLine=0

; TCP/IP parameters
; TCP port#
TCPPort=23
; Telnet flag (on/off)
Telnet=on
; Telnet terminal type
TermType=vt100
; Auto window closing option (on/off)
AutoWinClose=on
; History list of hosts
HistoryList=off

; Binary flag for Send File and Log (on/off)
TransBin=off
; Log append (on/off)
LogAppend=on

; XMODEM option (checksum/crc/1k)
XmodemOpt=checksum
; Binary flag for XMODEM Receive and ZMODEM Send (on/off)
XmodemBin=on

; Default directory for file transfers
FileDir=D:\files\MINI\VF4
""""

as you see, if you click on the shortcut, you will get all the serial parameters for the machine, along with a default directory where all you files reside....
 
SeymourDumore said:
Unlike Fanuck, Haas don't care where you initiate the transfer from. It will either wait or time out.
Hi Seymour,
Data transfer for Fanuc controls can be initiated from either the Control or the PC. Every installation of Comms software I do is set up to cover both options.

Thank you for the help guys. I was actually going through the code line by line and I found out the every 10 lines or so there was just a bunch of random letters and numbers thrown in. I am not sure why but I am sure its related to how I sent it to the mill. I sent it RS232 from NCLink from OneCNC, their free DNC program. I must have the settings wrong. What DNC are you guys using to transmit to your machines?Steve
Hi Steve,
There are a number of different causes for what you're describing, and it depend on exactly what you're getting as to what the actual cause is. However, its often caused by the Start Bit being missed due to noise on the transmission line. As the Start, or Attention Bit is always identified by the space line level, and that the line is in mark state when idle, the Start Bit is easily recognized by the receiver. If this bit is missed, transmission will start to be received on the first following data bit with a space value. This causes garbled data to reach the receiver.

Although the HAAS manual specifies the use of 1 Stop Bit, using 2 Stop Bits stretches the time to resynchronize after each stream of data bits is received. Stops bits are actually not real bits, but a minimum period of time the line must be idle (mark state) at the end of each word. On PC's this period can have three lengths: the time equal to 1, 1.5 or 2 bits. 1.5 bits is only used with data words of 5 bits length and 2 only for longer words. A stop bit length of 1 bit is possible for all data word sizes.

There are things in the HAAS manual regarding RS232 communication I don't agree with.
1. In the manual I have, it shows Protective Ground (Pin 1) of the DB25 connector at the Control End, being connected to Pin 1 of a DB9 connector at the PC end, calling the DB9 connector Pin1 Protective Ground as well. Pin 1 on a DB9 connector is in fact Data Carrier Detect (CD), with Protective Ground being the actual metal shell of the connector.

2. Although HAAS show a connection from PG at the control end to PG at the PC end, this is potentially hazardous unless its known that the two devices are Grounded in the same place, and that both are Grounded well. If these conditions aren't satisfied a Ground Loop can result. The ground loop occurs when there is a different electrical potential between the Grounds of the two devices. This results in an electrical current being conducted through the data cable. and can burn out the IC chips that send and receive the RS232 serial signals if the difference in potential is greater than about 30 volts. Accordingly, unless good grounding to the same ground can be assured for both devices, its recommended to ground the shield at the CNC end only.

Many pundits specify the use of a Null Modem Cable to connect Control to External Device (PC), without making reference to the fact that there is more than one configuration of the Null Modem Cable.

Null Modem is a generic term and refers to any cable where the complementary TD and RD lines are swapped, and covers cables having:

1. No Handshaking
2. Loopback Handshaking
3. Full Handshaking

The name Null Modem harks back to its origin as a cable that bypasses the Computer to Modem (DTE to DCE) connection, and directly connects two Computers (DTE to DTE)

As the HAAS Control can use Xon Xoff (Software Handshaking), the Loopback Null Modem (Software Handshaking) can be used and is an easy cable to make. This Loopback Handshaking gives the illusion of Full Handshaking, when in fact there is no handshaking at all.

Following is the configuration of a Loopback Null Modem Cable that will work quite satisfactorily with the HAAS control, however, the bridging of the control pins aren't required with the HAAS control:

Machine Side -------------------------------- PC Side
DB25 Male --------------------- DB25 Female ------ DB9 Female
1 --- Shield Trace ------------ Not Connected ---- Not Connected
2 ------------------------------------ 3 ------------------- 2
3 ------------------------------------ 2 ------------------- 3
4
| Bridged
5

6
|
8 All Bridged
|
20
7 ------------------------------------ 7 ------------------- 5


HAAS Parameter Settings:
Parameter Number
11 - Baud Rate = 9600 (Starting Point)
12 - Parity = Even
13 - Stop Bits = 2
14 - Handshaking = XOn/XOff
24 - Leader to Punch = None
25 - EOB = CR LF
37 - Data Bits = 7


PC Software Settings are as follows:

Handshake Method = Xon Xoff (Software Handshaking)
Baud Rate = 9600 (or whatever the control is set to)
Data Bits = 7
Stop Bits = 2
Parity = Even

Regards,

Bill
 
Last edited:
Bill

I know Fanuc can transfer back and forth with initiation from either side, but depending on the comms. package it takes a considerable amount of DWI to get it right.
And when it is right, you are still faced with timeouts and stuff until you figure out just how much time you have to run back and forth from PC to machine.
So, instead I've opted for the CF card and gave the RS232 the boot ..... not to mention the fact that why on earth would any numbnuts put the serial connector behind
a plastic door smack in the front of the control pendant.....

Nonetheless, my listing form above is the settings I use here in the shop for 4 Haas-s.
TeraTerm is dirt cheap and reliable, the Xmodem protocol allows the selection of the source/destination file, and unlike Fanuc the Haas does not strip the spaces from between
the words in the block, so after transfer one needs to do nothing with the file.
Also, kosher or not, a plain vanilla null-modem is all I use on the end of the 200' cables ( I've got 2 that long ).

But since you're here and you know quite a few magic tricks of a Fanuc, I'd like to ask you a couple of questions as a tangent.
1: The Haas examines the code inline during the RS232 transfer and puts incorrect lines in brackets if a syntax error is encountered.
2: As mentioned above, the Haas also spaces the words in the line, so it is much more readable.

Is there a way to tell a Fanuc to do that as well???
 
Bill

I know Fanuc can transfer back and forth with initiation from either side, but depending on the comms. package it takes a considerable amount of DWI to get it right.
And when it is right, you are still faced with timeouts and stuff until you figure out just how much time you have to run back and forth from PC to machine.
So, instead I've opted for the CF card and gave the RS232 the boot ..... not to mention the fact that why on earth would any numbnuts put the serial connector behind
a plastic door smack in the front of the control pendant.....

Nonetheless, my listing form above is the settings I use here in the shop for 4 Haas-s.
TeraTerm is dirt cheap and reliable, the Xmodem protocol allows the selection of the source/destination file, and unlike Fanuc the Haas does not strip the spaces from between
the words in the block, so after transfer one needs to do nothing with the file.
Also, kosher or not, a plain vanilla null-modem is all I use on the end of the 200' cables ( I've got 2 that long ).

But since you're here and you know quite a few magic tricks of a Fanuc, I'd like to ask you a couple of questions as a tangent.
1: The Haas examines the code inline during the RS232 transfer and puts incorrect lines in brackets if a syntax error is encountered.
2: As mentioned above, the Haas also spaces the words in the line, so it is much more readable.

Is there a way to tell a Fanuc to do that as well???

Hi Seymour,

If you're alluding to a time out issue when sending a file to the Fanuc control, when the transfer is initiated at the control; there is no issue. You can call the program from the Fanuc control, and if you're waylaid on your way to the PC, the control will still be waiting when you eventually get to the PC to send the file.

With regard to getting comms working you're right, its the comms package that is the weak link. There are many Comms apps that are downright horrible. But getting the Fanuc side set is Greasy Kid's Stuff. There are no more parameters to set with the Fanuc controls than any other make for setting comms via RS232 protocol.

I agree that it would be nice if the Fanuc control output a space between words. However, my software does that for the Fanuc controls. Accordingly, my clients don't get bent out of shape with regards to that issue.

What exactly is a "plain vanilla null-modem" cable. As I explained in Post #8, Null Modem is a generic term, covering any cable where the complementary TD and RD lines are swapped. I can't count the number of times I've been called to sort a Comms issue where the client has purchased an off the shelf "Null Modem" cable, and traced the issue to the cable being a No Handshake, Null Modem cable (TD, RD and SG only). Any of the three cables I mentioned in Post #8 will work with the HAAS control, and particularly when using Xmodem protocol. 200 feet is no surprise, and the distances specified in the RS232 standard can be stretched by using cable having a lower capacitance than that used in the standard (50pF/ft).

Fanuc doesn't do a syntax check. That's a nice feature, particularly when creating programs manually. However, the software I supply to my clients, does that before the code gets to be sent to the control. There's lots of software around that does the same as mine.

Regards,

Bill
 








 
Back
Top