12 Automation lntegration
12.3 Sample Robot - CNC Communication Sequence
171
12.3.
SAMPLE ROBOT - CNC COMMUNICATION SEQUENCE
This section presents a sample communication sequence between a robot and a ProMill 8000 machining
center, and includes sample programs.
Take Note
You may need to customize the samples for your specific CNC machine configuration.
This sample is based on a configuration that uses one CNC output Chain to File option. One could
alternatively create a working interface based on one CNC output and one CNC input, using the G and M
codes presented previously and corresponding sequences in the robot program.
This sample shows a typical sequence with a robot run by the SCORBASE programming language from
Intelitek, with the robot defined as the master and the CNC as the slave. The machine is waiting in
standby by running a program that monitors the communication channel (either a RS232 port or a file).
The robot uses program code and script to send commands to the machine and monitors the machine’s
status via an input.
Step 1
The CNC progr
am (START.NC) sets the CNC output so that the robot’s input will be ON when START.NC
is running.
START.NC (Sample)
;-------------------------------------------
; First program to run
;-------------------------------------------
M25 H11 ;USER OUT#1 ON
M20;CHAIN TO PROGRAM
CHAIN_FILE O:\project_name\WS3\MILL\CHAIN_FILE.TXT
Step 2
The robot program uses a script file similar to the script below to send commands to the CNC machine.
CHAINL.VBS (Sample)
' File: CHAIN.VBS Date: 03-10-2013
Set objArgs = WScript.Arguments
NameofFile = objArgs(0)
'WScript.Echo NameofFile
writeFile NameOfFile
Sub WriteFile(NcProgram)
Const FileDirectory = "O:\project_name\WS3\MILL\"
Const ForReading = 1, ForWriting = 2, ForAppending = 3
Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0
Dim fs, f, ts, s,TempfileName