ABB Robot Plugin in VC4.7

I see the ABB Robot Plugin in VC4.7, but it only supports reads for the joint values in the controller, right? How do you write?

The plugin works in both directions, Server to Simulation, and Simulation to Server. The writing supports input and output signals, so sensors etc, but you cannot write the joint values.

Yeah, you’re right, but what’s the best way to do two-way communication between VC and ABB? Is OPC UA okay?

If you have an ABB controller with an OPC UA server, then it should also be fine to use that.

Yes, I can use OPC U A to connect VC to robot studio, and connect variables from server to simulation so that the virtual controller in Robot Studio controls the robot movement in VC, however, doing the same operation in impersonation to the server will cause an error,That means I can’t control robot motion in robot studio from a VC. Do you have the information to solve this problem?Thank you !

Somebody correct me if I am wrong, but I suspect that Robot Studio does not allow receiving the joint values from an external source.

1 Like

With real controllers and their virtualizations you don’t have the option to write joint values directly. That’s because the authority over positioning still is kept on the controller and you need to program the motion to that target using native programming language. That’s because with real devices it’s important to solve the path to the target. Using simulations you may forget that real devices just cannot jump to positions as easily as the simulation model can do.

With ABB the solution would be to create 6 analog input signals on the controller, connect them to VC and let VC write values into them and finally on ABB controller write a RAPID program that creates a joint target, populates it with those signal values and then calls MoveAbsJ to move the robot to that joint target. So the MoveAbsJ is the part which solves the interpolation to desired pose on the real device. With ABB there is the option Externally Guided Motion which would let you skip the RAPID code part and hand over the positioning to external controller. But it’s difficult to setup and not easily possible to integrate to VC.

-k

I created two simulators TEST1 and TEST2 in Rs like you said, and tried to match them with my axis joint value in VC, but there was still a problem with the pairing, an error: connectivity, error: OPC UA-server-write to server will fail because the pairing 1 variable exceeds the MaxNodesPerWrite server limit of 0. Try to assign paired items to multiple groups.

Additionally, I want to use socket communication, and I did the following code on the robot at the VC end:
from vcScript import *
import socket

SERVER_IP = ‘127.0.0.1’
PORT_NUMBER = 4006
SIZE = 1024

app = getApplication()
comp = getComponent()
RobotName = comp.getProperty(‘RobotName’).Value
robot = app.findComponent(RobotName)
controller = robot.findBehavioursByType(VC_ROBOTCONTROLLER)[0]
mySocket = None

def OnStart():
print (“Test client sending packets to IP {0}, via port {1}\n”.format(SERVER_IP, PORT_NUMBER))
establishSocket()

def OnReset():
global mySocket
if mySocket:
mySocket.close()
mySocket = None

def establishSocket():
global mySocket
mySocket = socket.socket( socket.AF_INET, socket.SOCK_STREAM )
mySocket.setblocking(0)

def OnRun():
global mySocket
delay(0.001)
rc = robot.findBehavioursByType(VC_ROBOTCONTROLLER)[0]
mt = rc.createTarget()
mt.MotionType = VC_MOTIONTARGET_MT_JOINT
mt.UseJoints = True
jv = mt.JointValues
#Connect socket
while True:
try:
mySocket.connect_ex((SERVER_IP, PORT_NUMBER))
break
except:
delay(0.01)

#Send or receive joint values
while True:
#Get controller state
state = getControllerState()
if state == VC_STATE_RUNNING:
#Receive joint values from server and update VC robot position
try:
data = mySocket.recv(SIZE)
data = data.translate(None, ‘[]’)
print(data)
data1 = data.split(‘,’)
for i in range(len(data1)):
try:
val = float(data1[i])
jv[i] = float(val)
except:
delay(0.001)
continue
mt.JointValues = jv
controller.moveImmediate(mt)
except:
print ‘Client could not receive data from server.’
break
delay(0.01)

elif state == VC_STATE_STOPPED:
  #Send joint values to server and update RS robot position
  controller = robot.findBehavioursByType(VC_ROBOTCONTROLLER)[0]
  j1 = controller.getJointValue(0)
  j2 = controller.getJointValue(1)
  j3 = controller.getJointValue(2)
  j4 = controller.getJointValue(3)
  j5 = controller.getJointValue(4)
  j6 = controller.getJointValue(5)
  try:
    mySocket.send(("[%f,%f,%f,%f,%f,%f]"%(j1,j2,j3,j4,j5,j6)))
    print(("[%f,%f,%f,%f,%f,%f]"%(j1,j2,j3,j4,j5,j6)))
  
  except:
    print 'Client could not connect to server.'
    break
  delay(0.01)

I find it hard to tell whether the robot is receiving or sending joint values, like this part of the code state = getControllerState(), if state == VC_STATE_RUNNING: Can you give me some help? Thank you!

I don’t know what the problem is on your example but you might have wrong signal setup on the controller. For input signals you need to set Access Level to “All” because input is written via API and not by real IO device.

Please check my example here. In the video you see my setup and the attachments contain the ABB robot backup (you can create a robot system from that backup in RS) and VC layout.

IRB1200_5_90_BACKUP_2023-08-01.zip (24.6 KB)

RS follow VC.vcmx (2.4 MB)

-k

1 Like

The example you provided is very useful to me, thank you very much! By the way, WHAT IS YOUR ABB Robot plugin based on?

VC’s ABB plugin uses ABB’s PC SDK (https://developercenter.robotstudio.com/pc-sdk).

-k

I have connected both robots in this way but the robot moves like jumping between the different positions and with a delay, is there a solution to this?

It could be that you haven’t disabled VC model’s executor (see the pic). If this is the case then the robot model gets controlled by two different sources (its own executor and connectivity connection).

-k