The machine list is simply a list of devices with which the editor can communicate. These are usually machine tool controllers, but could also be other computers or tape punches. These names will be used on various menus so should be meaningful to all users. This dialog (Options – DNC Configuration – Machine List) is used to maintain the list.
General Specifications Tab – Communications
The top frame, Capabilities, contains two checkboxes, Show on Send menu and Show on Receive menu. Checking Show on Send menu causes the editor to list this machine on its Send menu and implies that the machine is capable of receiving data. The Show on Receive menu causes the editor to list the machine on its Receive menu and implies that the machine can send data to the computer.
Most of the options on this tab describe the hardware and software characteristics of the machine. You will need to consult the machine tool controller manuals and settings to determine the correct values. If the information is not readily available, the Port Explorer, described later, can help determine several of the values.
Settings on this tab are:
Port
This is the serial communications port on the PC that will be connected to the machine. The editor accepts entries from COM 1 through COM 9. When configuring, as we are now, there is no test to see if the port actually exists and all ports are listed.
Speed
This is the line speed, measured in bits per second (sometimes called a baud rate), used by the machine for communicating. The editor allows speeds from 110 thru 115200 bps. Line quality can also affect the practical maximum. If you encounter problems achieving reliable transfers, try a lower speed. Dividing the bps rate by 10 provides a rough estimate of the transfer rate in characters per second.
Data Bits
This is the number of data bits used in each character and will be determined by the machine. The editor allows 7 or 8 data bits.
Stop Bits
This is the number of stop bits that follow each character. The most common value is 1.
Parity
Some machines use parity testing as a method of error checking. This is usually done by using 8 bit characters with 7 data bits and 1 “parity” bit. If the parity setting is “Even”, then the sender counts the number of one bits in each character. If the result is an odd number, the parity bit is turned on (set to one) to force an even number of one bits. The receiver checks each incoming character to assure that an even number of one bits are set, and signals an error if an odd number is set. Odd Parity works the same except that it requires an odd number of data bits to be set. You can also specify “None” for this setting.
The most common parity setting is Even if 7 data bits are used, and None if 8 are used.
Character Code
The options here are ASCII or EIA. Many machines will support both. ASCII is sometimes referred to as RS-358 and EIA as RS-244A. You will need to consult your machine documentation for this setting.
EOB (End of Block)
Valid settings here are CRLF, CR, and LF and refer to the character to be sent following each block of data. Although most NC programs are stored on your PC with blocks separated by Carriage Return / Line Feed pairs, the machine may require just a Carriage Return or a Line Feed character.
Handshaking
This is also known as Flow Control and refers to the ability of the receiver to control the rate of data flow. There are four settings.
None means that the receiver has no means of interrupting the sender. This should only be used at low line speeds and never used if you are drip feeding a machine.
Xon/Xoff is a common method of flow control via software. It is implemented by assigning special meaning to two characters, a “stop” character (Xoff) and “start” character (Xon). When a receiver's buffer is almost full, it sends an Xoff to the sender. The sender then waits until the receiver sends an Xon character to resume data flow. This option can not be used if transferring via Xmodem protocol.
Hardware flow control is implemented using several signal lines within the cable. The most common method is via two signals, Request to Send (RTS) and Clear to Send (CTS). When a receiver's buffer is almost full it will turn the RTS signal off. Since this is connected to the sender's CTS pin, the sender sees it as an indication to stop sending. This is a common method of controlling data flow.
Xon/Xoff/Hardware is a combination of software and hardware data flow. Generally, you would not use both hardware and software data flow control because of potential conflicts between the two.
Protocol
A protocol is an agreement by the PC and the CNC on what format your data will have. Two common protocols used for DNC are "ASCII" and Xmodem. "ASCII" isn't really a defined protocol so much as it's the absence of one.
Xmodem is fairly well defined, and has been used since 1977 as a file transfer protocol between computers. Xmodem formats the data into blocks of 128 characters each and a basic error checking method using checksums. The receiver must respond after each block with a positive acknowledgement of receipt.
Two additional variations of Xmodem are supported. "Xmodem CRC" is similar to Xmodem but with better error checking, and "Xmodem 1K" uses blocks of 1024 characters and provides better error checking.
Your choice of protocol will be determined by the machine. ASCII is the most common. Xmodem would be used only when transferring an entire NC program and is not suitable for drip feeding.
Delay
Some machines may require a short delay between blocks or characters to allow time for processing. This requirement is seldom documented and a reasonable value is usually determined by trial and error. The value is entered as milliseconds, so a value of 1000 is one second. The value entered here is actually a minimum value, so if 30 is entered the editor will wait at least 30 milliseconds between blocks. In many cases, the actual delay will be longer because of other processing. When determining the value to use, it is best to change entries in increments of around 30 milliseconds since very small increments will not make much difference. Do not enter delays unless absolutely necessary to communicate since they require considerable processing and also increase transmission time. The block delay is added to the character delay between blocks.
Single CNC block per buffer
Check this box if you are drip feeding a machine, or executing the NC program as it is downloaded. Checking this causes the editor to send data as individual, complete blocks rather than as one long stream of data. This option applies to Xon/Xoff handshaking only.
Send Tab - Triggers, Filters, and 1-Key Sending
Settings that pertain to sending data reside on this tab.
"Do Not Send" Filters
The Filters panel refers to characters that should be filtered out of the data prior to sending. Nulls, spaces, and comments can be filtered by checking the appropriate box, and specific characters can be removed by typing them into the text box marked characters.
Event triggers
Event triggers are characters or combinations of characters that, when received by the machine, have a special meaning. Specifically:
Start command – Characters sent to the machine signifying start of program
Ready response – Characters sent by the machine to signify acceptance of the start command
Stop command – Characters sent to the machine signifying end of program
Done response – Characters sent by the machine to signify acceptance of the stop command
Start sequence – No data is sent until the characters specified here are found in the NC program
End sequence – Sending stops when the characters specified here are found in the NC program
To enter a character, select the text box and a selection list will be displayed. Pick the desired character from the list. Trigger strings may contain a maximum of four characters.
The individual characters can be displayed in a
variety of ways, selectable at the bottom of the screen.
Editor operation
The editor can automatically start the send process when F2 is pressed if information is provided in this panel. If a unique file extension is assigned to a machine, and the Allow Immediate Send option is checked for that machine, then the single-key send capability will be available. For example, if you enter .ncd into the Associated Extension test box and check the option while setting parameters for machine “WG1 Lathe”, and you then open a file called 12345.ncd and press F2, the editor will automatically start the process to send file 12345.ncd to machine WG1 Lathe.
File extensions used in this manner must be unique. The editor does not check for unique entries.
Miscellaneous
A string of null characters can be sent before and/or after sending the CNC program as required by some controls.
If Process INCLUDE files on the Send tab is checked, files to be sent will be scanned for the presence of "INCLUDE" blocks. The format is:
(*INCLUDE filespec)
where filespec defines a file by specifying its drive letter, folder, and name.
For example, a CNC program could be set up as follows:
N0010 G90
N0020 ( *INCLUDE C:\auxfiles\load offsets.inc )
N0030 T7M6
N0040 M3 ... and so on
Block N0020 would be replaced by the file named "load offsets.inc" from the "auxfiles" folder on drive C.
Note: If an included file contains INCLUDE blocks, they are treated as comments and downloaded to the control. They are not processed.
Valid examples:
(*INCLUDE c:\nc programs\startup1.ncinc)
( *INCLUDE c:\nc programs\startup1.ncinc
( *INCLUDE c:\nc programs\startup1.ncinc )
Invalid examples:
(INCLUDE c:\nc programs\startup1.ncinc)ß No asterisk
*INCLUDE c:\nc programs\startup1.ncincß No starting parenthesis
Receive Tab
Settings that pertain to receiving data reside on this tab and are almost identical to those described for the Send tab. ^Z in the example signifies Control-Z.
"Do Not Receive" Filters
The Filters panel refers to characters that should be filtered out of the received data. Nulls, spaces, and comments can be filtered by checking the appropriate box, and specific characters can be removed by typing them into the text box marked characters.
Event triggers
Event triggers are characters or combinations of characters that, when received by the machine, have a special meaning. Specifically:
Start command – Characters sent to the machine telling it to start sending
Ready response – Characters sent by the machine to signify acceptance of the start command
Stop command – Characters sent by the machine signifying end of program
Done response – Characters sent by the PC to signify acceptance of the stop command
To enter a character, select the text box and a selection list will be displayed. Pick the desired character from the list. Trigger strings may contain a maximum of four characters.
The individual characters can be displayed in a
variety of ways, selectable at the bottom of the screen.
The Port Explorer is available as a configuration aid and may be useful in determining the communications characteristics of connected machines.
Buttons
Open Port
Opens the computer's communications port. If unsuccessful, an error message will be displayed in the status line.
Close Port
Closes the communications port
Clear
Clears the display area, with no effect on communications.
Close
Closes the Port Explorer window and causes the logged output (if previously requested) to be displayed in an edit window.
Communications Parameters
The meanings of the various parameters are described in the Communications Settings section. The Port Explorer can help determine the proper values. All except the port number can be changed with the port open.
Using Port Explorer to determine parameters
If you are not successfully communicating with a machine, you can often determine the correct combination by trial and error. Set the com port to the port attached to the machine. Then set Speed to 300, Data Bits to 8, Parity to None, and Stop Bits to 1, and Handshaking to None. Open the port. If the machine has a “Terminal Mode” or similar, start it. If not, set it to receive data.
Now, repeatedly enter the same value in the Port Explorer using the keyboard. The percent sign (%) or “N” key would be good choices. Press it about five times and see what the machine displays. If it's what you keyed, you're done (and very lucky). If not, change the line speed to the next higher value and retry. It is not necessary to close and reopen the port. Keep doing this until you have tried all line speeds. At some speed, you should eventually see the value you typed. If not, set Data Bits to 7 and Parity to Even. Set line speed to 300 and try again. If you are still unsucessful, set Stop Bits to 2 and go through the entire process again. If none of these combinations work, it is likely that a problem exists with the line itself.
It is probable that you will successfully communicate in the first pass through the line speed settings. Even if you do, more exploration may be needed. If 8 Data Bits and no parity works, try 7 Data Bits and even parity anyway. If both work, use 7 bits and even parity.
Once the basic parameters are established, you should determine the handshaking method to use. If the machine supports drip feeding, then Xon/Xoff is the most likely handshaking method. If not, it is probably a toss up between Hardware and Xon/Xoff. If the machine will send data to the PC, try sending a file to the Port Explorer. Once started, enter a Control-S character from the PC keyboard. If the machine stopped sending, it responded to an Xoff command. Send a Control-Q character and it will probably restart.
Although a Handshaking setting of “None” will suffice for the Port Explorer, it should not be used for downloading to a machine tool.
Using Port Explorer to Determine Protocol
You can use the Port Explorer (PE) to determine Xmodem variants if necessary. The editor supports the three commonly used versions – Xmodem, Xmodem CRC, and 1K Xmodem. To determine which method a machine uses, start the Port Explorer, set Control Characters to [SOH], and open the port. Handshaking must not be set to Xon/Xoff if you are using the Xmodem protocol. Then set the machine controller to receive data. If the Port Explorer shows nothing received, then the machine probably is not attempting to use Xmodem. If the PE window shows that it received a [NAK], then the machine is attempting to start an Xmodem session. If the PE window shows that it received a 'C', then the machine is attempting to start either a CRC or a 1K session.
To determine whether the machine uses Xmodem CRC or 1K, try to send a file from the machine to the PE. Then send a 'C' to the machine. If the machine responds with a block of data starting with a [STX] character, it is using Xmodem 1K. Otherwise it is using CRC.
Most machines that support the CRC or 1K variants also support standard Xmodem.
Display Options
The display options are contained in the panel labeled “Control Characters” and affect how non-printable characters are displayed on the screen.
Hide – Non printable characters are not shown.
Honor – If a non-printable character is a control character that normally affects formatting, honor it. For example, LF would cause a line feed on the display and CR would return the cursor to the start of the line.
[SOH] – Non printable characters are displayed using abbreviations in brackets, where appropriate. For example, a carriage return would be shown as [CR], line feed as [LF], and space as [SP].
^A – Non-printable characters are shown using caret (^) notation where appropriate. For example, a carriage return is shown as ^M, or “Control M”.
Other Options
Log to File – Causes Port Explorer activity to be logged for later review. The log will be sent to a new edit window when the PE is closed. It can then be reviewed, printed, or saved as a file.
12:31:36 Port opened----------------------------------------
Port: 1 Speed: 2400 Data: 8 Stop: 1 Parity: None Handshaking: None
In-->CCC[NAK][NAK][NAK][NAK][NAK][NAK][NAK][NAK][CAN][CAN][CAN][CAN][CAN]
12:35:19 Port closed---------------------------------------
The figure above shows the log from a session where the editor was connected to a remote computer running the Windows Hyperterminal program. In the example, Hyperterminal is attempting to start an Xmodem CRC data transfer from the local PC to the remote. Since there was no response from the local PC, Hyperterminal attempts to start a regular Xmodem transfer. Since we still sent no response, it automatically cancelled the transfer.
Send CR/LF – causes PE to send a Carriage Return and Line Feed when the Enter key is pressed, rather than just a CR character.
Echo – causes PE to show characters typed on the PC in it's text display. Characters sent out via PE are prefixed with “Outà” and characters received are prefixed with “Inà”.
Return to SURFCAM Index