0% found this document useful (0 votes)
53 views61 pages

BOA Spot Communication Guide v1.1

Uploaded by

chocho gay
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views61 pages

BOA Spot Communication Guide v1.1

Uploaded by

chocho gay
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 61

BOA Spot

Communication
Guide

BOA Spot Communication 1 Version 1.1; 2016-07-14


Notice
BOA Spot Communications Guide
Document Number 405-00061-00

Copyright © 2016 Teledyne DALSA Incorporated.


All rights reserved.

All copyrights in this manual, and the hardware and software described in it, are the
exclusive property of Teledyne DALSA Incorporated and its licensors.
Claim of copyright does not imply waiver of Teledyne DALSA Incorporated or its licensors
other rights in the work. See the following Notice of Proprietary Rights.

NOTICE OF PROPRIETARY RIGHTS

This manual and the related hardware and software are confidential trade secrets and the
property of Teledyne DALSA Incorporated and its licensors. Use, examination,
reproduction, copying, transfer and/or disclosure to others of all or any part of this manual
and the related documentation are prohibited except with the express written consent of
Teledyne DALSA Incorporated.

The information in this document is subject to change without notice. Teledyne DALSA
Incorporated makes no representations or warranties with respect to the contents of this
manual and specifically disclaims any implied warranties of merchantability or fitness for a
particular purpose. Teledyne DALSA Incorporated assumes no responsibility for errors or
omissions in this document.

The Teledyne DALSA logo is a trademark of Teledyne DALSA Incorporated. All


other trademarks are the property of their respective owners.

Teledyne DALSA Industrial Products


Information: [email protected]
Support: [email protected]
Web: http://www.teledynedalsa.com/visionsystems

700 Technology Park Drive


Billerica, MA, USA 01821

Tel 1.978.670.2002 Fax 1.978.670.2010

BOA Spot Communication 2 Version 1.1; 2016-07-14


Table Of Contents

Introduction Overview ……………………............................ 4

PLC Names & Languages ……………………............................ 5


Connections Serial RS232 Stream ……………………............................ 6

TCP/IP Stream ……………………............................ 8


PLCs Control Logix (Ethernet) ……………………............................ 11
Ethernet-IP ……………………............................ 19
Omron C (Serial) ……………………............................ 24

Omron (Ethernet-IP) ……………………............................ 27

Melsec (Ethernet) ……………………............................ 33

Profinet (Ethernet) ……………………............................ 39

Modbus (Ethernet) ……………………............................ 46


Fanuc SNP (Serial) ……………………............................ 50
Fanuc SRTP (Ethernet) ……………………............................ 54
Motoman (Serial) ………………………………………... 58

In This Manual
Blue text such as Tip or Note indicates useful information.
Blue text in a code example is a comment to the code, such as // send results data.
Red text such as Note indicates important or critical information.

BOA Spot Communication 3 Version 1.1; 2016-07-14


Introduction

Overview
This manual describes configuring the BOA Spot for communication with serial and TCP
ports, and with several different types of PLCs. In some cases, instructions are also
given for adding the BOA Spot into the PLC program environment.
This manual does not cover programming the PLC. Advanced knowledge of the
language specific to your PLC is required to program the factory floor environment.
Please refer to the PLC Manufacturer or Distributor for training or tutorials.
Note: Most PLCs have a separate read space and write space. They do not use the
same registers for both inputs and outputs. This means you cannot write a value to a
register, and read it back again. The PLC must be programmed to copy the value to a
register you can read, or write expected values into registers you can read.

Tip: Start small, by writing a single string or number to your destination or PLC. You can
add more instructions and controls after you have successfully established
communication between devices.

Tip: In most cases, it is useful to start with the BOA Spot using the Internal Timer.
• Internal Timer is useful for focusing the camera on a still object.
• External Trigger is used with moving parts and a part-in-place sensor.
• Software Trigger is used with a trigger signal from a PLC, or a command from
another device.

Some examples show a “heartbeat” variable. This is to let the PLC program know the
camera is “alive” and functioning. Some PLC programs require a heartbeat from all
connected devices, and some do not. Some programmers prefer to always include the
heartbeat, while others question its usefulness.
Some examples have a “inspBusy” variable, to signal the PLC the inspection program
is executing. This variable is not fully implemented in the example. You could optionally
send the busy status to the PLC if it is useful to your programming.
IMPORTANT: Editing Scripts and measurement Tools changes the "run mode", and
disables solution switching. In some cases, editing scripts can interrupt normal
communication with PLCs and peripherals. Save your Solution and then reload it
(same solution) if you encounter problems. Loading a solution resets the run mode;
unless you select the "Load for Edit/Disable switching" option.

BOA Spot Communication 4 Version 1.1; 2016-07-14


PLC Names and Protocols
There are several different types of PLC communication “Protocols” developed by
different companies. This is only a partial list, made up of those companies and
protocols the BOA Spot has been interfaced to.

EIP stands for Ethernet IP, also referred to as TCP or TCP/IP. These are general (not
precise) terms used for communication over an Ethernet network.
Protocol refers to a language or a communication standard. It can refer to software or
hardware methods of communication.
PLC stands for Programmable Logic Controller. Usually PLCs control a distributed
system of sensors, relays, switches and controls on an industrial production line.

AB or Allen Bradley systems may use either the Ethernet IP or Control Logix
protocols on Ethernet. The Allen Bradley brand is owned by Rockwell.
FANUC Corp. makes systems which use SNP on Serial, and SRTP/FINS on Ethernet.
Siemens makes the Simatec systems, which use the Profinet UDP protocol on
Ethernet.
Mistubishi systems use the MELSEC protocol, available on both Serial and Ethernet.
Several manufacturers produce systems which use the Modbus protocol on Serial or
EIP. Modbus is an open source, royalty free protocol used by several companies. The
rights to development and maintenance were transferred to The Modbus Organization.
OMRON systems use multiple protocols: the Ethernet IP protocol, the OMRON C
protocol on Serial, or OMRON C UDP on Ethernet.
Rockwell produces Compact Logic and RSLogix systems, which may use either the
Ethernet IP or Control Logix protocols on Ethernet.
Yaskawa Electric Corp. and Yaskawa Motoman produces Robotic and automated
systems which use the Motoman protocol, available on Serial.

Note: The Windows Firewall should be turned off (or customized) on systems that
communicate over the network (TCP or EIP). This does not apply to devices using
Serial communication.

BOA Spot Communication 5 Version 1.1; 2016-07-14


Serial Port

The Serial port or “RS232 Stream” is used for general communication such as
messaging or data.
Configure the BOA Spot
1. Load or create a simple Solution with one
or two measurements.
2. In the Navigation bar, click on Setup
Connections.
3. In the drop-list, select RS232 Stream
Settings. The center of the Setup panel
changes, to configure BOA Spot for Serial
communication. The standard serial port
parameters are available for Baud Rate
(bits per second), Data bits, Stop Bits,
Parity and Flow Control.
4. Configure BOA Spot to match the settings
used by your devices. Settings must match
for correct operation.
5. Click the “Apply” button.
Note: Not all serial devices support all the available settings. BOA Spot does not
support Baud Rates 110, 300, 1200 and 14400. Flow Control “software and “none” are
supported, “hardware” is not supported.
To test your setup:
Requires a PC running HyperTerminal, Telnet or TeraTerm.
1.Create or load a simple Solution, and configure the BOA Spot Serial port.
2.Click on the “Edit Scripts” button in the Navigation bar.
3.Click on the “Post Processing Function” and open the Edit window. Enter only one of
the following two statements:
COM3 = “Hello”
or
PutPortString(“\r\nHello”) \\ carriage return and new line
4. Click OK, and Run the Solution.
5. Open HyperTerminal, Telnet or TeraTerm on a PC, and configure the Serial Port
settings to match the BOA Spot settings.
6. When you connect to the BOA Spot, you should see the message “Hello” repeating
on your monitor.

BOA Spot Communication 6 Version 1.1; 2016-07-14


Serial Port

You can create more complex strings using the Free Edit window and the String
Formatting window. You can use the following functions in script statements, to read
and write to the Serial port:
PutPortString GetPortChar GetPortString WriteFormatString
Note: The function PutPortString sends the exact string, without evaluating variables.
The function WriteFormatString does evaluate variables.
Please refer to “Keyboard / Serial IO Functions” in the BOA Spot Scripting User Manual
or the BOA Spot on-line Help for full syntax, explanations, and some examples.

Troubleshooting Serial Port Problems


Problem: No communication. Messages from BOA Spot do not appear in
HyperTerminal, Telnet or TeraTerm.
Reason: Serial port problems are most often caused by (1) incorrect wiring or (2)
incompatible settings between BOA and the connecting equipment.
Solution 1: Check your wiring carefully. It is very important to have a ground
connection between the serial port on BOA Spot (or PL-101) and the other devices.
Solution 2: Check the serial port settings on your BOA Spot and on your other Serial
Port devices. All settings must be identical on both devices.
Note: When the BOA Spot application launches, the baud rate is set to 38400, unless
you are loading a saved Solution with different settings.
Setting HyperTerminal to match this baud (or your changes) and typing “help” will
display the serial commands supported by BOA Spot.
During power-up (only), BOA Spot boots with the following serial port settings:
115200 bits per second
8 data bits
No parity
1 Stop bit
No flow control
If you connect a PC through HyperTerminal with these settings you should see activity
during power-up.
Solution 3: Save and reload your solution file. See “Important” on page 4.
Problem: Cannot find HyperTerminal, Telnet or TeraTerm on my Windows 7 PC.
Solution: : Telnet is not enabled by default. HyperTerminal is not included on W7.
TeraTerm is a third party program not included in Windows. Please see page 11.

BOA Spot Communication 7 Version 1.1; 2016-07-14


Serial Port

You can create more complex strings using the Free Edit window and the String
Formatting window. You can use the following functions in script statements, to read
and write to the Serial port:
PutPortString GetPortChar GetPortString WriteFormatString
Note: The function PutPortString sends the exact string, without evaluating variables.
The function WriteFormatString does evaluate variables.
Please refer to “Keyboard / Serial IO Functions” in the BOA Spot Scripting User Manual
or the BOA Spot on-line Help for full syntax, explanations, and some examples.

Troubleshooting Serial Port Problems


Problem: No communication. Messages from BOA Spot do not appear in
HyperTerminal, Telnet or TeraTerm.
Reason: Serial port problems are most often caused by (1) incorrect wiring or (2)
incompatible settings between BOA and the connecting equipment.
Solution 1: Check your wiring carefully. It is very important to have a ground
connection between the serial port on BOA Spot (or PL-101) and the other devices.
Solution 2: Check the serial port settings on your BOA Spot and on your other Serial
Port devices. All settings must be identical on both devices.
Note: When the BOA Spot application launches, the baud rate is set to 38400, unless
you are loading a saved Solution with different settings.
Setting HyperTerminal to match this baud (or your changes) and typing “help” will
display the serial commands supported by BOA Spot.
During power-up (only), BOA Spot boots with the following serial port settings:
115200 bits per second
8 data bits
No parity
1 Stop bit
No flow control
If you connect a PC through HyperTerminal with these settings you should see activity
during power-up.
Solution 3: Save and reload your solution file. See “Important” on page 4.
Problem: Cannot find HyperTerminal, Telnet or TeraTerm on my Windows 7 PC.
Solution: : Telnet is not enabled by default. HyperTerminal is not included on W7.
TeraTerm is a third party program not included in Windows. Please see page 11.

BOA Spot Communication 8 Version 1.1; 2016-07-14


TCP/IP Stream
The TCP/IP Stream is used for general communication with devices, such as output
messaging or data. The TCP/IP Stream setup is not usually used with a PLC. There are
customized setups available for different PLCs.
Configure the BOA Spot
1. Load or create a simple Solution with one or
two measurements.
2. In the Navigation Bar, click Setup
Connections.
3. Use the drop list to select “TCP/IP Stream”.
The center of the Setup panel changes, to
configure the BOA Spot for TCP/IP
communication.
4. Select the BOA Spot to act as a Client or
Server. If the BOA Sport is a client, enter the
IP Address of the Server, where data is sent.
You can use the default variable name, or
change it. This variable is used in your script
statements, when reading or writing to the
TCP/IP server or client device.
5. Click the “Add TCP/IP Destination” button.
Your variable and definition appears in the Note: The default on port 5024 is
“Destination” drop list. already defined. You can add more
To test your setup: destinations.
Requires a PC running HyperTerminal, Telnet or TeraTerm.
1. Create or load a simple Solution, and configure the BOA Spot TCP/IP stream.
2. Click on the “Edit Scripts” button in the Navigation bar.
3. Click on the “Post Processing Function” and open the Edit window.
Enter the following statement:
WriteString(TcpP5025, “\n\rHello Spot” )
4. Click OK, and Run the Solution.
5. Open HyperTerminal, Telnet or TeraTerm on a PC, and select TCP
or Ethernet communication. Enter the BOA Spot IP Address and port number (5025
is shown above).
6. When you connect to the BOA Spot, you should see the message “Hello Spot”
repeating on your monitor.

BOA Spot Communication 9 Version 1.1; 2016-07-14


TCP/IP Stream

You can create more complex strings using the Free Edit window and the String
Formatting window. Use the following functions to read or write to the TCP/IP network:
ReadByte, ReadString, WriteBytes, WriteString, WriteFormatString
Other useful TCP/IP functions available:
Disconnect, IsConnected, SendEmail, SetEmailInfo
Refer to “Comm / TCP/IP Functions” in the BOA Spot Scripting User Manual or in the
BOA Spot on-line Help for full syntax, explanations, and some examples.
TCP/IP Example
In this example, Port 5024 is used for communication. The BOA Spot-EL uses a Match
Tool to find a part, and sends the image pixel X,Y coordinates [EL only] and Angle to a
PC or a robot. Note: The Robot arm setup should have routines for calibrating the arm
positions to the image window corners.
In the Post Process function:
//
WriteFormatString( TcpP5024 , "\n\rX=[PX%3.2f], Y=[PY%3.2f], Theta=[MR%3.1f],
Result = [Result.0%d]\n\r" ) // X, Y, Angle & Result Note: EL only
The BOA Spot receives commands to trigger and change Solutions. The first character
in the string is Trigger. The second character is a Solution number. The current Solution
is 0. The string “T2” changes to Solution 2, and triggers the camera. The Solution test
statement is different in each Solution. This test is: “not solution 0” (the current solution)
and “a number less than 9” (valid solution numbers 0 through 8).
In the Periodic: 200 ms function:

ReadBuffer = ReadString( TcpP5024 , 13 ) // 13 is the end character


if(ReadBuffer != "") // if NOT an empty string
CommandString = ReadBuffer
Counter = Counter + 1 // examine one character at a time
CommandCharacter = Substring(CommandString, 1, 1) // trigger command
ProgramNumber = Substring(CommandString, 2, 1) // Solution number
if(INT(ProgramNumber) >0 AND INT(ProgramNumber)<9) // test for Solution 1 – 8
ChangeSolutionID(ProgramNumber)
endif
if(CommandCharacter = "T")
trigger()
endif
endif

BOA Spot Communication 10 Version 1.1; 2016-07-14


TCP/IP Stream

Note: The solution change test should be modified for each different Solution file. You
want to change the Solution when ProgramNumber is not equal to the current solution
ID number. In the script example shown above, the current solution is 0, and the
change request is only valid when ProgramNumber is larger than zero. For example, in
Solution02, you can use: if(ProgramNumber != 2) the “!=“ means “not equal to”.
You can restrict the test to valid Solution numbers, but that is not recommended
because each time you add a new solution, every solution file would have to be edited.
Note: The Windows Firewall should be turned off (or customized) on systems that
communicate over the network.
Troubleshooting TCP/IP Problems
Problem: No communication. Messages from BOA Spot do not appear in
HyperTerminal or Telnet.
Reason: TCP/IP problems are most often caused by incompatible settings between
BOA and the connecting equipment.
Solution 1: Check the settings on your BOA Spot and on your other TCP/IP devices.
The Client device needs the IP Address and Port number of the Server device.
Check that the devices are on the same network, and are accessible (no address
conflicts, and no security conflicts). On the PC, open a Command Prompt window and
type “ping” and the IP Address of the BOA Spot, for example: ping 192.168.0.100
The Command Prompt window should show a number of bytes sent and received from
BOA Spot. If data is not received, verify the BOA Spot is booted and the Ethernet cable
is attached at both ends.
Solution 2: Save and reload your solution file. See “Important” on page 4.
Problem: Cannot find HyperTerminal, Telnet or TeraTerm on my Windows 7 PC.
Reason: Telnet is not enabled by default. HyperTerminal is not included on W7.
TeraTerm is a third party program not included in Windows.
Solution 1: To enable Telnet on W7:
1. Click the Start button and select “Control Panel”.
2. Select “Programs and Features”.
3. Select “Turn Windows features on or off”.
4. Scroll down to find “Telnet” and check the box beside it.
5. Click “OK”. Use the “Run” field or “Command Prompt” window to start Telnet.
Solution 2: Download HyperTerminal or TeraTerm.

BOA Spot Communication 11 Version 1.1; 2016-07-14


Control Logix PLC
Configure the PLC for BOA Spot
Rockwell Compact and Allen Bradley PLCs may use either the Control Logix protocol,
or the Ethernet IP Protocol. The Control Logix protocol is usually used for “Tag based”
or “Explicit” Communication. You should create Tags in the Control Logix program
before configuring BOA Spot, so there are tags to query and select.

1. Open the PLC programming environment. This


example shows the RSLogix5000.
2. Right-click on the “Ethernet Connection” and
select “New Module”.

3. In the next pop-up (below) select “Generic


Ethernet Module”.

Note: BOA Spot software works with Rockwell Control Logix products using versions
R18 through R27.

BOA Spot Communication 12 Version 1.1; 2016-07-14


Control Logix

4. In the New Module menu click the “General” tab if there are tabs. Give the camera a
name like “BOA_SPOT” or “TeledyneDALSA”. Leave the “Comm Format” setting at
Data-DINT. Enter the Input, Output
and Configuration data for the
“Assembly Instance” and “Size” as
shown:
Input: 2, 32
Output: 1, 31
Configuration: 1, 0
If you need more than 30 registers for
your application, use the following
settings:
Input: 2, 125
Output: 1, 124
Configuration: 1, 0

5. Enter the address of your BOA Spot in “IP address”.


6. Make sure the “Open Module Properties” box is checked and click “OK”.
7. In the Module Properties menu (below) click on the Connection tab (if there are tabs).

8. Enter a “Requested Packet


Interval (RPI)” of 100 ms.
This is the time interval that the
Logix processor will request new
data from the BOA Spot. Depending
on network traffic, this number may
need to be larger.

9. Click “OK”.

BOA Spot Communication 13 Version 1.1; 2016-07-14


Control Logix

10. Create Controller Tags as needed for your application. These can be standard
format or User Defined Tags. It is helpful to name the tags such that they are easy to
recognize when they are imported to the BOA Spot.
In the example below, all tags start with “Cam2”.

11. Download the program to the PLC, and run it. It should automatically compile before
downloading.

Note: The Windows Firewall should be turned off (or customized) on systems that
communicate over the network.

BOA Spot Communication 14 Version 1.1; 2016-07-14


Control Logix

Configure the BOA Spot


1. Load or create a simple Solution with one or
two measurements.
2. In the Navigation bar, click on Setup
Connections.
3. Use the drop list to select Control Logix
PLC. The center of the Setup panel
changes, to configure BOA Spot for Control
Logix communication.
4. Enter the IP Address of the PLC. Enter a
CPU Slot number if your PLC has multiple
CPUs. Use 0 if there are not multiple CPUs.
5. Click the “Query Objs” button, and wait for
the list to populate. The BOA Spot asks the
PLC for Tags used in its program. This can
take time if the PLC program has many
tags.
6. Scroll through the list and click on the
variables your BOA Spot program needs.
This field allows multiple selections.
7. You can add an optional Variable name ( in
Var Name) to help you identify the PLC
variables in your program. This example
shows variable “Clx115”.
8. Click “Add Control Logix PLC Destination” .
Your PLC definition appears in the “PLC
Destination” list box.

In a factory floor program there would me many more variables listed for all equipment
the PLC communicates with.

BOA Spot Communication 15 Version 1.1; 2016-07-14


Control Logix

Now add scripts to communicate with the PLC.


1.In the Navigation bar, click on “Edit Scripts”.
2.In the setup panel (Left) click on “Post Image Process”.
3.In the bottom panel below the image area, click the “Edit” button.
4.Add equations or statements that read or write to the Control Logix Tags. You can use
the “Variable” button and menus to add your variables.

In the Post Image Process function:


// send data to PLC
Clx115.Cam2_Data1 = IntenAvg
// send overall result to PLC
Clx115.Cam2_Result = Result.0
// set a flag inspection is done
inspBusy = 0

5. Click the “Check Syntax” button to check for errors.


6. Click the “Save” button, to save and close the Free Edit window.

Tip: Start with writing one number to the PLC. You can add more instructions and
controls after you have successfully established communication with the PLC.

In most applications, you want the BOA Spot to change solutions and trigger on signals
from the PLC.

1. In the Edit Scripts setup panel click on “Periodic: 200 ms”.


2. In the bottom panel below the image area, click the “Edit”
button.

3. Add statements that will change the solution file, trigger the BOA Spot, clear and then
rearm the trigger. (example shown on the next page)

Note: The “heartbeat” is not used by the BOA Spot, but we have seen many customers
prefer to include it in their PLC programs. Some PLCs may require it.
The “inspBusy” variable is not fully implemented in this example. You could send it to
the PLC to tell it the Solution is running.

BOA Spot Communication 16 Version 1.1; 2016-07-14


Control Logix

In the Periodic: 200 ms function:


// send current solution ID to PLC
Clx115.Cam2_CurrentProgram = GetSolutionID()
// get any solution change request from PLC
solReq = Clx115.Cam2_ProgramReq
if(solReq > 0) // this test statement is different in every Solution
ChangeSolution(solReq)
endif
//
// get any trigger request from PLC
trigReq = Clx115.Cam2_Trigger
// only trigger on leading edge of register transition
if((trigReq = 1) AND (trigArmed = 1)
trigArmed = 0
inspBusy = 1
trigger()
endif
// re-arm trigger when PLC register is 0
if(trigReq = 0) trigArmed = 1
//
// note PLC connection status
plcStat = IsConnected(Clx115)
//
// send heartbeat count
hb = hb + 1
if(hb > 999) hb = 1
Clx115.Cam2_Heartbeat = hb

4. Click the Check Syntax button.


5. Click Save to save changes and close the Edit menu.
6. Save and Run the Solution.

Note: The solution change test should be modified for each different Solution file. You
want to change the Solution when “solReq” is not equal to the current solution ID
number. In the script example shown above, the current solution is 0, and the change
request is only valid when solReq is larger than zero. For example, in Solution02, you
can use: if(solReq != 2) The “!=“ means “not equal to”.
You can test to restrict solReq to valid Solution numbers, but that is not recommended
because each time you add a new solution, every solution file would have to be edited.

BOA Spot Communication 17 Version 1.1; 2016-07-14


Control Logix

With the Solution running on the BOA Spot, you can monitor communication between
the PLC and BOA Spot in the RSLogix5000 program window.

BOA Spot Communication 18 Version 1.1; 2016-07-14


Control Logix

Tip: Each tag read takes time. If a Control Logix Tag data is needed repeatedly in a
script, it is advisable to read the tag once rather than several times in a script.
The script on the left contains 5 tag reads vs. 1 tag read in the script on the right. (Less
communications traffic!)
// WRONG METHOD // CORRECT METHOD
// Fail inspection based on enabled tests // Fail inspection based on enabled tests
// in PLC configuration. // in PLC configuration.
// //
if(Clx115.Cam1_Test1Enabled = 1) test1Enab = Clx115.Cam1_Test1Enabled
if(Test1.Result != 1) FAIL = 1 if(test1Enab = 1)
endif if(Test1.Result != 1) FAIL = 1
if(Clx115.Cam1_Test1Enabled = 1) endif
if(Test2.Result != 1) FAIL = 1 if(test1Enab = 1)
endif if(Test2.Result != 1) FAIL = 1
if(Clx115.Cam1_Test1Enabled = 1) endif
if(Test3.Result != 1) FAIL = 1 if(test1Enab = 1)
endif if(Test3.Result != 1) FAIL = 1
if(Clx115.Cam1_Test1Enabled = 1) endif
if(Test4.Result != 1) FAIL = 1 if(test1Enab = 1)
endif if(Test4.Result != 1) FAIL = 1
if(Clx115.Cam1_Test1Enabled = 1) endif
if(Test5.Result != 1) FAIL = 1 if(test1Enab = 1)
endif if(Test5.Result != 1) FAIL = 1
endif

The point of this example is to illustrate the method of reading the tag once rather than
several times in a script. (The script could certainly be optimized further!).
We have observed that the Control Logix PLC takes 15 ms for each tag read during
operation. Functions that read more than one tag must allow sufficient time for each
tag to be read. For example, if a periodic function reads 5 tags, you must allow a
minimum of 75 ms to read all 5 tags.

BOA Spot Communication 19 Version 1.1; 2016-07-14


Ethernet IP PLC

BOA Spot is compatible with PLCs that use Ethernet-IP communication. For example,
Rockwell and Allen Bradley PLCs use Ethernet-IP for Implicit communication (no Tags).
Configure the BOA Spot
1. Load or create a simple Solution with one
or two measurements.
2. In the Navigation bar, click on Setup
Connections.
3. Use the drop list to select “Ethernet-IP
PLC”. The center of the Setup panel
changes to configure BOA Spot for
Ethernet-IP communication.
4. Select a Register type (selected “dint” for
this example), and enter the base address
of the registers assigned to the BOA Spot,
in the PLC address space.
There are several different register types.
Each performs a specific task, and has a
specific data type it will accept.
5. You can change the variable name, or use
the default.
6. Click the “Add Ethernet-IP destination”
button. Your definition appears in the “PLC
Destination” list box.
Notice the Read/Write example just below the “Add” button. The examples are given
for the default variable name “EIPdint”. These are the type of statements you would use
in the Script Editor to read values from or write values to the PLC. The default name
also indicates the register type. “dint” is for a signed 32-bit integer (double length
integer).
EIPdint[20] = L1 + 5
Write the sum of L1 plus 5 to the PLC Input register at offset 20.
X1=EIPdint[32] + 64.0
Read the value in the PLC Output register at offset 32, add 64.0 to the value, and store
it in variable X1.

Note: The Input Registers and Output Registers are at separate spaces in this method.

BOA Spot Communication 20 Version 1.1; 2016-07-14


Ethernet-IP

Now add scripts to communicate with the PLC.


1.In the Navigation bar, click on “Edit Scripts”.
2.In the setup panel (Left) click on “Post Image Process”.
3.In the bottom panel below the image area, click the “Edit” button.
4.Add equations or statements that read or write to the PLC. Use the “Variable” button
and menus to add your variables.

In the Post Image Process function:


//Send results to the PLC Input registers
EIPdint[0] = IntenAvg
EIPdint[1] = L
EIPdint[2] = Result.0
// inspection is done status
inspBusy = 0

5. Click the “Check Syntax” button to check for errors.


6. Click the “Save” button, to save and close the Free Edit window.

Tip: Start with writing one number to the PLC. You can add more instructions and
controls after you have successfully established communication with the PLC.

In most applications, you want the BOA Spot to switch Solution and trigger on a signal
from the PLC.
7. In the Edit Scripts setup panel click on “Periodic: 200 ms”.
8. In the bottom panel below the image area, click the “Edit”
button.

9. Add statements that tell the PLC which solution is running, and read a solution
change request from the PLC output registers. (example on the next page)
10. Add statements that trigger the BOA Spot, clear and then rearm the trigger.
(example on the next page)

Note: The “heartbeat” is not used by the BOA Spot, but we have seen many customers
prefer to include it in their PLC programs. Some PLCs may require it.
The “inspBusy” variable is not fully implemented in this example. You could send it to
the PLC to tell it the Solution is running.

BOA Spot Communication 21 Version 1.1; 2016-07-14


Ethernet-IP

In the Periodic: 200 ms function:


//Send current solution to PLC
EIPdint[3] = GetSolutionID()
EIPdint[4] = Global.FrameCount
// get any solution change request from PLC Output registers
solReq = EIPdint[1]
if(solReq > 0) //this test statement is different in each Solution
ChangeSolution(solReq)
endif
//
// get any trigger request from PLC output registers
trigReq = EIPdint[0]
// only trigger on leading edge of the register transition
if((trigReq = 1) AND (trigArmed = 1))
trigArmed = 0 // prevents multiple triggers
inspBusy = 1 // the inspection is running
trigger()
endif
//re-arm trigger when PLC register is 0
if(trigReq = 0) trigArmed = 1
//note PLC connection status
plcStat = IsConnected(EIPdint)
//
//send heartbeat count
hb = hb + 1
if(hb > 999) hb = 1
EIPdint[5] = hb

11. Check for syntax errors.


12. Click “Save” to save changes and close the Edit window.
13. Save and then Run the Solution.
Note: The solution change test should be modified for each different Solution file. You
want to change the Solution when solReq is not equal to the current solution ID number.
In the script example shown above, the current solution is 0, and the change request is
only valid when solReq is larger than zero. For example, in Solution02, you can use:
if(solReq != 2) The “!=“ means “not equal to”.
You can test to restrict solReq to valid Solution numbers, but that is not recommended
because each time you add a new solution, every solution file would have to be edited.

BOA Spot Communication 22 Version 1.1; 2016-07-14


Ethernet-IP

Configure the PLC for BOA Spot


1. Open the PLC programming environment. This
example shows the RSLogix5000.
2. Right-click on the “Ethernet Connection” and
select “New Module”.
3. In the next pop-up (below) select “Generic
Ethernet Module”.

4. In the New Module menu, give the


camera a name like BOA (shown) or
BOA_Spot. Leave the Comm
Format at Data-DINT. Enter the IP
Address of your BOA Spot.
5. Enter the Input, Output and
Configuration data for the “Assembly
Instance” and “Size” as shown:
Input: 2, 32
Output: 1, 31
Configuration: 1, 0
6. Verify the “Open Module Properties”
box is checked and click “OK”

Note: If you need to read and write more than 30 register values, you could use the
following settings: Input: 2, 125 Output: 2, 124, Configuration 1, 0
Note: Windows Firewall should be turned off (or customized).

BOA Spot Communication 23 Version 1.1; 2016-07-14


Ethernet-IP

7. In the Module Properties menu,


click on the Connection tab. Enter
a “Requested Packet Interval
(RPI)” not less than 30 ms (as
shown). This is the time interval
that the Logix processor will
request new data from the BOA
Spot. Depending on network
traffic, this number may need to be
much larger (150 ms).
8. Click “OK”.
9. Save, and Download to the PLC.

The program will compile before downloading to the PLC. You can also manually
compile before downloading.
If the BOA Spot is running, you should now be able to see values being updated, by
monitoring the PLC Input registers.
Note: The BOA Spot write to EIP[0] maps to the PLC location I:DATA[1] (I for Input).
This does not happen on a read. EIP[0] maps to PLC location O:DATA[0]. This is
important to your PLC programming.
I:Data[1] = EIP[0] = IntenAvg, I:Data[2] = L, I:Data[3] = Result.0, I:DATA[4] =
SOLUTION, I:Data[5] = Global.FrameCount, I:Data[6] = hb, I:Data [7] through [32] are
not used in this example.
Note: This screen
shows only the
Input registers. The
Output registers
are at a different
location. The
Solution Change
and Trigger request
do not appear in
the Input registers.

BOA Spot Communication 24 Version 1.1; 2016-07-14


OMRON C PLC

BOA Spot is compatible with Omron PLC using a few different modes, depending on
the Omron model and software capabilities: Omron C Serial, Omron C using UDC/IP
FINS, and Ethernet-IP. For the Ethernet-IP setup (not an “Omron C”) see page 27.
Configure the BOA Spot
1. In the Navigation bar, click on Setup
Connections.
2. Use the drop list to select “Omron PLC”.
The center of the Setup panel changes to
configure the BOA Spot for Omron
communication.
3. You can select a UDP/IP connection and
enter the PLC’s IP Address. Or select a Serial
connection and change the Serial port
settings to match your PLC Host Link
Interface. This example uses Serial.
4. Enter the Station or Node number and Target
number (use 0 if you are not sure).
5. Select a Register type, Register address
(index) Device (if applicable) and Variable
Name.
There are several different register types. Each
performs a specific task, and has a specific data
type it will accept.
6. Click “Add Omron PLC destination”. Your
definition appears in the “PLC Destination”
list box. Repeat for different register types.
Notice the Read/Write example just below the
“Add” button. The examples are given for the
default variable name “OMRS0u16”.
Reading and writing to an index of this variable causes a read or write to the same
index location in the Omron C’s “D” memory area.
OMRS0u16[20] = L1 + 5
Write the sum of L1 plus 5 to the OMRON C D memory at offset 20.
X1= OMRS0u16[32] + 64.0
Read the value in the OMRON C D memory at offset 32, add 64.0 to the value, and
store it in variable X1.

BOA Spot Communication 25 Version 1.1; 2016-07-14


OMRON C

Now add scripts to communicate with the PLC.


1.In the Navigation bar, click on “Edit Scripts”.
2.In the setup panel (Left) click on “Post Image Process”.
3.In the bottom panel below the image area, click the “Edit” button.
4.Add equations or statements that read or write to the PLC. Use the “Variable” button
and menus to add your variables.

In the Post Image Process function:


//Send results to the PLC Input registers
OMRS0u16[0] = IntenAvg
OMRS0u16[2] = Result.0

5. Click the “Check Syntax” button to check for errors.


6. Click the “Save” button, to save and close the Free Edit window.

Tip: Start with writing one number to the PLC. You can add more instructions and
controls after you have successfully established communication with the PLC.

In most applications, you want the BOA Spot to switch Solution and trigger on a signal
from the PLC (if this capability is available).
7. In the Edit Scripts setup panel click on “Periodic: 200 ms”.
8. In the bottom panel below the image area, click the “Edit”
button.

9. Add statements that tell the PLC which solution is running, and read a solution
change request from the PLC output registers. (example on the next page)
10. Add statements that trigger the BOA Spot, clear and then rearm the trigger.
(example on the next page)

Note: The Input Registers and Output Registers are at the same space in this method.

BOA Spot Communication 26 Version 1.1; 2016-07-14


OMRON C

In the Periodic: 200 ms function:


//Send current solution to PLC
OMRS0u16[4] = GetSolutionID()
OMRS0u16[6] = Global.FrameCount
// get any solution change request from PLC
solReq = OMRS0u16[8]
if(solReq > 0) //this test statement is different in each Solution
ChangeSolution(solReq)
endif
//
// get any trigger request from PLC
trigReq = OMRS0u16[10]
// only trigger on leading edge of register transition
if((trigReq = 1) AND (trigArmed = 1))
trigArmed = 0 // to prevent multiple triggers
trigger()
endif
//re-arm trigger when PLC register is 0
if(trigReq = 0) trigArmed = 1

11. Check for syntax errors.


12. Click “Save” to save changes and close the Edit window.
13. Save and then Run the Solution.
Note: The solution change test should be modified for each different Solution file. You
want to change the Solution when solReq is not equal to the current solution ID number.
In the script example shown above, the current solution is 0, and the change request is
only valid when solReq is larger than zero. For example, in Solution02, you can use:
if(solReq != 2) The “!=“ means “not equal to”.
You can test to restrict solReq to valid Solution numbers, but that is not recommended
because each time you add a new solution, every solution file would have to be edited.

Configure the PLC for BOA Spot


1. On the Omron C program development station, add a “Host Link Interface” to
communicate over RS232.
2. Make sure the Serial port settings match those used to set up the BOA Spot.

BOA Spot Communication 27 Version 1.1; 2016-07-14


OMRON Ethernet-IP

Some OMRON PLCs use Ethernet-IP communication. This example uses the NJ301.

Configure the BOA Spot


1. Load or create a simple Solution with one
or two measurements.
2. In the Navigation bar, click on Setup
Connections.
3. Use the drop list to select “Ethernet-IP
PLC”. The center of the Setup panel
changes to configure BOA Spot for
Ethernet-IP communication.
4. Select a Register type (selected “dint” for
this example), and enter the base address
of the registers assigned to the BOA Spot,
in the PLC address space.
There are several different register types.
Each has a specific data type it will accept.
Create a variable and destination for each
register type you will use. This example uses
3 variable names.
5. Without changing the default variable
name, click the “Add Ethernet-IP
destination” button. The new variable
destination appears in the Destination list.
6. In the “Var Name” field, enter “EIPint_Read”. Click “Add Ethernet-IP destination”.
7. In the “Var Name” field, enter “EIPint_Write”. Click “Add Ethernet-IP destination”.
Notice the Read/Write example just below the “Add” button. The examples are given
for the default variable name “EIPint”. These are the type of statements you would use
in the Script Editor to read from or write to the PLC. The default name also indicates the
register type. “int” is for a signed 16-bit integer.
EIPdint[20] = L1 + 5
Write the sum of L1 plus 5 to the PLC register at offset 20 (from the base address).
X1=EIPdint[32] + 64.0
Read the value in the PLC register at offset 32 (from the base address), add 64.0 to the
value, and store it in variable X1.

BOA Spot Communication 28 Version 1.1; 2016-07-14


OMRON EIP

Now add scripts to communicate with the PLC.


1.In the Navigation bar, click on “Edit Scripts”.
2.In the setup panel (Left) click on “Post Image Process”.
3.In the bottom panel below the image area, click the “Edit” button.
4.Add equations or statements that read or write to the PLC. Use the “Variable” button
and menus to add your variables.

In the Post Image Process function:


//send results to the PLC Input registers
EIP_Write[0] = IntenAvg
EIP_Write[1] = Global.PassCount
// send the overall result
EIP_Write[2] = Result.0

5. Click the “Check Syntax” button to check for errors.


6. Click the “Save” button, to save and close the Free Edit window.

Tip: Start with writing one number to the PLC. You can add more instructions and
controls after you have successfully established communication with the PLC.

In most applications, you want the BOA Spot to switch Solution and trigger on a signal
from the PLC.
7. In the Edit Scripts setup panel click on “Periodic: 200 ms”.
8. In the bottom panel below the image area, click the “Edit”
button.

9. Add statements that tell the PLC which solution is running, and read a solution
change request from the PLC output registers. (example on the next page)
10. Add statements that trigger the BOA Spot, clear and then rearm the trigger
(example on the next page).

BOA Spot Communication 29 Version 1.1; 2016-07-14


OMRON EIP

In the Periodic: 200 ms function:


//Send current solution and total image count to PLC
EIP_Write[3] = GetSolutionID()
EIP_Write[4] = Global.FrameCount
// get any solution change request from PLC
solReq = EIP_Read[1]
if(solReq > 0) //this test statement is different in each Solution
ChangeSolution(solReq)
endif
//
// get any trigger request from PLC
trigReq = EIP_Read[0]
// only trigger on leading edge of register transition
if((trigReq = 1) AND (trigArmed = 1))
trigArmed = 0 // to prevent multiple triggers
trigger()
endif
//re-arm trigger when PLC register is 0
if(trigReq = 0) trigArmed = 1

11. Check for syntax errors.


12. Click “Save” to save changes and close the Edit window.
13. Save and then Run the Solution.
Note: The solution change test should be modified for each different Solution file. You
want to change the Solution when solReq is not equal to the current solution ID number.
In the script example shown above, the current solution is 0, and the change request is
only valid when solReq is larger than zero. For example, in Solution02, you can use:
if(solReq != 2) The “!=“ means “not equal to”.
You can test to restrict solReq to valid Solution numbers, but that is not recommended
because each time you add a new solution, every solution file would have to be edited.

BOA Spot Communication 30 Version 1.1; 2016-07-14


OMRON EIP

Configure the PLC for BOA Spot


The OMRON EIP requires an EDS file to define the BOA Spot resource to the PLC
program. This EDS file is included on the BOA Spot CDROM.

1. Open the OMRON Network Configurator. This example uses the Sysmac Studio.
2. Connect the PLC, and verify it is Online. This example used the NJ301.
3. If you already have a Network Configuration (nvf) upload it (Ctrl+U).
4. Add the “DalsaVisionV3_0814_01.eds” file to you system.
5. Insert the “BOA” into the network. You can drag and drop from “Teledyne DALSA”.
6. Drag the BOA icon onto the NJ Icon in the Network Configurator. The following
screen should appear. The BOA Spot has the address 192.168.250.10.

BOA Spot Communication 31 Version 1.1; 2016-07-14


OMRON EIP

7. Beside “Input Tag Set” click the “Edit Tag Sets” button.
8. Create the tag name “From_BOA” and make sure the input byte size is 36 bytes.
This matches the value in the EDS file.
9. Beside “Output Tag Set” click the “Edit Tag Sets” button.
10. Create the tab name “To_BOA” and make sure the output byte size is 32 bytes, to
match the value in the EDS file.
11. Insert the “BOA” into the network. You can drag and drop from “Teledyne DALSA”.
12. Change the “Packet Interval (RPI)” to 150.
13. Register and close.

BOA Spot Communication 32 Version 1.1; 2016-07-14


OMRON EIP

14. In the Network Configurator,


right-click on the NJ301 and
select “Monitor”. You should see a
blue indicator next to the IP
Address of the BOA Spot, as
shown.

15. Create Global Variable in Sysmac Studio, that match the Tag names you just
created in the Network Configurator, in this example “To_BOA” and “From_BOA”.

16. Download the program to the PLC. It should automatically compile.


17. You can use the Watch Window to view data being transferred between the PLC
and the BOA Spot.

Note: The BOA Spot write to EIPint[0] or to EIP_Write[0] maps to the PLC location
“From_BOA[2]”. This is important to your PLC programming.
Note: The Windows Firewall should be turned off (or customized).

BOA Spot Communication 33 Version 1.1; 2016-07-14


MELSEC PLC

BOA Spot is compatible with PLCs using Melsec communication over Serial or EIP. This
example uses the Mitsubishi Series Q PLC - model QJ1E71 with EIP.
Configure the BOA Spot
1. In the Navigation bar, click on Setup
Connections.
2. Use the drop list to select “Melsec PLC”.
The center of the Setup panel changes to
configure BOA Spot for Melsec communication.
3. Select a TCP/IP connection, enter the PLC’s
IP Address, (192.168.0.154) and select 1E or
3E.
4. Enter the Station, Network, PC and Block
numbers for your PLC.
5. Select a Register type, and Register address
(index).
There are several different register types. Each
performs a specific task, and has a specific data
type it will accept.
6. Enter the Request information if you are
using 4C/3E communication.
7. You can enter a variable name, or use the
defaults. The default variable names reflect
the register type and data type.
8. Click “Add Melsec PLC destination”. Your
definition appears in the “PLC Destination”
list box.
Repeat steps 5, 7, and 8 to add other register types.
Notice the Read/Write example just below the “Add” button. The examples are given
for the default variable name “ML154S01CAF1u16”. “u16 “for unsigned 16-bit data.
ML154S01CAF1u16[20] = L1 + 5
Write the sum of L1 plus 5 to the PLC D memory at offset 20.
X1= ML154S01CAF1u16[32] + 64.0
Read the value in the D memory at offset 32, add 64.0, and store it in variable X1.
Note: The Input Registers and Output Registers are at the same space in this method.

BOA Spot Communication 34 Version 1.1; 2016-07-14


MELSEC

Now add scripts to communicate with the PLC.


1.In the Navigation bar, click on “Edit Scripts”.
2.In the setup panel (Left) click on “Post Image Process”.
3.In the bottom panel below the image area, click the “Edit” button.
4.Add equations or statements that read or write to the PLC. Use the “Variable” button
and menus to add your variables.

In the Post Image Process function:


//Send results to the PLC Input registers
ML154S01CAF1u16[0] = IntenAvg
ML154S01CAF1u16[1] = Result.0
inspBusy = 0

5. Click the “Check Syntax” button to check for errors.


6. Click the “Save” button, to save and close the Free Edit window.

Tip: Start with writing one number to the PLC. You can add more instructions and
controls after you have successfully established communication with the PLC.

In most applications, you want the BOA Spot to switch Solution and trigger on a signal
from the PLC.
7. In the Edit Scripts setup panel click on “Periodic: 200 ms”.
8. In the bottom panel below the image area, click the “Edit”
button.

9. Add statements that tell the PLC which solution is running, and read a solution
change request from the PLC output registers. (example on the next page)
10. Add statements that trigger the BOA Spot, clear and then rearm the trigger.
(example on the next page)

Note: The “inspBusy” variable is not fully implemented in this example. You could send
it to the PLC to tell it the Solution is running.

BOA Spot Communication 35 Version 1.1; 2016-07-14


MELSEC

In the Periodic: 200 ms function:


//Send current solution and total image count to PLC
ML154S01CAF1u16[2] = GetSolutionID()
ML154S01CAF1u16[3] = Global.FrameCount
//
// get any solution change request from PLC
solReq = ML154S01CAF1u16[4]
if(solReq > 0) //this test statement is different in each Solution
ChangeSolution(solReq)
endif
//
// get any trigger request from PLC
trigReq = ML154S01CAF1u16[5]
// only trigger on leading edge of register transition
if((trigReq = 1) AND (trigArmed = 1))
trigArmed = 0 // to prevent multiple triggers
inspBusy = 1 // the inspection is running
trigger()
endif
//re-arm trigger when PLC register is 0
if(trigReq = 0) trigArmed = 1

11. Check for syntax errors.


12. Click “Save” to save changes and close the Edit window.
13. Save and then Run the Solution.
Note: The solution change test should be modified for each different Solution file. You
want to change the Solution when solReq is not equal to the current solution ID number.
In the script example shown above, the current solution is 0, and the change request is
only valid when solReq is larger than zero. For example, in Solution02, you can use:
if(solReq != 2) The “!=“ means “not equal to”.
You can test to restrict solReq to valid Solution numbers, but that is not recommended
because each time you add a new solution, every solution file would have to be edited.

BOA Spot Communication 36 Version 1.1; 2016-07-14


MELSEC

Configure the PLC for BOA Spot


1. Open the MELSEC program development software. This example is using MELSOFT
Series GX Works2.
2. In the Project Data list, expand the Network Parameter group, and click on
“Ethernet/CC IE/MELSECNET”
3. Configure the Ethernet module settings as follows:
Set Network Type to Ethernet
Set Starting IO to 0000
Set Network No. to 1
Set Group No. to 1
Set Station No. to 1

Note: The Windows Firewall should be turned off (or customized) on systems that
communicate over the network.

BOA Spot Communication 37 Version 1.1; 2016-07-14


MELSEC

4. Click on “Operation Setting”.


Set Communication Data Code to:
ASCII Code
Set Initial Timing to:
Always wait for OPEN
Set Input Format to: DEC.
The IP Address shown is for this PLC,
and matches the value in BOA
Spot.
Check the box beside:
Enable Online Change
Send frame setting should be:
Ethernet(V2.0)
TCP Existence Confirmation Setting
should be: Use the KeepAlive
5. Click End to accept changes, and return to the Module Configuration.
6. Click on “Initial Setting”.

Set “Dest. Confirmation


Start Interval” to 10
Set “Des. Confirmation
Interval” to 10
Set “Des. Configuration
Resend” to 8

7. Close this window and return to the Module Configuration.

BOA Spot Communication 38 Version 1.1; 2016-07-14


MELSEC

8. Click On “Open Settings”


Set Protocol to TCP
Set Open System to Unpassive
Set Fixed Buffer to Send
Set Fixed Buffer Communication Procedure to Procedure Exist
Set Paring Open to Disable
Set Existence Confirmation to Confirm
Set Host Station Port No. to 5555 (to match BOA Spot)
9. Close this window to return to Module Settings.

10. Click “End” to accept changes, and close the Module Configuration.
11. In the Menu bar, select Online => Write to PLC to write your Configuration to the
PLC.
12. Check Write and check Parameters
13. Click on “Execute”.
14. Cycle power to the PLC to reset it.
Use the Batch Monitor (In GX Works 2) to view the D Memory area, which BOA Spot
reads or writes to:
15. In the Menu bar, select Online->Monitor->Device Buffer Memory Batch
16. In “Device Name” enter D0 to monitor the first D memory locations.
The script in BOA Spot writes a measured value to offset 0. This corresponds to D0.
The pass count, total frame counts and solution number are written to offsets 1, 2,
and 3. These correspond to locations D1, D2, and D3. The script reads from offsets
4 and 5, which correspond to D4 and D5.
Our register definition (in BOA Spot) was limited to unsigned 16-bit values. You can add
other register types. Make sure the display format settings in the Batch Monitor
match the register types you send.

BOA Spot Communication 39 Version 1.1; 2016-07-14


Profinet PLC

BOA Spot is compatible with PLCs that use Profinet UDP/IP communication. You must
configure the BOA Spot first, and run the Solution, to open a Profinet communication.
NOTE: The BOA Spot device name must be changed to “boavision”. This name is hard-
coded in the GSD XML file.
NOTE: Start by configuring the BOA Spot, and run the Solution at least once. to request
and initialize Profinet communication. If the BOA Spot Solution has not run, the BOA
Spot will not appear in your Profinet programming environment.
Configure the BOA Spot
1. In the Navigation bar, click on Setup
Connections.
2. Use the drop list to select “Profinet RT IO”.
The center of the Setup panel changes to
configure BOA Spot for Profinet
communication.
3. Select the Register type, and enter the base
address of the registers assigned to the BOA
Spot, in the PLC address space.
There are several different register types. Each
performs a specific task, and has a specific
data type it will accept.
4. You can change the Variable name, or use
the default.
5. Click the “Add Profinet PLC destination”
button. Your definition appears in the “PLC
Destination” list box.
6. Repeat steps 3, 4, 5 for each different register type.
Notice the Read/Write example just below the “Add” button. The examples are given
for the default variable name “PROFIdint”. These are the type of statements you would
use in the Script Editor to read values from or write values to the PLC. The default
name also indicates the register type. “dint” is for a signed 32-bit integer (double int).
PROFIint[20] = L1 + 5
Write the sum of L1 plus 5 to the PLC’s Holding register at index location 20.
X1=PROFIint[32] + 64.0
Read the value in Holding register index location 32, add 64.0 to the value, and store it
in variable X1.

BOA Spot Communication 40 Version 1.1; 2016-07-14


Profinet

Now add scripts to communicate with the PLC.


1.In the Navigation bar, click on “Edit Scripts”.
2.In the setup panel (Left) click on “Post Image Process”.
3.In the bottom panel below the image area, click the “Edit” button.
4.Add equations or statements that read or write to the PLC. Use the “Variable” button
and menus to add your variables.

In the Post Image Process function:


//Send results to the PLC Input registers
PROFIdint[0] = IntenAvg
PROFIdint[1] = L
PROFIdint[2] = Result.0

5. Click the “Check Syntax” button to check for errors.


6. Click the “Save” button, to save and close the Free Edit window.
Tip: Start with writing one number to the PLC. You can add more instructions and
controls after you have successfully established communication with the PLC.

Note: When BOA Spot writes to the attached variable PROFIdint, it is updating the
input module on the Profinet controller (I address range 256..509 ). PROFIdint is a 32
bit signed value; so BOA side references are indexing a dint sized array.
PROFIdint[0] = x, writes the value which appears at location %ID256 on the controller,
PROFIdint[1] = x, writes the value which appears at location %ID260 on the controller,
which is the next double size index.

In most applications, you want the BOA Spot to switch Solution and trigger on a signal
from the PLC.
7. In the Edit Scripts setup panel click on “Periodic: 200 ms”.
8. In the bottom panel below the image area, click the “Edit”
button.

9. Add statements that tell the PLC which solution is running, and read a solution
change request from the PLC output registers. (example on the next page)
10. Add statements that trigger the BOA Spot, clear and then rearm the trigger.
(example on the next page)

BOA Spot Communication 41 Version 1.1; 2016-07-14


Profinet

In the Periodic: 200 ms function:


//Send current solution number to the PLC
PROFIdint[3] = GetSolutionID()
PROFIdint[4] = Global.FrameCount
// get any solution change request from the PLC
solReq = PROFIdint[1]
if(solReq > 0) //this test statement is different in each Solution
ChangeSolution(solReq)
endif
//
// get any trigger request from the PLC
trigReq = PROFIdint[0]
// only trigger on leading edge of register transition
if((trigReq = 1) AND (trigArmed = 1))
trigArmed = 0 // to prevent multiple triggers
trigger()
endif
//re-arm trigger when PLC register is 0
if(trigReq = 0) trigArmed = 1

11. Check for syntax errors.


12. Click “Save” to save changes and close the Edit window.
13. Save and then Run the Solution.
Note: The solution change test should be modified for each different Solution file. You
want to change the Solution when solReq is not equal to the current solution ID number.
In the script example shown above, the current solution is 0, and the change request is
only valid when solReq is larger than zero. For example, in Solution02, you can use:
if(solReq !=2) The “!=“ means “not equal to”.
You can test to restrict solReq to valid Solution numbers, but that is not recommended
because each time you add a new solution, every solution file would have to be edited.

NOTE: When BOA Spot read the attached variable PROFIdint, it is reading the output
module on the Profinet controller (Q address range 256..509 ).
profiCmd= PROFIdint[0], is reading from location %QD256 on the controller,
profiCmd= PROFIdint[1], is reading from location %QD260 on the controller,
…….
profiCmd= PROFIdint[62], is reading from location %QD504 on the controller,

BOA Spot Communication 42 Version 1.1; 2016-07-14


Profinet

Configure the PLC for BOA Spot


The Profinet programming station (PC) uses a GSDML file to describe the BOA Spot
resources. This GSDML file is included on the BOA Spot CDROM. There is also an
image file, to add a BOA Icon to your programming station. This icon appears when you
add a BOA Spot device in your program. Copy them to your PC, or install from the CD.
NOTE: You must first configure the BOA Spot, and run the Solution at least once, to
request and initialize Profinet communication. If the BOA Spot Solution has not run, the
BOA Spot will not appear in your Profinet programming environment.

1. Open the Profinet program development software. This example is using Siemens
"Totally Integrated Automation Panel" TIAP-V11.
2. In the Options menu, select “Install general station description file”.
3. Navigate to the BOA Spot file.

Note: The Windows Firewall should be turned off (or customized) on systems that
communicate over the network.

BOA Spot Communication 43 Version 1.1; 2016-07-14


Profinet

4. Click on “Devices and Networks”.


5. Open the Hardware catalog (shown at right). The
DALSA RT-IO Device is automatically added to
the Hardware Catalog when you install the GDS
file.
6. You can drag and drop the “DALSA RT-IO”
object into the Devices and Networks view.

7. Click on “Not assigned” (shown below) and


select the CPU (named “lilwes” in this image).
8. Assign the communication: PN/IE_1.

9. Click on the green square


or double-click on the
name “boavision”.
10. Click the Properties tab (if
tabs appear) or select
Ethernet address.
11. Enter the BOA Spot IP
Address.

BOA Spot Communication 44 Version 1.1; 2016-07-14


Profinet

12. Under the “Real-time settings” select “I/O cycle”. Timers.


13. Set the Update Time and Watchdog Timer.
The default values seemed to work for a small read/write program running
continuously. Larger values may be necessary for a more complex program, or one
driven by a slow product line. Values 128 ms and 4 cycles worked well in our tests.
When you get to production time, you may need to experiment with what time works
best for your program and environment.

9. Add controller logic to perform IO with the BOA Spot. Configure the tag names and
data types to match what your PLC and BOA Spot programs will read and write. The
image below has not been configured for the BOA Spot variables in our script
example.

BOA Spot Communication 45 Version 1.1; 2016-07-14


Profinet

12. Compile and download your program to the PLC. The PLC will be halted to
accept the new program.
13. You can open the “Watch Table” to monitor your tags being written to by the BOA
Spot. The image below has not been configured for the BOA Spot variables
shown in the Scripting example.

If you need to add more than one BOA Spot, the device names should be changed to
“boavision_1”, boavision_2”, and boavision_3”. The GSD file defines 256 bytes for
each BOA Spot. This means that a maximum of four BOA Spot cameras can be
used. Three are shown in the image below.

Note: The Windows Firewall should be turned off (or customized) on systems that
communicate over the network.

BOA Spot Communication 46 Version 1.1; 2016-07-14


Modbus EIP

BOA Spot is compatible with PLCs and many other devices that use the Modbus
protocol, over Ethernet or Serial port connections.
Configure the BOA Spot
1. In the Navigation bar, click on Setup
Connections.
2. Use the drop list to select “Modbus PLC”.
The center of the Setup panel changes to
configure BOA Spot for Modbus
communication.
3. Select the TCP/IP connection. Select the
BOA Spot to be a Modbus Slave.
4. When you configure the PLC, you will need
the BOA Spot IP Address (not shown) and
the Modbus Port number shown in this
panel (502).
5. We will use the default setting for this
example: Holding Registers, signed 16,
Address 0, Device 1.
There are several different register types. Each
has a specific data types it will accept.
7. Click “Add Modbus Destination”. Your
definition appears in the “PLC Destination”
list box.

Notice the Read/Write example just below the “Add” button. The examples are given
for the default variable name “MBSlaves16”. These are the type of statements you
would use in the Script Editor to read values from or write values to the PLC. “HR” is for
the Holding register. “s16” is for the “signed 16” 16-bit value.
MBSlaveHRs16[20] = L1 + 5
Write the sum of L1 plus 5 to the PLC’s Holding register at BOA Spot index 20.
X1=MBSlaveHRs16[32] + 64.0
Read the value in Holding register BOA Spot index 32, add 64.0 to the value, and store
it in variable X1.
BOA Spot Communication 47 Version 1.1; 2016-07-14
Modbus

Note: The BOA Spot attached variable MBSlaveHRs16[0] maps to the Holding
Registers which start at location 400001 in the Modbus memory. This is important to
your Modbus device programming. You can read and write to the same location.

Now add scripts to communicate with the PLC.


1.In the Navigation bar, click on “Edit Scripts”.
2.In the setup panel (Left) click on “Post Image Process”.
3.In the bottom panel below the image area, click the “Edit” button.
4.Add equations or statements that read or write to the PLC. Use the “Variable” button
and menus to add your variables.
In the Post Image Process function:
//Send results to the PLC Input registers
MBSlaveHRs16[0] = IntenAvg
MBSlaveHRs16[1] = Result.0
MBSlaveHRs16[2] = Global.PassCount
inspBusy = 0

5. Click the “Check Syntax” button to check for errors.


6. Click the “Save” button, to save and close the Free Edit window.

Tip: Start with writing one number to the PLC. You can add more instructions and
controls after you have successfully established communication with the PLC.
In most applications, you want the BOA Spot to switch Solution and trigger on a signal
from the PLC.
7. In the Edit Scripts setup panel click on “Periodic: 200 ms”.
8. In the bottom panel below the image area, click the “Edit”
button.

9. Add statements that tell the PLC which solution is running, and read a solution
change request from the PLC output registers. (example on the next page)
10. Add statements that trigger the BOA Spot, clear and then rearm the trigger.
(example on the next page)

Note: The “inspBusy” variable is not fully implemented in this example. You could send
it to the PLC to tell it the Solution is running.

BOA Spot Communication 48 Version 1.1; 2016-07-14


Modbus

In the Periodic: 200 ms function:


//Send current solution and total image count to PLC
MBSlaveHRs16[3] = GetSolutionID()
MBSlaveHRs16[4] = Global.FrameCount
//
// get any solution change request from PLC
solReq = MBSlaveHRs16[5]
if(solReq > 0) //this test statement is different in each Solution
ChangeSolution(solReq)
endif
//
// get any trigger request from PLC
trigReq = MBSlaveHRs16[6]
// only trigger on leading edge of register transition
if((trigReq = 1) AND (trigArmed = 1))
trigArmed = 0 // to prevent multiple triggers
inspBusy = 1 // the inspection is running
trigger()
endif
//re-arm trigger when PLC register is 0
if(trigReq = 0) trigArmed = 1

11. Check for syntax errors.


12. Click “Save” to save changes and close the Edit window.
13. Save and then Run the Solution.
Note: The solution change test should be modified for each different Solution file. You
want to change the Solution when solReq is not equal to the current solution ID number.
In the script example shown above, the current solution is 0, and the change request is
only valid when solReq is larger than zero. For example, in Solution02, you can use:
if(solReq != 2) The “!=“ means “not equal to”.
You can test to restrict solReq to valid Solution numbers, but that is not recommended
because each time you add a new solution, every solution file would have to be edited.

BOA Spot Communication 49 Version 1.1; 2016-07-14


Modbus

Configure the PLC for BOA Spot


The PLC is the Modbus master. The BOA Spot is configured as a Modbus slave. The
Modbus master requires the slave device’s IP Address and Port number.

1. Open your Modbus PLC programming software.


2. Add a new slave module connection.
3. Enter the BOA Spot’s IP Address and Port number (Port 502 in the example).
4. Add the necessary number of variables, and assign their data tags (if supported)
locations (starting at 400001) names and properties as needed (data size, data
format, read/write or read-only access). In this example the BOA Spot used signed
16-bit values. There are several other data types available.

Note: The BOA Spot attached variable MBSlaveHRs16[0] maps to the Holding
Registers which start at location 400001 in the Modbus memory. This is important to
your Modbus device programming.
MBSlaveHRs16[0] maps to 400001, MBSlaveHRs16[1] maps to 400002,
MBSlaveHRs16[2] maps to 400003, MBSlaveHRs16[3] maps to 400004, etc..
In the Modbus register table specification:
Coil Status starts at location 000001, (you may see 0:00000 in the spec.,
Input Status starts at location 100001, 00001 is the first usable location)
Input Registers start at location 300001,
Holding Registers start at location 400001.
Note: You can read and write to the same locations in the table.

5. Compile and download your program to the PLC.


6. Monitor the Holding Registers in your programming software, if supported on your
system. Observe the BOA Spot writing to the Holding Registers.
7. Add the logic necessary to process the BOA Spot data, and to trigger and switch
solutions as appropriate.
There are many different devices that use the Modbus standard. A few examples are
robot arms, control modules, and HMI panels. The software for developing programs
will be different for each, as well as the capabilities. Modbus is supported on both Serial
and Ethernet.
Note: The Windows Firewall should be turned off (or customized) on systems that
communicate over the network.

BOA Spot Communication 50 Version 1.1; 2016-07-14


Fanuc SNP

BOA Spot is compatible with PLCs that use the GE Fanuc SNP protocol, over a serial
port connection.
Configure the BOA Spot
1. In the Navigation bar, click on Setup
Connections.
2. Use the drop list to select “GE Fanuc SNP
PLC”.
The center of the Setup panel changes to
configure BOA Spot for SNP communication.
3. Select a Register type, and change the Serial
Port settings, or verify that they match the
PLC exactly.
There are several different register types. Each
performs a specific task, and has a specific data
type it will accept.
4. You can change the variable name, or use
the defaults. This default name also signifies
the type of register: The “AI” is for the Analog
input register.
5. Click “Add SNP destination”. Your definition
appears in the “PLC Destination” list box.
Notice the Read/Write example just below the
“Add” button. The examples are given for the
default variable name “SNPAI”. These are the
type of statements you would use in the Script
Editor to read values from or write values to the
PLC.
The default name also signifies the type of register: The “AI” for Analog input register.
SNPAI0[20] = L1 + 5
Write the sum of L1 plus 5 to the PLC’s Analog input register at index location 20.
X1=SNPAI0[32] + 64.0
Read the value in Analog Input register index location 32, add 64.0 to the value, and
store it in variable X1.

Tip: Start with writing one number to the PLC. You can add more instructions and
controls after you have successfully established communication with the PLC.

BOA Spot Communication 51 Version 1.1; 2016-07-14


Fanuc SNP

Now add scripts to communicate with the PLC.


1.In the Navigation bar, click on “Edit Scripts”.
2.In the setup panel (Left) click on “Post Image Process”.
3.In the bottom panel below the image area, click the “Edit” button.
4.Add equations or statements that read or write to the PLC. Use the “Variable” button
and menus to add your variables.

In the Post Image Process function:


//Send results to the PLC Input registers
SNPAI0[0] = IntenAvg
SNPAI0[1] = Result.0
SNPAI0[2] = Global.PassCount
// inspection is done status
inspBusy = 0

5. Click the “Check Syntax” button to check for errors.


6. Click the “Save” button, to save and close the Free Edit window.

Tip: Start with writing one number to the PLC. You can add more instructions and
controls after you have successfully established communication with the PLC.

In most applications, you want the BOA Spot to switch Solution and trigger on a signal
from the PLC.
7. In the Edit Scripts setup panel click on “Periodic: 200 ms”.
8. In the bottom panel below the image area, click the “Edit”
button.

9. Add statements that tell the PLC which solution is running, and read a solution
change request from the PLC output registers. (example on the next page)
10. Add statements that trigger the BOA Spot, clear and then rearm the trigger.
(example on the next page)

Note: The “heartbeat” is not used by the BOA Spot, but we have seen many customers
prefer to include it in their PLC programs. Some PLCs may require it.
The “inspBusy” variable is not fully implemented in this example. You could send it to
the PLC to tell it the Solution is running.

BOA Spot Communication 52 Version 1.1; 2016-07-14


Fanuc SNP

In the Periodic: 200 ms function:


//Send current solution to PLC
SNPAI0[3] = GetSolutionID()
SNPAI0[4] = Global.FrameCount
// get any solution change request from PLC Output registers
solReq = SNPAI0[1]
if(solReq > 0) //this test statement is different in each Solution
ChangeSolution(solReq)
endif
//
// get any trigger request from PLC output registers
trigReq = SNPAI0[0]
// only trigger on leading edge of the register transition
if((trigReq = 1) AND (trigArmed = 1))
trigArmed = 0 // prevents multiple triggers
inspBusy = 1 // the inspection is running
trigger()
endif
//re-arm trigger when PLC register is 0
if(trigReq = 0) trigArmed = 1
//note PLC connection status
plcStat = IsConnected(EIPdint)
//
//send heartbeat count
hb = hb + 1
if(hb > 999) hb = 1
SNPAI0[5] = hb

11. Check for syntax errors.


12. Click “Save” to save changes and close the Edit window.
13. Save and then Run the Solution.
Note: The solution change test should be modified for each different Solution file. You
want to change the Solution when solReq is not equal to the current solution ID number.
In the script example shown above, the current solution is 0, and the change request is
only valid when solReq is larger than zero. For example, in Solution02, you can use:
if(solReq != 2) The “!=“ means “not equal to”.
You can test to restrict solReq to valid Solution numbers, but that is not recommended
because each time you add a new solution, every solution file would have to be edited.

BOA Spot Communication 53 Version 1.1; 2016-07-14


Fanuc SNP

Configure the PLC for BOA Spot


Setup and programming information specific to the Fanuc SNP PLC was not available.
A generalized setup is provided here. The Fanuc SNP uses Serial RS232
communication.
1. Open your PLC programming software.
2. Add a new RS232 connection. Make sure the setting match those of the BOA Spot.
3. Add the necessary number of variables. Configure variable data settings as needed.

Note: It is not known if you can read and write to the same locations in this PLC.

4. Compile and download your program to the PLC.


5. Monitor the PLC memory or registers in your programming software, if supported on
your system. Observe the BOA Spot writing to the PLC.
6. Add the logic necessary to process the BOA Spot data, and to trigger and switch
solutions as appropriate.

BOA Spot Communication 54 Version 1.1; 2016-07-14


Fanuc SRTP

BOA Spot is compatible with PLCs that use the GE Fanuc SRTP protocol, over an
Ethernet connection.
Configure the BOA Spot
1. In the Navigation bar, click on Setup
Connections.
2. Use the drop list to select G”E Fanuc SRTP
Ethernet PLC”.
The center of the Setup panel changes to
configure BOA Spot for SRTP
communication.
3. Select the Register type, and enter the IP
Address of the PLC.
There are several different register types. Each
performs a specific task, and has a specific
data type it will accept.
4. You can change the variable name, or use
the defaults.
5. Click the “Add SRTP destination” button.
Your definition appears in the “PLC
Destination” list box.

Notice the Read/Write example just below the “Add” button. The examples are given
for the default variable name “SRTPAI0”. These are the type of statements you would
use in the Script Editor to read values from or write values to the SRTP PLC.
The default name also signifies the type of register: The “AI” for Analog input register.
SRTPAI0[20] = L1 + 5
Write the sum of L1 plus 5 to the PLC’s Analog input register at index location 20.
X1=SRTPAI0[32] + 64.0
Read the value in Analog Input register index location 32, add 64.0 to the value, and
store it in variable X1.
Depending on the design of the PLC, the read and write locations may be the same, or
they may be different.

Tip: Start with writing one number to the PLC. You can add more instructions and
controls after you have successfully established communication with the PLC.

BOA Spot Communication 55 Version 1.1; 2016-07-14


Fanuc SRTP

Now add scripts to communicate with the PLC.


1.In the Navigation bar, click on “Edit Scripts”.
2.In the setup panel (Left) click on “Post Image Process”.
3.In the bottom panel below the image area, click the “Edit” button.
4.Add equations or statements that read or write to the PLC. Use the “Variable” button
and menus to add your variables.

In the Post Image Process function:


//Send results to the PLC Input registers
SRTPAI0[0] = IntenAvg
SRTPAI0[1] = Result.0
SRTPAI0[2] = Global.PassCount
// inspection is done status
inspBusy = 0

5. Click the “Check Syntax” button to check for errors.


6. Click the “Save” button, to save and close the Free Edit window.

Tip: Start with writing one number to the PLC. You can add more instructions and
controls after you have successfully established communication with the PLC.

In most applications, you want the BOA Spot to switch Solution and trigger on a signal
from the PLC.
7. In the Edit Scripts setup panel click on “Periodic: 200 ms”.
8. In the bottom panel below the image area, click the “Edit”
button.

9. Add statements that tell the PLC which solution is running, and read a solution
change request from the PLC output registers. (example on the next page)
10. Add statements that trigger the BOA Spot, clear and then rearm the trigger.
(example on the next page)

Note: The “heartbeat” is not used by the BOA Spot, but we have seen many customers
prefer to include it in their PLC programs. Some PLCs may require it.
The “inspBusy” variable is not fully implemented in this example. You could send it to
the PLC to tell it the Solution is running.

BOA Spot Communication 56 Version 1.1; 2016-07-14


Fanuc SRTP

In the Periodic: 200 ms function:


//Send current solution to PLC
SRTPAI0[3] = GetSolutionID()
SRTPAI0[4] = Global.FrameCount
// get any solution change request from PLC Output registers
solReq = SRTPAI0[1]
if(solReq > 0) //this test statement is different in each Solution
ChangeSolution(solReq)
endif
//
// get any trigger request from PLC output registers
trigReq = SRTPAI0[0]
// only trigger on leading edge of the register transition
if((trigReq = 1) AND (trigArmed = 1))
trigArmed = 0 // prevents multiple triggers
inspBusy = 1 // the inspection is running
trigger()
endif
//re-arm trigger when PLC register is 0
if(trigReq = 0) trigArmed = 1
//note PLC connection status
plcStat = IsConnected(EIPdint)
//
//send heartbeat count
hb = hb + 1
if(hb > 999) hb = 1
SRTPAI0[5] = hb

11. Check for syntax errors.


12. Click “Save” to save changes and close the Edit window.
13. Save and then Run the Solution.
Note: The solution change test should be modified for each different Solution file. You
want to change the Solution when solReq is not equal to the current solution ID number.
In the script example shown above, the current solution is 0, and the change request is
only valid when solReq is larger than zero. For example, in Solution02, you can use:
if(solReq != 2) The “!=“ means “not equal to”.
You can test to restrict solReq to valid Solution numbers, but that is not recommended
because each time you add a new solution, every solution file would have to be edited.

BOA Spot Communication 57 Version 1.1; 2016-07-14


Fanuc SRTP

Configure the PLC for BOA Spot


Setup and programming information specific to the Fanuc SRTP PLC was not available.
A generalized setup is provided here. The Fanuc SRTP uses Ethernet communication.

1. Open your PLC programming software.


2. Add a new Ethernet connection. Enter the properties of the BOA Spot as needed.
3. Add the necessary number of variables. Configure variable data settings as needed.

Note: It is not known if you can read and write to the same locations in this PLC.
4. Compile and download your program to the PLC.
5. Monitor the PLC memory or registers in your programming software, if supported on
your system. Observe the BOA Spot writing to the PLC.
6. Add the logic necessary to process the BOA Spot data, and to trigger and switch
solutions as appropriate.

Note: The Windows Firewall should be turned off (or customized) on systems that
communicate over the network.

BOA Spot Communication 58 Version 1.1; 2016-07-14


Motoman

BOA Spot is compatible with devices that support the Motoman protocol, over a serial
port connection.

Configure the BOA Spot


1. In the Navigation bar, click on Setup
Connections.
2. Use the drop list to select “Motoman MRC”.
The center of the Setup panel changes to
configure BOA Spot for Motoman
communication.
3. Change the Serial Port settings, or verify
that they match exactly the other Motoman
systems you will communicate with.
4. You can change the Variable name, or use
the default.
5. Click “Add Motoman destination”. Your
definition appears in the “PLC Destination” list
box.
Notice the Read/Write example just below
the “Add” button. The examples are given for
the default variable name “MOTO”. These are
the type of statements you would use in the
Script Editor to read values from or write
values to a Motoman device.

MOTO[20] = L1 + 5
Write the sum of the L1 measurement plus 5, to the Motoman write location 20.
Usually devices have a bank of register locations or addresses. There may be specific
functions assigned to specific locations. This would be outlined in the documentation for
your Motoman device or system.
X1=MOTO[32] + 64.0
Read the value at Motoman read location 32, add 64.0 to the value, and store it in
variable X1.

Tip: Start with writing one number to the PLC. You can add more instructions and
controls after you have successfully established communication with the PLC.

BOA Spot Communication 59 Version 1.1; 2016-07-14


Motoman

Now add scripts to communicate with the PLC.


1.In the Navigation bar, click on “Edit Scripts”.
2.In the setup panel (Left) click on “Post Image Process”.
3.In the bottom panel below the image area, click the “Edit” button.
4.Add equations or statements that read or write to the PLC. Use the “Variable” button
and menus to add your variables.

In the Post Image Process function:


//Send results to the PLC Input registers
MOTO[0] = IntenAvg
MOTO[1] = Result.0
MOTO[2] = Global.PassCount
// inspection is done status
inspBusy = 0

5. Click the “Check Syntax” button to check for errors.


6. Click the “Save” button, to save and close the Free Edit window.

Tip: Start with writing one number to the PLC. You can add more instructions and
controls after you have successfully established communication with the PLC.

In most applications, you want the BOA Spot to switch Solution and trigger on a signal
from the PLC.
7. In the Edit Scripts setup panel click on “Periodic: 200 ms”.
8. In the bottom panel below the image area, click the “Edit”
button.

9. Add statements that tell the PLC which solution is running, and read a solution
change request from the PLC output registers. (example on the next page)
10. Add statements that trigger the BOA Spot, clear and then rearm the trigger.
(example on the next page)

Note: The “heartbeat” is not used by the BOA Spot, but we have seen many customers
prefer to include it in their PLC programs. Some PLCs may require it.
The “inspBusy” variable is not fully implemented in this example. You could send it to
the PLC to tell it the Solution is running.

BOA Spot Communication 60 Version 1.1; 2016-07-14


Motoman

In the Periodic: 200 ms function:


//Send current solution to PLC
MOTO[3] = GetSolutionID()
MOTO[4] = Global.FrameCount
// get any solution change request from PLC Output registers
solReq = MOTO[1]
if(solReq > 0) //this test statement is different in each Solution
ChangeSolution(solReq)
endif
//
// get any trigger request from PLC output registers
trigReq = MOTO[0]
// only trigger on leading edge of the register transition
if((trigReq = 1) AND (trigArmed = 1))
trigArmed = 0 // prevents multiple triggers
inspBusy = 1 // the inspection is running
trigger()
endif
//re-arm trigger when PLC register is 0
if(trigReq = 0) trigArmed = 1
//note PLC connection status
plcStat = IsConnected(EIPdint)
//
//send heartbeat count
hb = hb + 1
if(hb > 999) hb = 1
MOTO[5] = hb

11. Check for syntax errors.


12. Click “Save” to save changes and close the Edit window.
13. Save and then Run the Solution.
Note: The solution change test should be modified for each different Solution file. You
want to change the Solution when solReq is not equal to the current solution ID number.
In the script example shown above, the current solution is 0, and the change request is
only valid when solReq is larger than zero. For example, in Solution02, you can use:
if(solReq != 2) The “!=“ means “not equal to”.
You can test to restrict solReq to valid Solution numbers, but that is not recommended
because each time you add a new solution, every solution file would have to be edited.

BOA Spot Communication 61 Version 1.1; 2016-07-14

You might also like