I/O Relay Board Input Signals Output Signals Examples For I/O Connections INTERFACE BETWEEN CNC CONTROLLER AND PLC HUST H2N Series Status Signal S-Bits 6.1.1 S-Bit Signal And PLC Cycle Time Chart 6.1.2 Descriptions Of S-Bits Square Wave Signal with 0.75sec ON,0.25sec OFF (S000)
Page 4
HUST H2N Connecting Manual Servo Motor Status (S088) Key Signals from PC or MMI (S104~S111) Battery (BT1,BT2) Down Signal (S120~S121) Key Strobe for Key Being Pressed Down and Kept Down Ladder Simulation Mode (S127) X and Y-axis Home Signal at Machine Coordinate=0 (S160~S161)
Page 5
Contents Special C-bit for G28,G29 and G30 (C224~C225) 6-20 Axial Motion Command in JOG Mode (C228) 6-20 G01 Feed-rate Adjustment by MPG Hand-wheel (C229,C230) 6-21 Load File from EPROM/FLASH-Rom (C231) 6-21 Clear G54 Work Coordinates (C232) 6-21 Program Simulation Without V-command and Encoder Feedback (C235) 6-21 MPG Hand-wheel Feed Interrupt Mode (C242) 6-21 MMI (Man Machine Interface) or LCD Screen In Sleep Mode (C243)
C-bits. This manual also describes the functions and the ladder diagram with corresponding signals. For the functional information of HUST H2N controller, please refer to the HUST H2N Operation Manual. This manual is intended for users with some basic electrical and electronic knowledge.
2 Configuration 2 CONFIGURATION 2.1 System Configuration The HUST H2N system generally has the following configuration as shown in Fig. 2-1. The main components of this configuration are listed below. 1. CPU Main Board 2. Keyboard Unit 3. MPG Hand-wheel 4.
3 Installation and Dimension 3 INSTALLATION AND DIMENSION 3.1 Environmental Requirements The design of the cabinet to house the CNC unit, the keyboard panel and the LCD display is the responsibility of the machine tool builder. The cabinet must be constructed and the unit installed in an environment satisfying the following conditions.
HUST H2N Connecting Manual 3.3 Thermal Design in the Cabinet The cabinet for the control unit must be a closed structure, and the temperature rise within the cabinet must be 10 C or less than the ambient temperature. When designing a metal cabinet for a CNC unit, two factors must be considered, which are the heat source and the radiation area.
3 Installation and Dimension 3.4 External Dimensions and Diagrams • HUST H2N Keyboard Panel and LCD Screen HUST H2N AUTO HOME SHIFT DEL. INPUT CYCST RESET LINE Fig 3-1 HUST H2N Keyboard Panel and LCD Screen 3 - 3...
Page 14
CPU Main Board Connectors (Rearview) INPUT OUTPUT LCD- RS232 Fig 3-2 Main Board Connectors • Dimension for H2N Controller Box (Rearview) 300 mm 268 mm INPUT OUTPUT LCD- RS232 280 mm Fig 3-3 Dimension for HUST H2N Controller Box (Rearview) 3 - 4...
Page 15
3 Installation and Dimension • Dimension for H2N Controller Box (Top View) 300 mm 280 mm Fig 3-3 Dimension for HUST H2N Controller Box (Top View) • Cutout Dimension for H2N Controller Installation 285 mm 173 mm 中間切除部份 (Cutout) 268 mm...
Page 16
HUST H2N Connecting Manual • Input Board – NPN Type Fig 3-6 is a standard NPN type input board. This board provides 24 input points with LED indicators. When the input signal is correctly received, the corresponding LED will be ON. Otherwise, check your program or connections.
Page 17
3 Installation and Dimension • Output Relay Board – NPN Type Fig 3-7 is a NPN type output relay board and it has 16 outputs with LED indicators. When the output signal is properly received, the corresponding LED will be ON. Normally, all DIP switches are at "OFF"...
DB25LF (or M) : D sub type connector 25 pins female (or male). TBxx : Terminal block with pin number indicated by “xx” 4.2 Connector Designation The connector designation on HUST H2N controller in printed on the back of the controller and their corresponding types are listed below. Connector Name Connector Designation...
HUST H2N Connecting Manual 4.3 System Connecting Block Diagram (Fig 4-1) The RS232 communication cable should not exceed the 15m maximum length. This is to avoid the potential electrical noise due to the electro-magnetic interference. Keyboard (2) Power Supply (6)
Page 21
4 Connecting Diagrams AC Power Supply Connecting Diagram (Fig 4-2) HUST H2N controller requires an AC110~220V± 10% power. Try to avoid excessive power fluctuation or it will not work properly. All components in Fig 4-2 are inside the control box and it's shown here for reference only.
Page 22
HUST H2N Connecting Manual Motion Control (Servo/MPG) Connection (Fig 4-4) X-axis servo driver is connected to P4, Y-axis to P5 and MPG hand-wheel to P3 as shown in Fig 4-4. The connections may vary depending on the type of servo system and the MPG that customer uses.
Page 23
4 Connecting Diagrams AC Power System Connection (Fig 4-5) HUST internal PLC in the controller has a timer to control the servo-on delay. When the set time (about 1.5 seconds) in this timer has elapsed, an output is ON to turn on the servo motors. CNC Power-on CNC Power-on Time...
Page 24
HUST H2N Connecting Manual CONTRAST, R7 This is an adjustable resistor for LCD screen contrast adjustment. D/A Connector This connector is for special application and it needs an IC for it to be effective. In addition, the PLC should includes C100 = 1 and the registers in PLC are R152 and R153.
Page 25
RS232 Connector Pin Assignment and Connecting Diagram (Fig 4-7) For the operational details of RS232 communication, please refer to Chapter 9 of HUST H2N Operation Manual. Do not exceed 15 meters for the cable connecting RS232 port and PC. The interface voltage on the PC side should be in the range 10 ~ 15V.
GND (24V) Fig 5-1 I/O Connector Pin Assignment (NPN-type) I/O signals can be connected directly to P1 and P2 connectors on H2N controller. All output points on HUST H2N main board are of transistor type circuit with open collector. However, it would be advisable to use input board and output relay board before the signal going into the controller.
Page 28
HUST H2N Connecting Manual 5.2 Input Board and Output Relay Board The input signal connection can be done in two ways: 1. Connect directly to DB25LF connector in the controller shown in Fig 5-1. 2. Connect input signal to the corresponding terminal of HUST input board, then connect from DB25LF connector on the board to the connector on the controller box.
Input signal is the one from external devices to CNC controller, such as push button, sensor, limit switch, proximity switch, etc. There are 24 inputs for HUST H2N controller and their status can be displayed on LCD screen by pressing the blank key (below AUTO key) on the keyboard.
Fig 5-5 Input Signal Connected to Input Board (NPN-type) 5.4 Output Signals Output signal is the one from CNC controller to an external device. The output circuit of HUST H2N controller is a transistor circuit that can be used to drive a relay or LED, etc. •...
Page 31
When output connector is directly connected to an inductive load, such as relay, it must connect a spark killer diode in parallel and as close to the load as possible. (See Fig 5-6) ll output terminal of HUST H2N controller is open collector transistor circuit.
Page 32
HUST H2N Connecting Manual Fig 5-8 is an emergency stop circuit. When the hardware OT limit switch is touched or the E-stop button pushed, the controller will be in a state of emergency stop and the servo-on switch on the servo motor will trip off. For safety reason, the E-stop button, the hardware OT limit switch, and the E-stop relay should be connected in- series and the servo-release button in-parallel with the hardware OT limit switch.
Page 33
5 I/O Interface Connections Incorrect Connection: Servo Driver Servo-On Signal PLC Output Servo Driver Servo-On Signal Relay C Fig 5-7 Incorrect Connection Correct Connection: Servo Driver Servo-On Signal PLC Output Servo Driver Servo-On Signal Relay C Fig 5-8 Correct Connection 4.
6.1 HUST H2N Series Status Signal S-Bits S-bit is the internal status signal from HUST CNC system unit to PLC unit for sequential control of the machine tool. The meaning of each S-bit signal is shown in Table 6-1.
Page 36
HUST H2N Connection Manual Table 6-1 HUST H2N Status Code S-Bit Signals S-Bit Number Status Signal Description S000 Send out square wave signal with 0.75 sec ON, 0.25 sec OFF S001 Reset key S002 Cycle start key S003 ~ S007...
6.1.1 S-bit Signal and PLC Cycle Time Chart Fig 6-1 shows the time chart between the HUST H2N controller and the PLC unit. Note that Bit S017 is synchronized with Bits S000 ~ S023. S000 ~ S031 are all one- shot signals.
HUST H2N Connection Manual • CNC Control Unit Alarm Signal (S016) The controller sands Bit S016 one-shot high (1) strobe to inform PLC unit when any alarm occurs. • Key Strobe (S017) The controller sets Bit S017 one-shot high (1) strobe to inform PLC unit when any key on HUST keyboard is pressed.
6 Interface Between CNC And PLC • Spindle Status Bit (S085) In spindle closed loop feedback (C117=1), S085 = 1 indicates spindle is in a state of STOP and S085 = 0 means spindle is in motion. • Servo Motor Status (S088) – See S064, S065 above •...
HUST H2N Connection Manual Example: MCM #87 = 500 = 0.5 mm Position command: G01 X100.000 In-pos dist=0.5 mm X=100. Motor Running S176 • Direction of Motor Rotation (+/-) for X and Y-axis (S192~S193) S-bit Axis Positive Rotation (+) Negative Rotation (-)
Page 41
6 Interface Between CNC And PLC Table 6-2 C-bit Signals Description Bit Number C-Bit Signal Description C000 Machine Lock/Feed hold C001 Reset C002 Emergency stop C003 Reserved C004 Cycle start C005 Program No. selection by INPUT key C006 Single Block C007 NC alarm &...
Page 42
HUST H2N Connection Manual C130~C143 Reserved C144~C145 To enable digital readout mode for X, Y-axis C146~C159 Reserved C160~C163 Hardware limit for (+/-) X, (+/-) Y-axis C164~C191 Reserved C192~C193 Clear error count to 0 for X, Y-axis C194~207 Reserved C208 X-axis. Positioning execution in PLC C209 Y-axis.
6.2 PLC Command Signal C-Bits A C-bit is a command signal from the PLC to the HUST controller for CNC functional control. The C-bits for HUST H2N controller are shown in Table 6-2 and their meanings are discussed in the followings.
Output ON C000=0 FEED-HOLD C000=1 Please refer to HUST H2N Operation Manual for more information on G11. • RESET (C001) C001 = 1 (high), RESET the whole system to initial status. C001 = 0 (low), RESET function is cleared. • Emergency Stop (C002) C002 = 1 (high), controller reset and Emergency stop.
If you interrupt the program execution by pressing RESET or Emergence-stop, you can set C011=1 to restart the execution from the program block where the program was interrupted. HUST H2N does not provide this function key on the keyboard and it must be processed through PLC.
HUST H2N Connection Manual I023 C011 In AUTO mode, press CYCST key to restart. At the end of M02 or M30, the restart function will be automatically cleared. Note that the M, T, S-code in the previous program blocks prior to program interruption will be re-executed during restart operation.
6 Interface Between CNC And PLC 2. Jump to the 2 program or do some other task such as JOG function. 3. Under AUTO mode, select the program number of the interrupted program. 4. Set C013=1 to read the stored block number in step 1. 5.
HUST H2N Connection Manual • Option Stop (C026) C026 = 1 (high), Option Stop is ON. C026 = 0 (low), Option Stop is OFF. If bit C026 is set low (0), M01 block will be ignored during program execution. If bit C026 is set high (1), M01 block will stop program execution until CYCST is pressed again.
C031 = 1 (high), CNC is ready to accept ladder simulation procedures. C031 = 0 (low), ladder simulation stops. When C031 = 1, a 12K RAM memory in HUST H2N controller will become available for user to test his ladder program that was edited in the personal computer.
HUST H2N Connection Manual • MPG Hand-wheel Test Mode (C056) C056 = 1 (high), MPG Hand-wheel Test Mode ON. C056 = 0 (low), MPG Hand-wheel Test Mode OFF. The advantage of MPG test is that the user can test the program by doing actual cutting using a MPG hand-wheel speed.
C081 = 1~0 (falling edge), use the current program position for Y-axis as the work coordinate origin. HUST H2N controller provides 6 groups of work coordinate (G54~G59) with their location (with respect to HOME) data stored in MCM #1~#12 as shown in Table below.
HUST H2N Connection Manual N10 G55 N20 U100. N30 M02 When C123 = 1~0 (falling edge) in PLC, it triggers the controller to use the group number as stored in R228 with the corresponding data in MCM #1~#12 for work coordinate system. Again, press RESET will restore to G54 system.
6 Interface Between CNC And PLC • Command Code for Program Selection from External Device (C120) C120 = 1, function of program selection from external device ON C120 = 0, function of program selection from external device OFF R226 is the register to store the program number from external device while R255 stores the current program number.
HUST H2N Connection Manual • Signal for Over-travel (OT) Limit Switch (C160~C163) C160 =1, OT limit switch in the X+ side is touched. C161 =1, OT limit switch in the X- side is touched. C162 =1, OT limit switch in the Y+ side is touched.
6 Interface Between CNC And PLC example, R233 = 3 = 11 in binary, so X, and Y-axis (1=ON) will move simultaneously. R233 Bit-1, R233=2 Bit-0, R233=1 Axis R234 Bit-1, R234=2 Bit-0, R234=1 Axis • G01 Feed-rate Adjustment by MPG Hand-wheel (C229, C230) When C229 = 1 and C230 =1, G01 feed-rate adjustment by MPG hand-wheel function is ON.
C245 = 1, Self-defined keyboard function ON. All keys on keyboard have to be redefined. C245 = 0, Self-defined keyboard function OFF. User can redefine the keys on HUST H2N keyboard by following the steps below. This is done through PLC process. Please see R241 and R242 in next section for more information.
C255 =0→1, User defined keyboard output function ON (see C245) 6.3 Description of PLC Register This section describes the registers that are used in PLC for HUST H2N controller. Table 6-4 is a summary of registers with their corresponding variable number.
Page 58
HUST H2N Connection Manual Table 6-4 Registers and Corresponding Variables for HUST H2N Controller Register Variable No. Application / Definition R100 10100 Execution mode selection R160~R161 10160~10161 Feed-rate setting for X and Y-axis R180~R181 10180~10181 Absolute Coordinate setting for X and Y-axis...
Page 59
6 Interface Between CNC And PLC R100, Execution mode selection according to table below R100 Execution NONE AUTO HOME EDIT TAPE TEACH R160~R161, Feed-rate setting for X and Y-axis R180~R181, Absolute coordinate setting for X and Y-axis These registers are for positioning in PLC and are used with C208~C209. The coordinates R180~R181 will be multiplied by 10 and their maximum setting values are 32767.
Page 60
HUST H2N Connection Manual Default = 100 (%), range 0 ~ 150. Note that the actual feed-rate output (the program feed-rate * R221) cannot exceed the maximum feed-rate set by MCM #56~#57). For example, if program G01 feed-rate = 2000 and R221 = 120, the actual G01 feed-rate output = 2400.
Page 61
6 Interface Between CNC And PLC C-bit R228 Work Coordinate C123 = 0→1 C123 = 0→1 C123 = 0→1 C123 = 0→1 C123 = 0→1 C123 = 0→1 Note that the work coordinate returns to G54 system whenever you press RESET both in part program or PLC program.
Page 62
HUST H2N Connection Manual Ex: R232 = 3 (=11 in binary), Bits 0, 1 are ON. If you execute HOME operation (C063=1), both X and Y-axis will move simultaneously. If you execute JOG, both axes (X and Y) will move simultaneously.
Page 63
When S017 = 0→1, the controller will read the key code being pressed and store it in R241. The standard HUST H2N keyboard and the key numbers are shown in Fig 6-8 below. Refer to C245 and C255 for user redefined keyboard key.
Page 64
R251, For storing the ERROR code In case of ERROR during program execution, the ERROR code will be displayed on the HUST H2N LCD screen. The ERROR code is stored in R251 which is for read only. R252, For storing current M-code When executing a M-code in a program under AUTO or MDI mode, a one shot signal S24 will be generated and this M-code will be placed in R252.
Page 65
6 Interface Between CNC And PLC Fig 6-8 HUST H2N Keyboard with Key Code 6 - 31...
Page 66
HUST H2N Connection Manual Table 6-5 Definitions of Output Key Code R242 Output R242 Output R242 Output INPUT INSERT AUTO SEQU. FIND LAST “N” / Delete one block Delete current program ˙ Delete all programs (*5) — MCM parameters reset (*6)
6 Interface Between CNC And PLC 6.4 Variables All data in HUST H2N system is stored in the variables. If you like to check a problem during execution, you can check the variable. Variable Number Definition 00001 ... 09999 For user’s application 10000 ...
Page 69
6 Interface Between CNC And PLC When you start execution, the tool starts moving while the controller begins pre-fetching process. At block N004, the controller execute “V#1 = V#12221” (planned program position on X-axis) and the tool position at this moment may be at 1.052.
All input and output signals are defined as ON = 1 (high) and OFF = 0 (low). HUST H2N keyboard provides 7 LED for user’s application. They are output bits and are designated as O192 ~ O198 as shown in the figure below. User can incorporate these bits into PLC for display.
I/O points that are required for the purposes. Note that the S-bits, C-bits, and some I-bits are already defined in HUST H2N controller. Their applications should not be altered or redefined. Otherwise, significant error may result.
To control machine tool's motion, the user should fully understand the relationships between the machine tool and the HUST H2N Series I/O interface. At this point, the user must define the I-bits and O-bits to be used, according to the I/O interface connection.
Page 73
7 Ladder Diagram Install the EPROM or FLASH-ROM to the CNC controller and turn on the power for checking. (FLASH-ROM) (EPROM) Start Start Edit/Revise Edit/Revise Ladder Diagram Ladder Diagram Compile and Print Compile and Print Ladder Ladder Downlod to CNC Writing EPROM Burn into Install To CNC...
HUST H2N sold so far were equipped with FLASH-ROM. As to HUST H2N system file, it is to be splitted into “*.evn” and “*.odd” file also. Both system and PLC “*.evn” files are to be writen onto the same FLASH-ROM and both “*.odd”...
Page 76
16. Press "Ctrl Esc" to quit. 8.3 EPROM Installation The 68000 CPU board in HUST H2N controller has two slots for even and odd system and PLC ladder EPROMs. The slot designation for even system and PLC ladder EPROM is EVN and for odd system and PLC ladder EPROM is ODD. Be careful about the locations when installing those EPROMs.
Page 77
9 Appendix A -- PC Operation with HUST CNC Controller 9.1 Applications Via the communication ports between the HUST CNC controller and the PC, users can do the following operations from the PC terminal. 1. Command the controller to send data to PC or to execute function from PC.
Page 78
HUST H2N Connecting Manual Pxxxx<CR> --- xxxx is the program number if the data requested is not in the current program. Omit, otherwise. --- Command END. DC2 means PC command starts to transmit. DC4 means PC command stops. '0' and '1' following N act as On/Off switch for the command requested.
Page 79
9 Appendix A Table A1 Command Format Representation Item "On" Switch (1) Position 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16~19 20 21 22 23 24 25 26 27 28 29 N 0 1 N 0 0 1 N 0 0 0 1 N 0 0 0 0 1...
Page 80
Without Pxxxx<CR>, delete the current program. This request will be ignored if the controller is currently in process or edit mode. Free memory (available for programming) report to PC File directory report from HUST CNC to PC Current input-bit status (I-Bit) Current output-bit status (O-Bit)
Page 81
PC according to the format described below. The status report format (for main line) starts with Hxxoooo followed by an ASCII symbol and number, including On/Off (1/0) switch. The meanings and format for all ASCII symbols in HUST CNC controller are shown in Table A3.
Page 82
HUST H2N Connecting Manual Report Format: %<CR> O9001<CR> HxxooooX-1234.567Y-1234.890U677.777V999.999B101100000 ..<CR> Hxxoooo has the following meaning: "H" is a symbol. "xx" : Error code, 00~99. See Chap 10 of Operation Manual for details. "oooo" : Each "o" represents hexadecimal number (0~F) which has an 8-bit (1 byte) information as 0000nnnn.
Page 83
9 Appendix A o(3) --- abcd (nnnn) ab --- Not available for use at this moment. --- c=1 means the tool is at HOME position for Y-axis. --- d=1 means the tool is at HOME position for X-axis. o(4) --- abcd (nnnn), not available for use at this moment. Note: The total number of bytes in the status report should not exceed 256, including those used by DC2, DC4, % and O9001.
Page 84
HUST H2N Connecting Manual Example 4: Output Bit (O-Bit) Status Report %<CR> O9001<CR> HxxooooChhhhhhhhhhhhhh...<CR> --- (main line) 1. In addition to Hxxoooo, the main line of status report has a total of 66 bytes information, which starts with an ASCII symbol 'C' (1 byte) followed by 64 status bytes and a 'CR' (1 byte).
Page 85
The first line data after O9002<CR> will be sent to HUST controller's MCM No 1, 2nd line to MCM No 2, 3rd line to MCM No 3, and so on. Please refer to HUST CNC operator's manual for MCM parameters. Format: %<CR>...
Page 86
HUST H2N Connecting Manual To write (download) multiple MCM parameters (max. 6) to the controller, use the command format below. Use 7-digit integer for data input. Please refer to Macro G65 in Chap. 3 of Operation Manual for integer data input.
Page 87
9 Appendix A Read MCM Report Format: When use O9010 command to read MCM parameters, the data reported back to the PC are shown in the following format. The number of parameters reported is determined by Lxxxx of O9010 command. %<CR>...
Page 88
HUST H2N Connecting Manual %<CR> O9005<CR> N x x x x x x x x <CR> ----- (main line) | | | | | | | |____ 1 → S111=1 | | | | | | |______ 1 → S110=1 1 →...
Page 89
9 Appendix A Read-Variable Report Format: When use O9008 command to read G65 variables, the data reported back to the PC is shown in the following format. The number of variables reported is determined by Lxxxx of O9008 command. %<CR> O9009<CR>...
Need help?
Do you have a question about the H2N and is the answer not in the manual?
Questions and answers