RobotComms ABB v1
RobotComms ABB v1
OVERVIEW.............................................................................................................2
1.1 Scope.......................................................................................................2
1.2 Needed Hardware....................................................................................2
1.3 Needed Software......................................................................................2
2 SERIAL COMMUNICATIONS........................................................................2
2.1 In-Sight Setup...........................................................................................2
2.2 Robot Controller RAPID code..................................................................2
2.3 In-Sight Serial Port Setup.........................................................................4
2.3.1 Input Settings....................................................................................4
2.3.2 Serial Settings...................................................................................4
2.4 In-Sight Job Setup....................................................................................5
3 ETHERNET COMMUNICATIONS..................................................................6
3.1 In-Sight Setup...........................................................................................6
3.2 Robot Controller Setup.............................................................................6
3.3 Robot Controller RAPID code..................................................................6
3.4 Job Setup.................................................................................................8
4 TROUBLE SHOOTING...................................................................................8
4.1 Serial with HyperTerminal........................................................................8
4.1.1 In-Sight Serial Port Setup.................................................................8
4.1.2 Input Settings....................................................................................8
4.1.3 Serial Settings...................................................................................9
4.1.4 Setup a Test Job.............................................................................10
4.1.5 Connect to In-Sight.........................................................................10
4.2 Verify Ethernet connection with Telnet..................................................13
4.2.1 Setup a Test Job.............................................................................13
4.2.2 Connect to In-Sight.........................................................................13
Page 1 of 13
Version 1.0 8/16/06
1 Overview
1.1 Scope
The purpose of this document is to outline the steps needed to connect and
transfer data from a Cognex In-Sight Sensor to an ABB Robot Controller. In all
of the setups outlined, the robot controller will be the device controlling the
acquisition and transfer of data. In general the robot controller, with the use of
In-Sight Native Mode commands, will trigger the sensor to acquire and process
an image and then the robot controller will request specific data from the sensor.
For a full list of Native Mode commands from In-Sight Explorer Select Help | In-
Sight Explorer Help; from the Contents tab expand Communications Reference |
Native Mode Communications and here you'll find the full list of all Basic and
Extended Native Mode commands.
2 Serial communications
2.1 In-Sight Setup
Make sure In-Sight Explorer version 3.3 or higher is installed
Make sure the sensors firmware is version 3.3 or higher
PROC Main()
MoveL pHome,v1000,fine,tVision;
GetVisionData;
MoveL Reltool(pVisionPos,nXOffs,nYOffs,0\Rz:=nAngle),v500,
fine,tGripper;
WaitTime 3;
MoveL pHome,v1000,fine,tVision;
ENDPROC
PROC GetVisionData()
VAR string XData:="";
VAR string YData:="";
VAR string AngleData:="";
VAR num NumCharacters:=9;
VAR bool bOK;
nXOffs:=0;
nYOffs:=0;
nAngle:=0;
Close ComChannel;
Open “COM2”, ComChannel \Append\Bin;
ClearIOBuff ComChannel;
WaitTime\InPos, 0.5;
PROC CheckStatus()
stReceived:=ReadStrBin(ComChannel,1\Time:=5);
IF stReceived<>"1" THEN
TPErase;
TPWrite "Vision Error!";
Page 3 of 13
Version 1.0 8/16/06
Stop;
ENDIF
ClearIOBuff ComChannel;
ENDPROC
ENDMODULE
Click OK
2.3.2 Serial Settings
Select Sensor | Serial Port Settings…
Set the following properties:
Page 4 of 13
Version 1.0 8/16/06
o Baud Rate: 115200
o Data Bits: 8
o Stop Bits: 1
o Parity: None
o Handshake: None
o Mode: Native
o Fixed Input Length: Unchecked
o Input Terminator: 13
o Output Terminator: 13
o Verify that the dialog reports that the “I/O Expansion Module is
attached”
Click OK
Page 5 of 13
Version 1.0 8/16/06
Press the Manual Trigger icon a few times to confirm that ExtractBlobs( )
data is changing.
Save the job
Turn the sensor Online
3 Ethernet Communications
3.1 In-Sight Setup
Make sure In-Sight Explorer version 3.3 or higher is installed
Make sure the sensors firmware is version 3.3 of higher
PROC Main()
ConnectToInSight ;
MoveL pHome,v1000,fine,tVision;
GetVisionData;
MoveL Reltool(pVisionPos,nXOffs,nYOffs,0\Rz:=nAngle),v500,
fine,tGripper;
WaitTime 3;
MoveL pHome,v1000,fine,tVision;
GetVisionData;
MoveL Reltool(pVisionPos,nXOffs,nYOffs,0\Rz:=nAngle),v500,
fine,tGripper;
WaitTime 3;
MoveL pHome,v1000,fine,tVision;
SocketClose ComSocket;
ENDPROC
PROC GetVisionData()
VAR string XData:="";
VAR string YData:="";
VAR string AngleData:="";
VAR num NumCharacters:=9;
Page 6 of 13
Version 1.0 8/16/06
VAR bool bOK;
nXOffs:=0;
nYOffs:=0;
nAngle:=0;
status := SocketGetStatus(ComSocket);
IF status <> SOCKET_CONNECTD THEN
TPErase;
TPWrite "Vision Sensor Not Connected";
Return;
ENDIF
PROC CheckStatus()
SocketReceive ComSocket \Str:=stReceived;
IF stReceived <> "1" THEN
TPErase;
TPWrite "Vision Error!";
Stop;
ENDIF
ENDPROC
PROC ConnectToInSight()
SocketCreate ComSocket;
SocketConnect ComSocket, "192.168.0.1", 23;
Page 7 of 13
Version 1.0 8/16/06
SocketReceive ComSocket \Str:=stReceived;
! Send Password
SocketSend ComSocket \Str:="";
ENDMODULE
4 Trouble Shooting
4.1 Serial with HyperTerminal
4.1.1 In-Sight Serial Port Setup
While connected to the sensor and Offline:
Page 8 of 13
Version 1.0 8/16/06
4.1.2 Input Settings
Select Sensor | Discrete I/O Settings | Input Settings…
For Input Module, select I/O Expansion Module
Click OK
4.1.3 Serial Settings
Select Sensor | Serial Port Settings…
Set the following properties:
Page 9 of 13
Version 1.0 8/16/06
o Stop Bits: 1
o Parity: None
o Handshake: None
o Mode: Native
o Fixed Input Length: Unchecked
o Input Terminator: 13
o Output Terminator: 13
o Verify that the dialog reports that the “I/O Expansion Module is
attached”
Click OK
4.1.4 Setup a Test Job
With a New Job perform the following steps:
o Confirm the following A0 Image cell properties (double-click cell
A0):
Trigger = External
Manual = Checked (default)
o In cell A2 type ExtractBlobs( at this point the property sheet for
ExtractBlobs should popup, click OK
o In cell A4 type FindBlobs( at this point the property sheet for
FindBlobs should popup, enter B2 for the Blobs property and then
click OK
You can test the job by clicking the Manual Trigger button on the icon bar
or selecting Image | Manual Trigger from the menus
Put the sensor Online by either clicking the Online button on the icon bar
or selecting Sensor | Online from the menus
4.1.5 Connect to In-Sight
From Windows click Start | All Programs | Accessories | Communications |
HyperTerminal
Create a New Connection
Page 10 of 13
Version 1.0 8/16/06
o Port: COM1
o Bits per second: 115200
o Data bits: 8
o Parity: None
o Stop bits: 1
o Flow Control: None
File | Properties | Settings
Page 11 of 13
Version 1.0 8/16/06
o Emulation: ANSI
o ASCII Setup (for viewing ease) set the following
Page 13 of 13
Version 1.0 8/16/06