RoboComm in Windows Scripting
A
sample Windows Script file (RhinoTest.vbs). Clicking on a VBS
file will execute the script.
Dim Rhino ' robocom object
Dim m_move ' move object
DIm d_move ' move object
' assumes that the RoboComm interfaces are installed
Set Rhino = CreateObject("RoboComm.robocom.1")
Set m_move = CreateObject("RoboComm.Move.1")
Set d_move = CreateObject("RoboComm.Move.1")
wscript.echo "Rhino reporting"
Rhino.SetPort 1 ' com port 1
Rhino.Simulate = 1 ' does all the logical stuff but doesnt require robot
Rhino.home 'center axes about the limit switches
'assign motor steps to the axes
m_move.AuxG = 0
m_move.AuxH = 0
m_move.Base = 100
m_move.Shoulder = 100
m_move.Elbow = 100
m_move.WrstElv = 0
m_move.WrstRot = 0
m_move.Finger = 0
' report move to user
a = "m_move command " + vbcrlf
a = a + "a axis = " + cstr(m_move.Finger) + vbcrlf
a = a + "b axis = " + cstr(m_move.WrstRot) + vbcrlf
a = a + "c axis = " + cstr(m_move.WrstElv) + vbcrlf
a = a + "d axis = " + cstr(m_move.Elbow) + vbcrlf
a = a + "e axis = " + cstr(m_move.Shoulder) + vbcrlf
a = a + "f axis = " + cstr(m_move.Base) + vbcrlf
wscript.echo a
rhino.MoveR m_move ' do the move
Rhino.Where d_move ' report robot position after move
a = "robot location after move " + vbcrlf
a = a + "a axis = " + cstr(d_move.Finger) + vbcrlf
a = a + "b axis = " + cstr(d_move.WrstRot) + vbcrlf
a = a + "c axis = " + cstr(d_move.WrstElv) + vbcrlf
a = a + "d axis = " + cstr(d_move.Elbow) + vbcrlf
a = a + "e axis = " + cstr(d_move.Shoulder) + vbcrlf
a = a + "f axis = " + cstr(d_move.Base) + vbcrlf
wscript.echo a
Rhino.home ' send rhino back home
' destroy the objects created
set rhino = nothing
set m_move = nothing
set d_move = nothing