12 Automation lntegration
12.4 Sample Robotic - CNC lntegration Programs
188
Call Subroutine SYNCHRONIZE_WITH_PM8000
Return from Subroutine
Remark: ************************************************************************************************
Set Subroutine PLACE VICE IN LOADING POSITION
Call Subroutine SCRIPT.PLACE
Call Subroutine SYNCHRONIZE_WITH_PM8000
Return from Subroutine
Remark: ************************************************************************************************
Set Subroutine PM8000 NOT READY
Print to Screen & Log: PM8000 NOT READY!!! CHECK AND RESTART PRODUCTION!!!
Print to Screen & Log: OR CONTINUE PRODUCTION FROM CURRENT LOCATION.
Return from Subroutine
Remark: ************************************************************************************************
Set Subroutine SHUTDOWN
Print to Screen: MOVING TO SHUTDOWN POSITION (Robot&LSB)
Go to Position 499 Speed 50 (%)
Close Gripper
Return from Subroutine
Remark: ************************************************************************************************
12.4.4.
Sample VB Script File
CHAINL.VBS
' 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
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