12 Automation lntegration
12.3 Sample Robot - CNC Communication Sequence
172
Set fs = CreateObject("Scripting.FileSystemObject")
TempFileName = FileDir "chain_file.$$$"
FileName = FileDir "chain_file.txt"
fs.CreateTextFile TempFileName 'Create a file
Set f = fs.GetFile(TempFileName)
Set ts = f.OpenAsTextStream(ForWriting, TristateUseDefault)
ts.Write FileDirectory 'write into the file
ts.Write NcProgram 'write into the file
ts.Close ' close the file
fs.Copyfile TempFileName,FileName
fs.deletefile TempFileName
End Sub
Sub PLACE()
WriteFile("PLACE.NC")
End Sub
Sub OVICE()
WriteFile("OVICE.NC")
End Sub
Sub CVICE()
WriteFile("CVICE.NC")
End Sub
Sub ODOOR()
WriteFile("ODOOR.NC")
End Sub
Sub CDOOR()
WriteFile("CDOOR.NC")
End Sub
Sub SendFile(CNCProgNumber)
WriteFile(CNCProgNumber & ".nc")
End Sub
Step 3
The robot checks the input signal received from the CNC machine. If the machine signals that it is idle,
the robot will start the loading procedure. By this time the robot will already have picked one part from
a local storage device. First the robot sends a command to the CNC machine to bring the vice in loading
position.
If Input 1 Off Call Subroutine PM8000 NOT READY