This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
MXSC-1.5.0.jar=enabled
|
||||
MXSC-1.5.0.jar=disabled
|
||||
PuckDetection.java=disabled
|
||||
TestZMQ.java=disabled
|
||||
RobotModbus.java=disabled
|
||||
|
||||
@@ -124,5 +124,8 @@
|
||||
<Value key="0" fatherId="world[0]" />
|
||||
</Data>
|
||||
<Data name="t" access="private" xsi:type="array" type="trsf" size="1" />
|
||||
<Data name="f" access="private" xsi:type="array" type="frame" size="1">
|
||||
<Value key="0" fatherId="world[0]" />
|
||||
</Data>
|
||||
</Datas>
|
||||
</Database>
|
||||
@@ -93,7 +93,7 @@
|
||||
ex = "The variable does not exists"
|
||||
break
|
||||
case -2
|
||||
ex = "The variable library does not exists"
|
||||
ex = "The variable library does not exist"
|
||||
break
|
||||
case -3
|
||||
ex = "The index is out of range"
|
||||
@@ -130,7 +130,7 @@
|
||||
return
|
||||
break
|
||||
case -2
|
||||
ex = "The variable library does not exists"
|
||||
ex = "The variable library does not exist"
|
||||
return
|
||||
break
|
||||
case -3
|
||||
@@ -147,10 +147,10 @@
|
||||
endSwitch
|
||||
endFor
|
||||
break
|
||||
case "get_str"
|
||||
$exec("s = " + args[0])
|
||||
tx = s
|
||||
break
|
||||
//case "get_str"
|
||||
// //$exec("s = " + args[0]) TODO: MAKES THE CONTROLLER TO CRASH!
|
||||
// //tx = s
|
||||
//break
|
||||
case "get_pnt"
|
||||
$exec("p = " + args[0])
|
||||
$exec("t = " + args[0])
|
||||
|
||||
@@ -19,7 +19,8 @@
|
||||
case "mount"
|
||||
toNum(args[0], puck, ok)
|
||||
toNum(args[1], sample, ok)
|
||||
tx = "Mounting sample " + toString("", puck) + ":" + toString("", sample)
|
||||
tx = "Mounting sample " + toString("", puck) + ":" + toString("", sample)
|
||||
//taskCreate "mount",10,mount(puck, sample)
|
||||
break
|
||||
default
|
||||
ex = "Invalid command: " + cmd
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Programs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.staubli.com/robotics/VAL3/Program/2">
|
||||
<Program name="simulateEvents">
|
||||
<Parameters xmlns="http://www.staubli.com/robotics/VAL3/Param/1">
|
||||
<Parameter name="interval" type="num" xsi:type="element" />
|
||||
</Parameters>
|
||||
<Locals>
|
||||
<Local name="str" type="string" xsi:type="array" size="1" />
|
||||
</Locals>
|
||||
<Code><![CDATA[begin
|
||||
while true
|
||||
delay(3)
|
||||
delay(interval)
|
||||
if isPowered()
|
||||
str = "ON"
|
||||
else
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
taskCreate "com_modbus",10,comModbus()
|
||||
taskCreate "com_tcp",10,comTcp()
|
||||
taskCreate "sim_ev",10,simulateEvents()
|
||||
//taskCreate "sim_ev",10,simulateEvents(interval)
|
||||
|
||||
while true
|
||||
movel(pForce1,flange,mNomSpeed)
|
||||
|
||||
@@ -66,9 +66,10 @@ class RobotTCP(TcpDevice, Stoppable):
|
||||
|
||||
def get_var(self, name):
|
||||
return self.execute('get_var', name)
|
||||
|
||||
def get_str(self, name='s'):
|
||||
return self.execute('get_str', name)
|
||||
|
||||
#Makes app crash
|
||||
#def get_str(self, name='s'):
|
||||
# return self.execute('get_str', name)
|
||||
|
||||
def get_arr(self, name, size):
|
||||
return self.execute('get_arr', name, size)
|
||||
@@ -134,9 +135,9 @@ class RobotTCP(TcpDevice, Stoppable):
|
||||
self.evaluate("b=" + cmd)
|
||||
return self.get_bool()
|
||||
|
||||
def eval_str(self, cmd):
|
||||
self.evaluate("s=" + cmd)
|
||||
return self.get_str()
|
||||
#def eval_str(self, cmd):
|
||||
# self.evaluate("s=" + cmd)
|
||||
# return self.get_str()
|
||||
|
||||
def eval_jnt(self, cmd):
|
||||
self.evaluate("j=" + cmd)
|
||||
@@ -207,9 +208,9 @@ class RobotTCP(TcpDevice, Stoppable):
|
||||
|
||||
def get_safety_fault_signal(self):
|
||||
fault = self.eval_bool("safetyFault(s)")
|
||||
if (fault):
|
||||
return get_str()
|
||||
|
||||
#if (fault):
|
||||
# return get_str()
|
||||
return fault
|
||||
|
||||
#Motion control
|
||||
def stop(self):
|
||||
@@ -311,8 +312,8 @@ class RobotTCP(TcpDevice, Stoppable):
|
||||
|
||||
def get_task_status(self, name):
|
||||
code = self.eval_int('taskStatus("' + str(name)+ '")')
|
||||
status = self.eval_str('help(' + str(code)+ ')')
|
||||
return [code, status]
|
||||
#status = self.eval_str('help(' + str(code)+ ')')
|
||||
return code
|
||||
|
||||
#Updating
|
||||
def update_status(self):
|
||||
|
||||
Reference in New Issue
Block a user