Você está na página 1de 77

FB Library Reference Manual for In-Sight CPU with Built-in Ethernet Port Connection

<<Index>>
Reference Manual Revision History.................................................................................................................................. 1
1

Outline..................................................................................................................................................................... 2

11

FB Library Outline................................................................................................................................................ 2

12

FB Library Function Contents............................................................................................................................... 2

13

System Configuration Example ............................................................................................................................ 3

14

Settings for the CPU Unit w/ Built-in Ethernet Port ............................................................................................... 4

141

Operation Settings for the CPU Unit w/ Built-in Ethernet Port ........................................................................... 4

142

Open Settings for the CPU Unit w/ Built-in Ethernet Port.................................................................................. 5

15

Settings for the QJ71E71-100 Ethernet Unit......................................................................................................... 6

151

Operation Settings for the QJ71E71-100 Ethernet Unit .................................................................................... 6

152

Initial Settings for the QJ71E71-100 Ethernet Unit............................................................................................ 7

153

Open Settings for the QJ71E71-10 Ethernet Unit ............................................................................................. 8

16

Essential Cognex EasyBuilder Settings for Using FB......................................................................................... 9

17

Startup Check Method For In-Sight from Personal Computers Using Windows.............................................. 10

18

Related manuals.................................................................................................................................................11

19

Important ............................................................................................................................................................11

FB Library Details .................................................................................................................................................. 12

21

P+Cognex-In-Sight_LogOn (Establish Connection with Vision System) .............................................................. 12

22

P+Cognex-In-Sight_LoadJob (Selects, Changes and Activates Jobs)................................................................. 17

23

P+Cognex-In-Sight_TriggerAcq (Acquisition of Image Assessment Results) ....................................................... 22

24

P+Cognex-In-Sight_GetData (Value Acquisition of Symbolic Tags) ..................................................................... 26

25

P+Cognex-In-Sight_SetData (Value Change of Symbolic Tags).......................................................................... 31

26

P+Cognex-In-Sight_GetStatus (Online/Offline Acquisition) ................................................................................. 36

27

P+Cognex-In-Sight_SetOnline (Puts the In-Sight Vision System Online).......................................................... 40

28

P+Cognex-In-Sight_SetOffline (Takes the In-Sight Vision System Offline)........................................................ 44

29

P+Cognex-In-Sight_SaveJob (Save the Operation Job in Flash Memory) .......................................................... 48

210

P+Cognex-In-Sight_SendCmd (Native Command Send).................................................................................... 53

Appendix ............................................................................................................................................................... 58

31

Using Passwords to Prevent Reading/Writing in Ladder Programs ..................................................................... 58

32

Finding Out which Symbolic Tags can be Used with an FB................................................................................. 61

33

Type Conversion Processing Combination Table for P+Cognex-In-Sight_GetData.............................................. 62

34

Type Conversion Processing Combination Table of P+Cognex-In-Sight_SetData ............................................... 62

35

Usable Native Commands That Can Be Sent With P+Cognex-In-Sight_SendCmd ............................................. 63

4
41

Example of Using the FB Library............................................................................................................................ 65


Example of Operating In-Sight With Sequencer ............................................................................................... 65

Reference Manual Revision History


Version
v1.00A

Revised
Date
2009/02/20

Revision Contents

v1.01B

2009/06/01

1. Change due to a language review of the entire sentence


I/O address -> XY address
2. Corrections due to XY address range check processing change
All FBs: Error Code -100 Definition deletion
All FBs: Description change to the Valid range item in the "Unit installation
XY address input label
3. Corrections due to connection No. range check processing change
All FBs: Error Code -101 Definition deletion
All FBs: Error Code -102 Language correction
All FBs: Error Code -104 Language correction
All FBs: Error Code -105 Language correction
All FBs: Error Code -106 Language correction

v1.02C

2009/10/02

Correction of the number of connected units described in 1.3 System Configuration

v1.03D

2009/12/01

1. Description addition of L series CPU in 1.1 FB Library Outline.


2. 1.2 FB Library Function Contents were corrected as follows.
For P+Cognex-In-Sight_LogOn, QnUCPU w/ built-in Ethernet was changed
to CPU w/ built-in Ethernet port.
3. Language of 1.4: QnUCPU w/ built-in Ethernet was changed to CPU w/ built-in
Ethernet port.
4. FB Library Details - Description of Function: Corrected as follows.
All FBs: Target unit was changed from QnUCPU w/ built-in Ethernet to
CPU w/ built-in Ethernet port.
All FBs: L series CPU added to the target CPU.
All FBs: L series added to the GX Works2 version.
All FBs: Description of the input conditions for FB_EN deleted.
All FBs: FB operation: Pulse execution type (multiple scans) added.
5. FB Library Details - Input Labels: Changed as follows.
All FBs: Explanation for unit installation XY address changed to the
explanation for CPU w/ built-in Ethernet port.
6. FB Library Details - Related manuals: MELSEC-L CPU Users Manual added.

Newly created

7. FB Library Details - Connection Destination Settings: Corrected as follows.


P+Cognex-In-Sight_LogOn: CPU w/ built-in Ethernet changed to CPU
w/ built-in Ethernet port.

Outline

FB Library Outline

This FB library connects to Cognex Corporation In-Sight Vision Systems by using the QCPU w/ built-in Ethernet port
and LCPU (hereinafter, referred to as CPU w/ built-in Ethernet port) and ethernet unit QJ71E71-100.

FB Library Function Contents

No.
1

Item
P+Cognex-In-Sight_LogOn

2
3

P+Cognex-In-Sight_LoadJob
P+Cognex-In-Sight_TriggerAcq

P+Cognex-In-Sight_GetData

Acquires the data held by In-Sight.

P+Cognex-In-Sight_SetData

Changes the data held by In-Sight.

P+Cognex-In-Sight_GetStatus

Acquires the current status of the In-Sight Vision System (online/offline).

P+Cognex-In-Sight_SetOnline

Puts the In-Sight Vision System online.

P+Cognex-In-Sight_SetOffline

Takes the In-Sight Vision System offline.

P+Cognex-In-Sight_SaveJob

Saves the current job to the In-Sight Vision Systems flash memory.

10

P+Cognex-In-Sight_SendCmd

Sends the selected native command and receives the results.

Description
Establishes the connection between the CPU w/ built-in Ethernet port,
QJ71E71-100 module and the In-Sight Vision System.
Selects, changes and makes active jobs stored in the In-Sight Vision System.
After triggering loading of the In-Sight Vision System images, acquires the
result of the image assessment (pass / no pass).

System Configuration Example

In the Q series, the configuration is as follows. The system configuration is the same for the L series as well.

No.
1

Device Name
Q series sequencer

2
3
4

GX Works2
QJ71E71-100
Cognex In-Sight series

PoE (Power over Ethernet) Unit

Ethernet hub 100BASE-TX


compatible products

7
8

Windows personal computer


Cognex EasyBuilder Version 4.3

Explanation
Use base, power supply unit and QnUCPU unit w/ built-in Ethernet
with Serial Nos. with the first 5 digits of 11012 or later.
Use Version 1.09K or later
Q series sequencer ethernet unit
In-Sight Vision System
Connecting multiple devices with In-Sight is possible using an
ethernet hub.1
Power is supplied to the Cognex In-Sight series via an ethernet
cable.
Power can also be supplied using methods other than an ethernet
cable.
An ethernet hub is not essential. Operation is possible even with
system configurations directly connected to QnUCPU w/ built-in
Ethernet and ethernet units with the Cognex In-Sight series.
Used when connecting to the In-Sight series using EasyBuilder.
Used when connecting with In-Sight and for programming settings.

*1. Regarding the number of devices connected to an In-Sight Vision System


[CPU w/ built-in Ethernet port]
For using communication by FB and not using MC protocol: 16 devices or less (1 port is used for sending and receiving per
device)
For using communication by FB using MC protocol: 8 devices or less (2 ports are used per device, for sending and
receiving and for MC protocol)
[QJ71E71-100 module]
For using communication by FB and not using MC protocol: 8 devices or less (2 ports are used for sending and receiving
per device)
For using communication by FB using MC protocol: 5 devices or less (3 ports are used per device, for sending, for
receiving and for MC protocol)

Settings for the CPU Unit w/ Built-in Ethernet Port


Operation Settings for the CPU Unit w/ Built-in Ethernet Port

This section explains the settings for CPU units w/ built-in Ethernet ports used by this program.

Use GX Works2 to program the following items.


(1) Your IP address

Set the IP address of the ethernet unit as 192.168.0.2.

(2) Enable online change

Check the checkbox.

The following diagram is from GX Works2.

Open Settings for the CPU Unit w/ Built-in Ethernet Port

(1) Socket Communication settings


Select the connection No. that fits the system.
This will be the connection No. that is entered into the FB.
(a) Protocol
(b) Open System
(c) TCP connection
(d) Host Station Port No.
(hexadecimal number)
(e) Destination IP address
(f) Destination Port No.
(hexadecimal number)
(2) MC Protocol settings
(a) Protocol
(b) Open System
(c) TCP Connection
(d) Host Station Port No.
(hexadecimal number)
(e) Destination IP address
(f) Destination Port No.

Set to TCP.
Set to Socket Communication
Set to Active.
Enter the hexadecimal number that matches the In-Sight setting.
(Refer to 1.6) The default setting is 0017.
Enter the decimal number that matches the In-Sight setting. (Refer to 1.6)
The destination IP address is 192.168.0.1.
Enter the hexadecimal number that matches the In-Sight setting.
(Refer to 1.6) The default setting is 0017.
Set to TCP.
Set to MC Protocol.
No setting is required.
Enter the hexadecimal number that matches the In-Sight setting.
(Refer to 1.6) The default setting is 3000.
No setting is required.
No setting is required.

Use GX Works2 to program the 2 Connection Open settings.

Settings for the QJ71E71-100 Ethernet Unit


Operation Settings for the QJ71E71-100 Ethernet Unit

This section explains the QJ71E71-100 settings used by this program.

Use GX Works2 to program the following items.


(1) Start I/O No.

Enter in accordance with the installation unit No.


When installing in slot 0, set 0000.

(2) Network No.

Enter in accordance with the network configuration.


Set to 1.

(3) Station No.

Enter in accordance with the network configuration.


Set to 1.

(4) Your IP address

Set the IP address of the ethernet unit.


It is set to 192.168.0.3 in this program.

(5) Initial timing setting

Select Always wait for OPEN (Communication possible at STOP time).

(6) Enable Online Change

Check the checkbox.

The following screenshot is from GX Works2.

Initial Settings for the QJ71E71-100 Ethernet Unit


Existing set values for the QJ71E71-100 can be changed by setting the following items.

Dest. Confirmation Start Interval


Dest. Confirmation Interval
Dest. Confirmation Resend

Open Settings for the QJ71E71-10 Ethernet Unit

Use GX Works2 to program the 3 Connection Open settings.

(1) TCP Communication Settings


Select the connection No. that fits the system.
This will be the connection No. that is entered into the FB.
(a) Protocol
Set to TCP.
(b) Open System
Set to Active.
(c) Fixed Buffer Communication Procedure
Set to No Procedure.
(d) Pairing Open
Set to Enable.
(e) Existence Confirmation
Set to Confirm.
(f) Host StationPort No.
Enter the hexadecimal number that matches the In-Sight setting.
(hexadecimal number)
(Refer to 1.6) Enter 0BB8.
(g) Destination IP Address
Enter the decimal number that matches the In-Sight setting.
(Refer to 1.6) Enter 192.168.0.1.
(h) Destination Port No. (hexadecimal number)
Enter the hexadecimal number that matches the In-Sight setting.
(Refer to 1.6) Enter 0BB8.
(2) Connection No.3 (For MC protocol reception)
(a) Protocol
(b) Open System
(c) Fixed Buffer
(d) Fixed Buffer Communication Procedure
(e) Pairing Open
(f) Existence Confirmation
(g) Host Station Port No.
(hexadecimal number)
(h) Destination IP address
(i) Destination Port No.

Set to TCP.
Set to Unpassive.
Set to Receive.
Set to Procedure Exist.
Set to Disable.
Set to Confirm.
Enter the hexadecimal number that matches the In-Sight setting.
(Refer to 1.6) The default setting is 3000.
No setting is required.
No setting is required.

Essential Cognex EasyBuilder Settings for Using FB

This section explains the Cognex In-Sight settings used by this program.
Set the job file settings and the network setting.
For details, refer to In-Sight EasyBuilder Help.

Use EasyBuilder to program the following network settings.

(1) IP Address

Set the IP address of Cognex In-Sight to 192.168.0.1 so the IP address


settings of sequencer CPU in In-Sight EasyBuilder do not overlap.

(2) Subnet Mask

Set the subnet mask in In-Sight EasyBuilder to 255.255.255.0.

(3) Telnet Port No. (decimal number)

When connecting with the CPU w/ built-in Ethernet port, set to 23 in


In-Sight EasyBuilder.
When connecting with the QJ71E71-100, set to 3000 in In-Sight
EasyBuilder.

Startup Check Method For In-Sight from Personal Computers Using Windows

Use Command Prompt in Windows to check the startup of In-Sight by sending a ping.

(1) Click Start and select Run.

(2) In the Run dialog box, enter cmd and press the OK button.

(3) Enter the following command in Command Prompt to check the startup of In-Sight from the displayed response.
Ping 192.168.0.1

Related manuals
MELSEC-L CPU Unit Users Manual (Built-in Ethernet Function Edition)
QnUCPU Users Manual (Built-in Ethernet Port Communication Edition)
Q-compatible Ethernet Interface Unit Users Manual (Basic Edition)
In-Sight EasyBuilder Help

Important
Be sure to read the corresponding Users Manual before using each product.

FB Library Details

P+Cognex-In-Sight_LogOn (Establish Connection with Vision System)

Name
P+Cognex-In-Sight_LogOn

Description of Function

Item

Description

Summary of Function

Establishes the connection between the CPU w/ built-in Ethernet port, QJ71E71-100 module
and the In-Sight Vision System.

Symbol

Compatible Devices

Compatible units

CPU w/ built-in Ethernet port, QJ71E71-100 module

Compatible Vision
System

Cognex In-Sight

Compatible CPU
Series

Model

MELSEC-Q Series

QCPU w/ built-in Ethernet port*

MELSEC-L Series

LCPU

* Serial Nos. with the first 5 digits of 11012 or later.


GX Works2

Q Series CPU: Version 1.09K or later


L Series CPU: Version 1.20W or later

Language

Ladder

No. of Steps (Max.)

QCPU w/ built-in Ethernet port: 1412


* The number of steps is indicated as a reference for the number of steps in the label program.
For details, refer to GX Works2 Version 1 Operating Manual (Simple Project Edition).

Explanation of
Function

With FB_EN (execution command) ON, logs on to In-Sight from the ethernet unit.

Item

Description

FB Compile Method

Macro type

FB Operation

Pulse execution type (multiple scans)

I/O Signal Movement

[With normal end]

[With abnormal end]

[Execution
Command]

[Execution
Command]

[Execution
Status]

[Execution
Status]

[Normal
Completion]

[Normal
Completion]

[Abnormal
Completion]

[Abnormal
Completion]

[Error Code]

Constraints
(Cautions)

[Error Code]

1. This FB does not include error processing. Error processing can be created separately to
match your system and operation requirements.
2. When this FB is used, the connection destination must be set in advance in the open setting
of the network parameter. Refer to the Users Manual and be sure to complete the settings.
3. Do not implement multiple FBs simultaneously for the same camera; if necessary, execute
multiple FBs sequentially.

Related manuals

MELSEC-L CPU Unit Users Manual (Built-in Ethernet Function Edition)


QnUCPU Users Manual (Built-in Ethernet Port Communication Edition)
Q-compatible Ethernet Interface Unit Users Manual (Basic Edition)
In-Sight EasyBuilder Help

Error Codes

Error Code List


Error Code

Description

Action

Connection Open failed.

Perform the operation again after checking whether


the connection No. for the FB input label is not outside

-102

the acceptable range and whether the connection


destination settings in GX Works2 are correct.

-103
-104

Connection Open failed.

The corresponding connection is already open.

A communication error occurred.

Invalid data was received. Perform the operation again


after checking the line status and the ladder program.

A communication error occurred.

Perform the operation again after checking whether

-105

power has been disconnected to In-Sight or the


communications cable has been disconnected, etc.
A communication error occurred.

Perform the operation again after checking the


following.
1. Are multiple FBs running simultaneously?

-106

2. Is the connection No. for the FB input label outside


the acceptable range, or has an end logon to In-Sight
command been executed (excluding LogOn)?

-200

-201

-202

Logon to In-Sight failed with the entered

Re-confirm the user name and password.

user name and password.


The length of the user name exceeds 15

The user name must be 15 characters or less.

characters.
The length of the password exceeds 15

The password must be 15 characters or less.

characters.

Labels

Input Labels
Name

Variable name

Data type

Valid range

Description

Execution command

FB_EN

Bit

---

ON: Run the FB.


OFF: Do not run the FB.

Unit installation XY address

i_Start_IO_No

Word

Depends upon the


range of I/O points
in the
corresponding
CPU unit.
For the specific
range, refer to the
Users Manual for
the corresponding
CPU.

Use a hexadecimal number to


specify the first XY address
set in the corresponding
Ethernet unit. (For example,
enter H10 in the case of
X10.)
Enter H0FFFF if a CPU with
built-in Ethernet port is
selected.

Connection No.

i_Connection_No

Word

1 to 16 (decimal
number)

Specify the connection No. set


in the network parameter.

Timeout value

i_TimeOut

Word

1 to 32767
(decimal number)

Enter the length of the timeout


(in seconds) when
communication with In-Sight
is broken.
If no entry is made, or a
negative number or 0 is
entered, the value will be
automatically set to 30
(seconds).

User Name 1,2

i_UserName

Text
string

[0 to 9] [a to z]
[A to Z]

Enter a user name of 15


characters or less that can log
on to In-Sight.
If no entry is made, operator
is automatically entered.

Password 1,2

i_Password

Text
string

[0 to 9] [a to z]
[A to Z]

Enter a password of 15
characters or less for the user
name.
If no entry is made, the
password is sent as No
Password to In-Sight.

1: Use ASCII or Shift-JIS characters for the User name and Password input variables.
2: Passwords can be used in ladder programs to prevent reading of the User name and Password.
Refer to 3.1 Using Passwords to Prevent Reading/Writing in Ladder Programs.

Output labels
Name

Variable name

Data type

Default

Description

Execution status

FB_ENO

Bit

OFF

ON: The FB is running.


OFF: The FB is not running.

End flag

FB_OK

Bit

OFF

ON: The FB ended normally.


OFF: The FB did not end.

Abnormal end flag

FB_ERROR

Bit

OFF

ON: Abnormal FB end.


OFF: The FB did not end.

Error Code

ERROR_ID

Word

Returns the error code for the


abnormal result.

Connection Destination Settings

For operating In-Sight, the connection destination of the CPU w/ built-in Ethernet port and QJ71E71-100 module must be
set.
Set the corresponding connection destination of In-Sight from the PC parameter and network parameter
Ethernet/CC IE/MELSECNET for GX Works2.
Be sure to read 1.4 and 1.5 in this manual for the setting method.

FB Version Update History

Version

Date

Description

1.00A

2009/02/20

Newly created

1.01B

2009/06/01

XY address range check processing change


Connection No. range check processing change

Important
This chapter describes the function of the function block.
It does not describe the constraints of using the unit or sequencer CPU nor the constraints generated by their combination,
etc.
Be sure to read the corresponding Users Manual before using each product.

P+Cognex-In-Sight_LoadJob (Selects, Changes and Activates Jobs)

Name
P+Cognex-In-Sight_LoadJob

Description of Function

Item

Description

Summary of Function

Selects, changes and activates jobs stored in the In-Sight Vision System.

Symbol

Compatible Devices

Compatible units

CPU w/ built-in Ethernet port, QJ71E71-100 module

Compatible Vision

Cognex In-Sight

System
Compatible CPU
Series

Model

MELSEC-Q Series

QCPU w/ built-in Ethernet port*

MELSEC-L Series

LCPU

* Serial Nos. with the first 5 digits of 11012 or later.


GX Works2

Q Series CPU: Version 1.09K or later


L Series CPU: Version 1.20W or later

Language

Ladder

No. of Steps (Max.)

QCPU w/ built-in Ethernet port: 1356


* The number of steps is indicated as a reference for the number of steps in the label program.
For details, refer to GX Works2 Version 1 Operating Manual (Simple Project Edition).

Explanation of

With FB_EN (Execution Command) ON, selects, changes and activates jobs stored in the

Function

In-Sight Vision System.

FB Compile Method

Macro type

FB Operation

Pulse execution type (multiple scans)

Item

Description

I/O Signal Movement

[With normal end]

[With abnormal end]

[Execution
Command]

[Execution
Command]

[Execution
Status]

[Execution
Status]

[Normal
Completion]

[Normal
Completion]

[Abnormal
Completion]

[Abnormal
Completion]

[Error Code]

Constraints
(Cautions)

[Error Code]

1. This FB does not include error processing. Error processing can be created separately to
match your system and operation requirements.
2. In order to use this FB, it is necessary to use P+Cognex-In-Sight_LogOn and log onto
In-Sight beforehand.
3. In this FB, there is processing for going offline and online before and after job change
processing.
It is, therefore, not necessary to separately use FBs that execute offline and online
commands.
4. Do not implement multiple FBs simultaneously for the same camera; if necessary, execute
multiple FBs sequentially.

Related manuals

MELSEC-L CPU Unit Users Manual (Built-in Ethernet Function Edition)


QnUCPU Users Manual (Built-in Ethernet Port Communication Edition)
Q-compatible Ethernet Interface Unit Users Manual (Basic Edition)
In-Sight EasyBuilder Help

Error Codes

Error Code List


Error Code
-1
-2
-4
-5

-6

Description

Action

The specified value is outside the range or

Refer to the In-Sight manual.

is not a valid integer.


The command could not be executed.

Refer to the In-Sight manual.

In-Sights sensor does not have

Refer to the In-Sight manual.

sufficient memory.
The system is not online.

Refer to the In-Sight manual.

The user doesnt have the necessary

Refer to the In-Sight manual.

access privileges to execute the


command.
A communication error occurred.

Perform the operation again after checking whether

-105

power has been disconnected to In-Sight or the


communications cable has been disconnected, etc.
A communication error occurred.

Perform the operation again after checking the


following.
1. Are multiple FBs running simultaneously?

-106

2. Is the connection No. for the FB input label outside


the acceptable range, or has an end logon to In-Sight
command been executed (excluding LogOn)?

-300

The length of the job file name to be

Enter a job file name of between 1 and 32 characters,

changed is not between 1 and 32

including the extension.

characters.

Labels

Input Labels
Name

Variable name

Data type

Valid range

Description

Execution command

FB_EN

Bit

---

ON: Run the FB.


OFF: Do not run the FB.

Unit installation XY address

i_Start_IO_No

Word

Depends upon the

Use a hexadecimal number to

range of I/O points

specify the first XY address

in the

set in the corresponding

corresponding

Ethernet unit. (For example,

CPU unit.

enter H10 in the case of

For the specific

X10.)

range, refer to the

Enter H0FFFF if a CPU with

Users Manual for

built-in Ethernet port is

the corresponding

selected.

CPU.
Connection No.

i_Connection_No

Word

1 to 16 (decimal

Specifies the connection No.

number)

logged onto using


P+Cognex-In-Sight_LogOn.

Timeout value

i_TimeOut

Word

1 to 32767

Enter the length of the timeout

(decimal number)

(in seconds) when


communication with In-Sight
is broken.
If no entry is made, or a
negative number or 0 is
entered, the value will be
automatically set to 30
(seconds).

Selected job file name

i_JobFileName

Text

[0 to 9]

string

[A to Z]

[a to z]

Specifies the job file name


already saved in In-Sight
(1 to 32 characters).

1: Use ASCII or Shift-JIS characters for the Selected job file name input variable.
Output labels
Name

Variable name

Data type

Default

Execution status

FB_ENO

Bit

OFF

Description
ON: The FB is running.
OFF: The FB is not running.

End flag

FB_OK

Bit

OFF

ON: The FB ended normally.


OFF: The FB did not end.

Abnormal end flag

FB_ERROR

Bit

OFF

ON: Abnormal FB end.


OFF: The FB did not end.

Error Code

ERROR_ID

Word

Returns the error code for the


abnormal result.

FB Version Update History

Version

Date

Description

1.00A

2009/02/20

Newly created

1.01B

2009/06/01

XY address range check processing change


Connection No. range check processing change

Important

This chapter describes the function of the function block.


It does not describe the constraints of using the unit or sequencer CPU nor the constraints generated by their combination,
etc.
Be sure to read the corresponding Users Manual before using each product.

P+Cognex-In-Sight_TriggerAcq (Acquisition of Image Assessment Results)

Name
P+Cognex-In-Sight_TriggerAcq

Description of Function

Item

Description

Summary of Function

After triggering loading of the In-Sight Vision System images, acquires the result of the image
assessment (pass / no pass).

Symbol

Compatible Devices

Compatible units

CPU w/ built-in Ethernet port, QJ71E71-100 module

Compatible Vision

Cognex In-Sight

System
Compatible CPU
Series

Model

MELSEC-Q Series

QCPU w/ built-in Ethernet port*

MELSEC-L Series

LCPU

* Serial Nos. with the first 5 digits of 11012 or later.


GX Works2

Q Series CPU: Version 1.09K or later


L Series CPU: Version 1.20W or later

Language

Ladder

No. of Steps (Max.)

QCPU w/ built-in Ethernet port: 1652


* The number of steps is indicated as a reference for the number of steps in the label program.
For details, refer to GX Works2 Version 1 Operating Manual (Simple Project Edition).

Explanation of

With FB_EN (execution command) ON, triggers loading of the In-Sight Vision System images

Function

and then acquires the result of the image assessment (pass / no pass).

FB Compile Method

Macro type

FB Operation

Pulse execution type (multiple scans)

Item

Description

I/O Signal Movement

[With normal end]

[With abnormal end]

[Execution
Command]

[Execution
Command]

[Execution
Status]

[Execution
Status]

[Normal
Completion]

[Normal
Completion]

[Abnormal
Completion]

[Abnormal
Completion]

[Error Code]

Constraints
(Cautions)

[Error Code]

1. This FB does not include error processing. Error processing can be created separately to
match your system and operation requirements.
2. In order to use this FB, it is necessary to use P+Cognex-In-Sight_LogOn and log onto
In-Sight beforehand.
3. Do not implement multiple FBs simultaneously for the same camera; if necessary, execute
multiple FBs sequentially.

Related manuals

MELSEC-L CPU Unit Users Manual (Built-in Ethernet Function Edition)


QnUCPU Users Manual (Built-in Ethernet Port Communication Edition)
Q-compatible Ethernet Interface Unit Users Manual (Basic Edition)
In-Sight EasyBuilder Help

Error Codes

Error Code List


Error Code

Description

Action

-2

The command could not be executed.

Refer to the In-Sight manual.

The user doesnt have the necessary

Refer to the In-Sight manual.

-6

access privileges to execute the


command.

-104

A communication error occurred.

Invalid data was received. Perform the operation again


after checking the line status and the ladder program.

A communication error occurred.

Perform the operation again after checking whether

-105

power has been disconnected to In-Sight or the


communications cable has been disconnected, etc.
Perform the operation again after checking the
following.
1. Are multiple FBs running simultaneously?
2. Is the connection No. for the FB input label outside
the acceptable range, or has an end logon to In-Sight
command been executed (excluding LogOn)?

A communication error occurred.

-106

Labels

Input Labels
Name

Variable name

Data type

Valid range

Description

Execution command

FB_EN

Bit

---

ON: Run the FB.


OFF: Do not run the FB.

Unit installation XY address

i_Start_IO_No

Word

Depends upon the


range of I/O points
in the
corresponding
CPU unit.
For the specific
range, refer to the
Users Manual for
the corresponding

Use a hexadecimal number to


specify the first XY address
set in the corresponding
Ethernet unit. (For example,
enter H10 in the case of
X10.)
Enter H0FFFF if a CPU with
built-in Ethernet port is
selected.

CPU.
Connection No.

i_Connection_No

Word

1 to 16 (decimal
number)

Specifies the connection No.


logged onto using
P+Cognex-In-Sight_LogOn.

Timeout value

i_TimeOut

Word

1 to 32767
(decimal number)

Enter the length of the timeout


(in seconds) when
communication with In-Sight
is broken.
If no entry is made, or a
negative number or 0 is
entered, the value will be
automatically set to 30
(seconds).

Name

Variable name

Data type

Default

Description

Execution status

FB_ENO

Bit

OFF

ON: The FB is running.


OFF: The FB is not running.

Execution result

o_Result

Word

-1: Pass/no pass status


acquisition failure
0: Image assessment result is
no pass
1: Image assessment result is
no pass

End flag

FB_OK

Bit

OFF

ON: The FB ended normally.


OFF: The FB did not end.

Abnormal end flag

FB_ERROR

Bit

OFF

ON: Abnormal FB end.


OFF: The FB did not end.

Error Code

ERROR_ID

Word

Returns the error code for the


abnormal result.

Output labels

FB Version Update History

Version

Date

Description

1.00A

2009/02/20

Newly created

1.01B

2009/06/01

XY address range check processing change


Connection No. range check processing change

Important

This chapter describes the function of the function block.


It does not describe the constraints of using the unit or sequencer CPU nor the constraints generated by their combination,
etc.
Be sure to read the corresponding Users Manual before using each product.

P+Cognex-In-Sight_GetData (Value Acquisition of Symbolic Tags)

FB Definition Name
P+Cognex-In-Sight_GetData

Description of Function

Item

Description

Summary of Function

Acquires the data held by In-Sight.

Symbol

* When the symbolic tag name is unknown, refer to 3.2 Finding Out which Symbolic Tags can
be Used with an FB.

Compatible Devices

Compatible units

CPU w/ built-in Ethernet port, QJ71E71-100 module

Compatible Vision

Cognex In-Sight

System
Compatible CPU
Series

Model

MELSEC-Q Series

QCPU w/ built-in Ethernet port*

MELSEC-L Series

LCPU

* Serial Nos. with the first 5 digits of 11012 or later.


GX Works2

Q Series CPU: Version 1.09K or later


L Series CPU: Version 1.20W or later

Language

Ladder

No. of Steps (Max.)

QCPU w/ built-in Ethernet port: 1512


* The number of steps is indicated as a reference for the number of steps in the label program.
For details, refer to GX Works2 Version 1 Operating Manual (Simple Project Edition).

Item

Description

Explanation of

With FB_EN (execution command) ON, sends the symbolic tag set in i_tag to the In-Sight

Function

Vision System, and acquires the value.

FB Compile Method

Macro type

FB Operation

Pulse execution type (multiple scans)

I/O Signal Movement

[With normal end]

[With abnormal end]

[Execution
Command]

[Execution
Command]

[Execution
Status]

[Execution
Status]

[Normal
Completion]

[Normal
Completion]

[Abnormal
Completion]

[Abnormal
Completion]

[Error Code]

Constraints
(Cautions)

[Error Code]

1. This FB does not include error processing. Error processing can be created separately to
match your system and operation requirements.
2. In order to use this FB, it is necessary to use P+Cognex-In-Sight_LogOn and log onto
In-Sight beforehand.
3. Do not implement multiple FBs simultaneously for the same camera; if necessary, execute
multiple FBs sequentially.
4. Be sure to match the type of value received with i_Result_Type.
When the type does not match, a CPU operation error may occur when the type is converted.
For details refer to "3.3 Type Conversion Processing Combination Table for
P+Cognex-In-Sight_GetData".

Related manuals

MELSEC-L CPU Unit Users Manual (Built-in Ethernet Function Edition)


QnUCPU Users Manual (Built-in Ethernet Port Communication Edition)
Q-compatible Ethernet Interface Unit Users Manual (Basic Edition)
In-Sight EasyBuilder Help

Error Codes

Error Code List


Error Code
-1
-2

-6

Description

Action

The specified value is outside the range or

Refer to the In-Sight manual.

is not a valid integer.


The command could not be executed.

Refer to the In-Sight manual.

The user doesnt have the necessary

Refer to the In-Sight manual.

access privileges to execute the


command.

-104

A communication error occurred.

Invalid data was received. Perform the operation again


after checking the line status and the ladder program.

A communication error occurred.

Perform the operation again after checking whether

-105

power has been disconnected to In-Sight or the


communications cable has been disconnected, etc.
A communication error occurred.

Perform the operation again after checking the


following.
1. Are multiple FBs running simultaneously?

-106

2. Is the connection No. for the FB input label outside


the acceptable range, or has an end logon to In-Sight
command been executed (excluding LogOn)?

-301
-305

The length of the symbolic tag name is not

Enter a symbolic tag name of between 1 and 32

between 1 and 32 characters.

characters.

The set data type is not between 0 and 4.

Set the data type to between 0 and 4.

Labels

Input Labels
Name

Variable name

Data type

Valid range

Description

Execution command

FB_EN

Bit

---

ON: Run the FB.


OFF: Do not run the FB.

Unit installation XY address

i_Start_IO_No

Connection No.

i_Connection_No

Word

Word

Depends upon the

Use a hexadecimal number

range of I/O points

to specify the first XY address

in the corresponding

set in the corresponding

CPU unit.

Ethernet unit. (For example,

For the specific

enter H10 in the case of

range, refer to the

X10.)

Users Manual for

Enter H0FFFF if a CPU with

the corresponding

built-in Ethernet port is

CPU.

selected.

1 to 16 (decimal

Specifies the connection No.

number)

logged onto using


P+Cognex-In-Sight_LogOn.

Timeout value

i_TimeOut

Word

1 to 32767 (decimal

Enter the length of the

number)

timeout (in seconds) when


communication with
In-Sight is broken.
If no entry is made, or a
negative number or 0 is
entered, the value will be
automatically set to 30
(seconds).

Symbolic tag

i_tag

Text string

[0 to 9]

[a to z]

[A to Z]

Sets the transmitted symbolic


tag to between 1 to 32
characters.

Data type of the received value

i_Result_Type

Word

0 to 4 (decimal

Specifies the data type of the

number)

received value for the


symbolic tag.
0: Text string
1: 16 bit integer (0 or 1)
2: 16 bit integer
3: 32 bit integer
4: Single-precision real
number (32 bits)

1: Use ASCII or Shift-JIS characters for the Symbolic tag input variable.
2: For the type conversion operation of the received value data type and received data, refer to 3.3 Type Conversion
Processing Combination Table for P+Cognex-In-Sight_GetData.

Output labels
Name

Variable name

Data type

Default

Description

Execution status

FB_ENO

Bit

OFF

ON: The FB is running.


OFF: The FB is not running.

Execution result

o_Result

Text string

The result for the sent

16 bit integer

symbolic tag will be saved.

32 bit integer

For a text string, a maximum

Single-

of 255 characters is stored.

precision real
number
End flag

FB_OK

Bit

OFF

ON: The FB ended normally.


OFF: The FB did not end.

Abnormal end flag

FB_ERROR

Bit

OFF

ON: Abnormal FB end.


OFF: The FB did not end.

Error Code

ERROR_ID

Word

Returns the error code for the


abnormal result.

FB Version Update History


Version

Date

Description

1.00A

2009/02/20

Newly created

1.01B

2009/06/01

XY address range check processing change


Connection No. range check processing change

Important

This chapter describes the function of the function block.


It does not describe the constraints of using the unit or sequencer CPU nor the constraints generated by their combination,
etc.
Be sure to read the corresponding Users Manual before using each product.

P+Cognex-In-Sight_SetData (Value Change of Symbolic Tags)

1. Name
Name
P+Cognex-In-Sight_SetData

Description of Function

Item

Description

Summary of Function

Changes the data held by In-Sight.

Symbol

* When the symbolic tag name is unknown, refer to


3.2 Finding Out which Symbolic Tags can be Used with an FB.

Compatible Devices

Compatible units

CPU w/ built-in Ethernet port, QJ71E71-100 module

Compatible Vision

Cognex In-Sight

System
Compatible CPU
Series

Model

MELSEC-Q Series

QCPU w/ built-in Ethernet port*

MELSEC-L Series

LCPU

* Serial Nos. with the first 5 digits of 11012 or later.


GX Works2

Q Series CPU: Version 1.09K or later


L Series CPU: Version 1.20W or later

Language

Ladder

Item

Description

No. of Steps (Max.)

QCPU w/ built-in Ethernet port: 2323


* The number of steps is indicated as a reference for the number of steps in the label program.
For details, refer to GX Works2 Version 1 Operating Manual (Simple Project Edition).

Explanation of

With FB_EN (execution command) ON, sends a random symbolic tag to the In-Sight Vision

Function

System, and sets the value.

FB Compile Method

Macro type

FB Operation

Pulse execution type (multiple scans)

I/O Signal Movement

[With normal end]

[With abnormal end]

[Execution
Command]

[Execution
Command]

[Execution
Status]

[Execution
Status]

[Normal
Completion]

[Normal
Completion]

[Abnormal
Completion]

[Abnormal
Completion]

[Error Code]

Constraints
(Cautions)

Related manuals

[Error Code]

1. This FB does not include error processing. Error processing can be created separately to
match your system and operation requirements.
2. In order to use this FB, it is necessary to use P+Cognex-In-Sight_LogOn and log onto
In-Sight beforehand.
3. In this FB, there is processing for going offline and online before and after data change
processing.
It is, therefore, not necessary to separately use FBs that execute offline and online commands.
4. Do not implement multiple FBs simultaneously for the same camera; if necessary, execute
multiple FBs sequentially.
5. Do not directly enter the value for i_tag_Value and i_tag_Data_Type.
Create the MAIN program so it refers to the values stored in D300, etc.
When the values are entered directly, an operation CPU error may occur.
6. Be sure to match the type of i_tag_Data_Type with i_tag_Value.
When the type does not match, an operation CPU error may occur when the type is
converted.
For details, refer to 3.4 Type Conversion Processing Combination Table for
P+Cognex-In-Sight_SetData.
MELSEC-L CPU Unit Users Manual (Built-in Ethernet Function Edition)
QnUCPU Users Manual (Built-in Ethernet Port Communication Edition)
Q-compatible Ethernet Interface Unit Users Manual (Basic Edition)
In-Sight EasyBuilder Help

Error Codes

Error Code List


Error Code
-1

Description

Action

The specified value is outside the range or

Refer to the In-Sight manual.

is not a valid integer.

-2

The command could not be executed.

Refer to the In-Sight manual.

-5

The system is not online.

Refer to the In-Sight manual.

The user doesnt have the necessary

Refer to the In-Sight manual.

-6

access privileges to execute the


command.

-104

A communication error occurred.

Invalid data was received. Perform the operation again


after checking the line status and the ladder program.

A communication error occurred.

Perform the operation again after checking whether

-105

power has been disconnected to In-Sight or the


communications cable has been disconnected, etc.
A communication error occurred.

Perform the operation again after checking the


following.
1. Are multiple FBs running simultaneously?

-106

2. Is the connection No. for the FB input label outside


the acceptable range, or has an end logon to In-Sight
command been executed (excluding LogOn)?

-301

-302
-305

The length of the symbolic tag name is not

Enter a symbolic tag name of between 1 and 32

between 1 and 32 characters.

characters.

The set value length is not between 1 and

Enter a set value length of between 1 and 32

32 characters.

characters.

The set data type is not between 0 and 4.

Set the data type to between 0 and 4.

Labels

Input Labels
Name

Variable name

Data type

Valid range

Description

Execution command

FB_EN

Bit

---

ON: Run the FB.


OFF: Do not run the FB.

Unit installation XY
address

i_Start_IO_No

Word

Depends upon the


range of I/O points in
the corresponding
CPU unit.
For the specific
range, refer to the
Users Manual for
the corresponding
CPU.

Use a hexadecimal number to


specify the first XY address set in
the corresponding Ethernet unit.
(For example, enter H10 in the
case of X10.)
Enter H0FFFF if a CPU with
built-in Ethernet port is selected.

Connection No.

i_Connection_No

Word

1 to 16 (decimal
number)

Specifies the connection No.


logged onto using
P+Cognex-In-Sight_LogOn.

Timeout value

i_TimeOut

Word

1 to 32767 (decimal
number)

Enter the length of the timeout (in


seconds) when communication
with In-Sight is broken.
If no entry is made, or a negative
number or 0 is entered, the
value will be automatically set to
30 (seconds).

Symbolic tag

i_tag

Text string

[0 to 9] [a to z]
[A to Z]

Sets the transmitted symbolic tag


to between 1 to 32 characters.

Set value1,2

i_tag_Value

Text string
16 bit integer
32 bit integer
Singleprecision real
number

---

Sets the value specified in the


data type of the set value.
When saving a text string, enter
between 1 and 32 characters.

Data type of the set


value2

i_tag_Data_Type

Word

0 to 4 (decimal
number)

Specifies the data type of the


transmitted value.
0: Text string (1 to 32 characters)
1: 16 bit integer (0 or 1)
2: 16 bit integer
3: 32 bit integer
4: Single-precision real number
(32 bits)

1: Use ASCII or Shift-JIS characters for the Symbolic tag and Set value (when the set value data type is a text string)
input variables.
2: Refer to 3.4 Type Conversion Processing Combination Table for P+Cognex-In-Sight_SetData for the type conversion
operation of the set value data type and set values.

Output labels
Name

Variable name

Data type

Default

Description

Execution status

FB_ENO

Bit

OFF

ON: The FB is running.


OFF: The FB is not running.

Execution result

o_Result

Word

0: Setting not complete.


1: Setting complete.

End flag

FB_OK

Bit

OFF

ON: The FB ended normally.


OFF: The FB did not end.

Abnormal end flag

FB_ERROR

Bit

OFF

ON: Abnormal FB end.


OFF: The FB did not end.

Error Code

ERROR_ID

Word

Returns the error code for the


abnormal result.

FB Version Update History

Version

Date

Description

1.00A

2009/02/20

Newly created

1.01B

2009/06/01

XY address range check processing change


Connection No. range check processing change

Important
This chapter describes the function of the function block.
It does not describe the constraints of using the unit or sequencer CPU nor the constraints generated by their combination,
etc.
Be sure to read the corresponding Users Manual before using each product.

P+Cognex-In-Sight_GetStatus (Online/Offline Acquisition)

Name
P+Cognex-In-Sight_GetStatus

Description of Function

Item

Description

Summary of Function

Acquires the current status of the In-Sight Vision System (online/offline).

Symbol

Compatible Devices

Compatible units

CPU w/ built-in Ethernet port, QJ71E71-100 module

Compatible Vision

Cognex In-Sight

System
Compatible CPU
Series

Model

MELSEC-Q Series

QCPU w/ built-in Ethernet port*

MELSEC-L Series

LCPU

* Serial Nos. with the first 5 digits of 11012 or later.


GX Works2

Q Series CPU: Version 1.09K or later


L Series CPU: Version 1.20W or later

Language

Ladder

No. of Steps (Max.)

QCPU w/ built-in Ethernet port: 700


* The number of steps is indicated as a reference for the number of steps in the label program.
For details, refer to GX Works2 Version 1 Operating Manual (Simple Project Edition).

Explanation of

With FB_EN (execution command) ON, acquires the current status of the In-Sight Vision

Function

System (online/offline).

FB Compile Method

Macro type

FB Operation

Pulse execution type (multiple scans)

Item

Description

I/O Signal Movement

[With normal end]

[With abnormal end]

[Execution
Command]

[Execution
Command]

[Execution
Status]

[Execution
Status]

[Normal
Completion]

[Normal
Completion]

[Abnormal
Completion]

[Abnormal
Completion]

[Error Code]

Constraints
(Cautions)

Related manuals

[Error Code]

1. This FB does not include error processing. Error processing can be created separately to
match your system and operation requirements.
2. In order to use this FB, it is necessary to use P+Cognex-In-Sight_LogOn and log onto
In-Sight beforehand.
3. Do not implement multiple FBs simultaneously for the same camera; if necessary, execute
multiple FBs sequentially.
MELSEC-L CPU Unit Users Manual (Built-in Ethernet Function Edition)
QnUCPU Users Manual (Built-in Ethernet Port Communication Edition)
Q-compatible Ethernet Interface Unit Users Manual (Basic Edition)
In-Sight EasyBuilder Help

Error Codes

Error Code List


Error Code

Description

Action

-2

The command could not be executed.

Refer to the In-Sight manual.


Refer to the In-Sight manual.

-6

The user doesnt have the necessary


access privileges to execute the
command.
A communication error occurred.

Perform the operation again after checking whether

-105

power has been disconnected to In-Sight or the


communications cable has been disconnected, etc.
A communication error occurred.

Perform the operation again after checking the


following.
1. Are multiple FBs running simultaneously?
2. Is the connection No. for the FB input label outside
the acceptable range, or has an end logon to In-Sight
command been executed (excluding LogOn)?

-106

Labels

Input Labels
Name

Variable name

Data type

Valid range

Description

Execution command

FB_EN

Bit

---

ON: Run the FB.


OFF: Do not run the FB.

Unit installation XY address

i_Start_IO_No

Word

Depends upon the


range of I/O points
in the
corresponding
CPU unit.
For the specific
range, refer to the
Users Manual for
the corresponding
CPU.

Use a hexadecimal number to


specify the first XY address
set in the corresponding
Ethernet unit. (For example,
enter H10 in the case of
X10.)
Enter H0FFFF if a CPU with
built-in Ethernet port is
selected.

Connection No.

i_Connection_No

Word

1 to 16 (decimal
number)

Specifies the connection No.


logged onto using
P+Cognex-In-Sight_LogOn.

Timeout value

i_TimeOut

Word

1 to 32767
(decimal number)

Enter the length of the timeout


(in seconds) when
communication with In-Sight
is broken.
If no entry is made, or a
negative number or 0 is
entered, the value will be
automatically set to 30
(seconds).

Name

Variable name

Data type

Default

Description

Execution status

FB_ENO

Bit

OFF

ON: The FB is running.


OFF: The FB is not running.

Execution result

o_Result

Word

0: Offline
1: Online

End flag

FB_OK

Bit

OFF

ON: The FB ended normally.


OFF: The FB did not end.

Abnormal end flag

FB_ERROR

Bit

OFF

ON: Abnormal FB end.


OFF: The FB did not end.

Error Code

ERROR_ID

Word

Returns the error code for the


abnormal result.

Output labels

FB Version Update History

Version

Date

Description

1.00A

2009/02/20

Newly created

1.01B

2009/06/01

XY address range check processing change


Connection No. range check processing change

Important
This chapter describes the function of the function block.
It does not describe the constraints of using the unit or sequencer CPU nor the constraints generated by their combination,
etc.
Be sure to read the corresponding Users Manual before using each product.

P+Cognex-In-Sight_SetOnline (Puts the In-Sight Vision System Online)

Name
P+Cognex-In-Sight_SetOnline

Description of Function

Item

Description

Summary of Function

Puts the In-Sight Vision System online.

Symbol

Compatible Devices

Compatible units

CPU w/ built-in Ethernet port, QJ71E71-100 module

Compatible Vision

Cognex In-Sight

System
Compatible CPU
Series

Model

MELSEC-Q Series

QCPU w/ built-in Ethernet port*

MELSEC-L Series

LCPU

* Serial Nos. with the first 5 digits of 11012 or later.


GX Works2

Q Series CPU: Version 1.09K or later


L Series CPU: Version 1.20W or later

Language

Ladder

No. of Steps (Max.)

QCPU w/ built-in Ethernet port: 697


* The number of steps is indicated as a reference for the number of steps in the label program.
For details, refer to GX Works2 Version 1 Operating Manual (Simple Project Edition).

Explanation of

With FB_EN (execution command) ON, puts the In-Sight Vision System online.

Function

FB Compile Method

Macro type

FB Operation

Pulse execution type (multiple scans)

Item

Description

I/O Signal Movement

[With normal end]

[With abnormal end]

[Execution
Command]

[Execution
Command]

[Execution
Status]

[Execution
Status]

[Normal
Completion]

[Normal
Completion]

[Abnormal
Completion]

[Abnormal
Completion]

[Error Code]

Constraints
(Cautions)

[Error Code]

1. This FB does not include error processing. Error processing can be created separately to
match your system and operation requirements.
2. In order to use this FB, it is necessary to use P+Cognex-In-Sight_LogOn and log onto
In-Sight beforehand.
3. Do not implement multiple FBs simultaneously for the same camera; if necessary, execute
multiple FBs sequentially.

Related manuals

MELSEC-L CPU Unit Users Manual (Built-in Ethernet Function Edition)


QnUCPU Users Manual (Built-in Ethernet Port Communication Edition)
Q-compatible Ethernet Interface Unit Users Manual (Basic Edition)
In-Sight EasyBuilder Help

Error Codes

Error Code List


Error Code

Description

Action

-2

The command could not be executed.

Refer to the In-Sight manual.

-5

The system is not online.

Refer to the In-Sight manual.

The user doesnt have the necessary

Refer to the In-Sight manual.

-6

access privileges to execute the


command.
A communication error occurred.

Perform the operation again after checking whether


power has been disconnected to In-Sight or the
communications cable has been disconnected, etc.

A communication error occurred.

Perform the operation again after checking the


following.
1. Are multiple FBs running simultaneously?
2. Is the connection No. for the FB input label outside
the acceptable range, or has an end logon to In-Sight
command been executed (excluding LogOn)?

-105

-106

Labels

Input Labels
Name

Variable name

Data type

Valid range

Description

Execution command

FB_EN

Bit

---

ON: Run the FB.


OFF: Do not run the FB.

Unit installation XY address

i_Start_IO_No

Word

Depends upon the

Use a hexadecimal number to

range of I/O points

specify the first XY address

in the

set in the corresponding

corresponding

Ethernet unit. (For example,

CPU unit.

enter H10 in the case of

For the specific

X10.)

range, refer to the

Enter H0FFFF if a CPU with

Users Manual for

built-in Ethernet port is

the corresponding

selected.

CPU.
Connection No.

i_Connection_No

Word

1 to 16 (decimal

Specifies the connection No.

number)

logged onto using


P+Cognex-In-Sight_LogOn.

Timeout value

i_TimeOut

Word

1 to 32767

Enter the length of the timeout

(decimal number)

(in seconds) when


communication with In-Sight
is broken.
If no entry is made, or a
negative number or 0 is
entered, the value will be
automatically set to 30
(seconds).

Output labels
Name

Variable name

Data type

Default

Description

Execution status

FB_ENO

Bit

OFF

ON: The FB is running.


OFF: The FB is not running.

End flag

FB_OK

Bit

OFF

ON: The FB ended normally.


OFF: The FB did not end.

Abnormal end flag

FB_ERROR

Bit

OFF

ON: Abnormal FB end.


OFF: The FB did not end.

Error Code

ERROR_ID

Word

Returns the error code.

FB Version Update History

Version

Date

Description

1.00A

2009/02/20

Newly created

1.01B

2009/06/01

XY address range check processing change


Connection No. range check processing change

Important
This chapter describes the function of the function block.
It does not describe the constraints of using the unit or sequencer CPU nor the constraints generated by their combination,
etc.
Be sure to read the corresponding Users Manual before using each product.

P+Cognex-In-Sight_SetOffline (Takes the In-Sight Vision System Offline)

Name
P+Cognex-In-Sight_SetOffline

Description of Function

Item

Description

Summary of Function

Takes the In-Sight Vision System offline.

Symbol

Compatible Devices

Compatible units

CPU w/ built-in Ethernet port, QJ71E71-100 module

Compatible Vision

Cognex In-Sight

System
Compatible CPU
Series

Model

MELSEC-Q Series

QCPU w/ built-in Ethernet port*

MELSEC-L Series

LCPU

* Serial Nos. with the first 5 digits of 11012 or later.


GX Works2

Q Series CPU: Version 1.09K or later


L Series CPU: Version 1.20W or later

Language

Ladder

No. of Steps (Max.)

QCPU w/ built-in Ethernet port: 688


* The number of steps is indicated as a reference for the number of steps in the label program.
For details, refer to GX Works2 Version 1 Operating Manual (Simple Project Edition).

Explanation of

With FB_EN (execution command) ON, takes the In-Sight Vision System offline.

Function

FB Compile Method

Macro type

FB Operation

Pulse execution type (multiple scans)

Item

Description

I/O Signal Movement

[With normal end]

[With abnormal end]

[Execution
Command]

[Execution
Command]

[Execution
Status]

[Execution
Status]

[Normal
Completion]

[Normal
Completion]

[Abnormal
Completion]

[Abnormal
Completion]

[Error Code]

Constraints
(Cautions)

Related manuals

[Error Code]

1. This FB does not include error processing. Error processing can be created separately to
match your system and operation requirements.
2. In order to use this FB, it is necessary to use P+Cognex-In-Sight_LogOn and log onto
In-Sight beforehand.
3. Do not implement multiple FBs simultaneously for the same camera; if necessary, execute
multiple FBs sequentially.
MELSEC-L CPU Unit Users Manual (Built-in Ethernet Function Edition)
QnUCPU Users Manual (Built-in Ethernet Port Communication Edition)
Q-compatible Ethernet Interface Unit Users Manual (Basic Edition)
In-Sight EasyBuilder Help

Error Codes

Error Code List


Error Code

Description

Action

-2

The command could not be executed.

Refer to the In-Sight manual.


Refer to the In-Sight manual.

-6

The user doesnt have the necessary


access privileges to execute the
command.
A communication error occurred.

Perform the operation again after checking whether

-105

power has been disconnected to In-Sight or the


communications cable has been disconnected, etc.
A communication error occurred.

Perform the operation again after checking the


following.
1. Are multiple FBs running simultaneously?
2. Is the connection No. for the FB input label outside
the acceptable range, or has an end logon to In-Sight
command been executed (excluding LogOn)?

-106

Labels

Input Labels
Name

Variable name

Data type

Valid range

Description

Execution command

FB_EN

Bit

---

ON: Run the FB.


OFF: Do not run the FB.

Unit installation XY address

i_Start_IO_No

Word

Depends upon the


range of I/O points
in the
corresponding
CPU unit.
For the specific
range, refer to the
Users Manual for
the corresponding
CPU.

Use a hexadecimal number to


specify the first XY address
set in the corresponding
Ethernet unit. (For example,
enter H10 in the case of
X10.)
Enter H0FFFF if a CPU with
built-in Ethernet port is
selected.

Connection No.

i_Connection_No

Word

1 to 16 (decimal
number)

Specifies the connection No.


logged onto using
P+Cognex-In-Sight_LogOn.

Timeout value

i_TimeOut

Word

1 to 32767
(decimal number)

Enter the length of the timeout


(in seconds) when
communication with In-Sight
is broken.
If no entry is made, or a
negative number or 0 is
entered, the value will be
automatically set to 30
(seconds).

Name

Variable name

Data type

Default

Description

Execution status

FB_ENO

Bit

OFF

ON: The FB is running.


OFF: The FB is not running.

End flag

FB_OK

Bit

OFF

ON: The FB ended normally.


OFF: The FB did not end.

Abnormal end flag

FB_ERROR

Bit

OFF

ON: Abnormal FB end.


OFF: The FB did not end.

Error Code

ERROR_ID

Word

Returns the error code.

Output labels

FB Version Update History

Version

Date

Description

1.00A

2009/02/20

Newly created

1.01B

2009/06/01

XY address range check processing change


Connection No. range check processing change

Important
This chapter describes the function of the function block.
It does not describe the constraints of using the unit or sequencer CPU nor the constraints generated by their combination,
etc.
Be sure to read the corresponding Users Manual before using each product.

P+Cognex-In-Sight_SaveJob (Save the Operation Job in Flash Memory)

Name
P+Cognex-In-Sight_SaveJob

Description of Function

Item

Description

Summary of Function

Saves the current job to the In-Sight Vision Systems flash memory.

Symbol

Compatible Devices

Compatible units

CPU w/ built-in Ethernet port, QJ71E71-100 module

Compatible Vision

Cognex In-Sight

System
Compatible CPU
Series

Model

MELSEC-Q Series

QCPU w/ built-in Ethernet port*

MELSEC-L Series

LCPU

* Serial Nos. with the first 5 digits of 11012 or later.


GX Works2

Q Series CPU: Version 1.09K or later


L Series CPU: Version 1.20W or later

Language

Ladder

No. of Steps (Max.)

QCPU w/ built-in Ethernet port: 1351


* The number of steps is indicated as a reference for the number of steps in the label program.
For details, refer to GX Works2 Version 1 Operating Manual (Simple Project Edition).

Explanation of

With FB_EN (execution command) ON, saves the current job to the In-Sight Vision Systems

Function

flash memory.

FB Compile Method

Macro type

FB Operation

Pulse execution type (multiple scans)

Item

Description

I/O Signal Movement

[With normal end]

[With abnormal end]

[Execution
Command]

[Execution
Command]

[Execution
Status]

[Execution
Status]

[Normal
Completion]

[Normal
Completion]

[Abnormal
Completion]

[Abnormal
Completion]

[Error Code]

Constraints
(Cautions)

[Error Code]

1. This FB does not include error processing. Error processing can be created separately to
match your system and operation requirements.
2. In order to use this FB, it is necessary to use P+Cognex-In-Sight_LogOn and log onto
In-Sight beforehand.
3. In this FB, there is processing for going offline and online before and after save processing.
It is, therefore, not necessary to separately use FBs that execute offline and online
commands.
4. Do not implement multiple FBs simultaneously for the same camera; if necessary, execute
multiple FBs sequentially.

Related manuals

MELSEC-L CPU Unit Users Manual (Built-in Ethernet Function Edition)


QnUCPU Users Manual (Built-in Ethernet Port Communication Edition)
Q-compatible Ethernet Interface Unit Users Manual (Basic Edition)
In-Sight EasyBuilder Help

Error Codes

Error Code List


Error Code

-2

Description

Action

The command could not be executed

Refer to the In-Sight manual.

because saving the job failed, In-Sight


was online, or the file was not found.

-5

-6

The system is not online.

Refer to the In-Sight manual.

The user doesnt have the necessary

Refer to the In-Sight manual.

access privileges to execute the


command.
A communication error occurred.

Perform the operation again after checking whether

-105

power has been disconnected to In-Sight or the


communications cable has been disconnected, etc.
A communication error occurred.

Perform the operation again after checking the


following.
1. Are multiple FBs running simultaneously?

-106

2. Is the connection No. for the FB input label outside


the acceptable range, or has an end logon to In-Sight
command been executed (excluding LogOn)?

-303

The length of the job file name to be saved

Enter a job file name of between 1 and 32 characters,

is not between 1 and 32 characters.

including the extension.

Labels

Input Labels
Name

Variable name

Data type

Valid range

Description

Execution command

FB_EN

Bit

---

ON: Run the FB.


OFF: Do not run the FB.

Unit installation XY address

i_Start_IO_No

Word

Depends upon the

Use a hexadecimal number to

range of I/O points

specify the first XY address

in the

set in the corresponding

corresponding

Ethernet unit. (For example,

CPU unit.

enter H10 in the case of

For the specific

X10.)

range, refer to the

Enter H0FFFF if a CPU with

Users Manual for

built-in Ethernet port is

the corresponding

selected.

CPU.
Connection No.

i_Connection_No

Word

1 to 16 (decimal

Specifies the connection No.

number)

logged onto using


P+Cognex-In-Sight_LogOn.

Timeout value

i_TimeOut

Word

1 to 32767

Enter the length of the timeout

(decimal number)

(in seconds) when


communication with In-Sight
is broken.
If no entry is made, or a
negative number or 0 is
entered, the value will be
automatically set to 30
(seconds).

Save job file name

i_JobFileName

Text

[0 to 9]

string

[A to Z]

[a to z]

Specifies a job file name to be


saved in In-Sight of between
1 and 32 characters.

1: Use ASCII or Shift-JIS characters for the Save job file name input variable.
Output labels
Name

Variable name

Data type

Default

Description

Execution status

FB_ENO

Bit

OFF

ON: The FB is running.


OFF: The FB is not running.

End flag

FB_OK

Bit

OFF

ON: The FB ended normally.


OFF: The FB did not end.

Abnormal end flag

FB_ERROR

Bit

OFF

ON: Abnormal FB end.


OFF: The FB did not end.

Error Code

ERROR_ID

Word

Returns the error code.

FB Version Update History

Version

Date

Description

1.00A

2009/02/20

Newly created

1.01B

2009/06/01

XY address range check processing change


Connection No. range check processing change

Important
This chapter describes the function of the function block.
It does not describe the constraints of using the unit or sequencer CPU nor the constraints generated by their combination,
etc.
Be sure to read the corresponding Users Manual before using each product.

P+Cognex-In-Sight_SendCmd (Native Command Send)

Name
P+Cognex-In-Sight_SendCmd

Description of Function

Item

Description

Summary of Function

Sends the selected native command and receives the results.

Symbol

* When the native command to be sent is unknown, refer to 3.5 Usable Native Commands that
can be sent with P+Cognex-In-Sight_SendCmd.

Compatible Devices

Compatible units

CPU w/ built-in Ethernet port, QJ71E71-100 module

Compatible Vision System

Cognex In-Sight

Compatible CPU
Series

Model

MELSEC-Q Series

QCPU w/ built-in Ethernet port*

MELSEC-L Series

LCPU

* Serial Nos. with the first 5 digits of 11012 or later.


GX Works2

Q Series CPU: Version 1.09K or later


L Series CPU: Version 1.20W or later

Language

Ladder

No. of Steps (Max.)

QCPU w/ built-in Ethernet port: 778


* The number of steps is indicated as a reference for the number of steps in the label program.
For details, refer to GX Works2 Version 1 Operating Manual (Simple Project Edition).

Explanation of

With FB_EN (execution command) ON, sends and receives a random native command.

Function

FB Compile Method

Macro type

FB Operation

Pulse execution type (multiple scans)

Item

Description

I/O Signal Movement

[With normal end]

[With abnormal end]

[Execution
Command]

[Execution
Command]

[Execution
Status]

[Execution
Status]

[Normal
Completion]

[Normal
Completion]

[Abnormal
Completion]

[Abnormal
Completion]

[Error Code]

Constraints
(Cautions)

[Error Code]

1. This FB does not include error processing. Error processing can be created separately to
match your system and operation requirements.
2. In order to use this FB, it is necessary to use P+Cognex-In-Sight_LogOn and log onto
In-Sight beforehand.
3. Do not implement multiple FBs simultaneously for the same camera; if necessary, execute
multiple FBs sequentially.

Related manuals

MELSEC-L CPU Unit Users Manual (Built-in Ethernet Function Edition)


QnUCPU Users Manual (Built-in Ethernet Port Communication Edition)
Q-compatible Ethernet Interface Unit Users Manual (Basic Edition)
In-Sight EasyBuilder Help

Error Codes

Error Code List


Error Code

Description

Action

An unrecognizable command was sent.

Refer to the In-Sight manual.

The specified value is outside the range or

Refer to the In-Sight manual.

-1
-2
-4
-5

-6

is not a valid integer.


The command could not be executed.

Refer to the In-Sight manual.

In-Sights sensor does not have

Refer to the In-Sight manual.

sufficient memory.
The system is not online.

Refer to the In-Sight manual.

The user doesnt have the necessary

Refer to the In-Sight manual.

access privileges to execute the


command.
A communication error occurred.

Perform the operation again after checking whether

-105

power has been disconnected to In-Sight or the


communications cable has been disconnected, etc.
A communication error occurred.

Perform the operation again after checking the


following.
1. Are multiple FBs running simultaneously?

-106

2. Is the connection No. for the FB input label outside


the acceptable range, or has an end logon to In-Sight
command been executed (excluding LogOn)?

-304

The length of the native command to be

Set the native command to be sent to between 1 and

sent is not between 1 and 199 characters.

199 characters.

Labels

Input Labels
Name

Variable name

Data

Valid range

Description

type
Execution command

FB_EN

Bit

---

ON: Run the FB.


OFF: Do not run the FB.

Unit installation XY address

i_Start_IO_No

Word

Depends upon the


range of I/O points
in the
corresponding
CPU unit.
For the specific
range, refer to the
Users Manual for
the corresponding
CPU.

Use a hexadecimal number to


specify the first XY address set in
the corresponding Ethernet unit.
(For example, enter H10 in the
case of X10.)
Enter H0FFFF if a CPU with
built-in Ethernet port is selected.

Connection No.

i_Connection_No

Word

1 to 16 (decimal
number)

Specifies the connection No.


logged onto using
P+Cognex-In-Sight_LogOn.

Timeout value

i_TimeOut

Word

1 to 32767
(decimal number)

Enter the length of the timeout (in


seconds) when communication
with In-Sight is broken.
If no entry is made, or a negative
number or 0 is entered, the
value will be automatically set to
30 (seconds).

Native command1

i_Native_Command

Text
string

[0 to 9] [a to z]
[A to Z]

Enter an arbitrary native


command to be sent (between 1
and 199 characters).

1: Use ASCII or Shift-JIS characters for the Native command input variable.
Output labels
Name

Variable name

Data type

Default

Execution status

FB_ENO

Bit

OFF

Description
ON: The FB is running.
OFF: The FB is not running.

Execution result

o_Result

Text

string

The result of the sent arbitrary


native command is saved as
255 characters or less.

End flag

FB_OK

Bit

OFF

ON: The FB ended normally.


OFF: The FB did not end.

Abnormal end flag

FB_ERROR

Bit

OFF

ON: Abnormal FB end.


OFF: The FB did not end.

Error Code

ERROR_ID

Word

Returns the error code.

FB Version Update History

Version

Date

Description

1.00A

2009/02/20

Newly created

1.01B

2009/06/01

XY address range check processing change


Connection No. range check processing change

Important
This chapter describes the function of the function block.
It does not describe the constraints of using the unit or sequencer CPU nor the constraints generated by their combination,
etc.
Be sure to read the corresponding Users Manual before using each product.

Appendix

Using Passwords to Prevent Reading/Writing in Ladder Programs

Reading and writing in the ladder program can be prohibited by setting a password for the program.
The password can be used as a reading prevention measure for confidential data (user names, passwords, etc.) written in
the ladder program.

(1) Press Online, select Password/Keyword and then New.

(2) Select the program to set the password, and press Setting.

(3) Set Read/Write Protection in Registration Condition and, after the password is set, click the OK button.

(4) Confirm that the Registration shows Registered, and click the OK button.

(5) Whether or not the password is set can be confirmed by the Disable password prompt displayed during the Read
from PLC operation after the completion of password registration.

Finding Out which Symbolic Tags can be Used with an FB

Communication for the application step in In-Sight EasyBuilder.


MC Protocol of communication.
The name of the symbolic tag can be checked by selecting the format input (output) data tab and clicking the Add button.

Type Conversion Processing Combination Table for P+Cognex-In-Sight_GetData

P+Cognex-In-Sight_GetData converts and outputs the value received from In-Sight in accordance with the specified
received value data type (i_Result_Type).
Whether or not settings are possible for the received value data type and the value received from In-Sight is shown below
along with the operation for the set values.
Type of Tag
Data Type of
Received Value
Data Type of the Received Value
Not Entered
Text String (Enter KO)
16 bit integer [0 or 1](Enter K1)
16 bit integer (Enter K2)
32 bit integer (Enter K3)
Single-precision Real Number
[32 bit](Enter K4)
: Setting Possible
X: Setting not possible

Numerical Value
Range
"0" or "1"

Text String

Operation 1

Error 1*1.

Error 1*1.

Error 1*1.

Numerical Value
Numerical Value Range
Numerical Value Range
-3276832767
2.147e+0092.147e+009

Numerical Value
Range
Other Ranges

Operation 2

Operation 2

Operation 2

Operation 2

Operation 1

Operation 1

Error 1*1.

Operation 1

Error 1*1.

Error 1*1.

Operation 3

Operation 4

Operation 5

Operation 4

Operation 5

Operation 5

Error 1: CPU operation error occurred due to a value conversion failure


Operation 1: When the received value is "0", 0 is output When it is not "0", 1 is output
Operation 2: The numerical value is output as a text string
Operation 3: A 16 bit integer is output (Rounded off to one digit after the decimal point)
Operation 4: A 32 bit integer is output (Rounded off to one digit after the decimal point)
Operation 5: A single-precision real number (32 bits) is output

* For details of the conversion processing operation, refer to QCPU Programming Manual: Common Commands Edition.

Type Conversion Processing Combination Table of P+Cognex-In-Sight_SetData

P+Cognex-In-Sight_SetData converts the set value (i_tag_Value) to text string based on set value data type
(i_tag_Data_Type) and sends the set value to In-Sight.
Whether or not settings corresponding to the set value data type and the set value are possible and operation for the set
values are shown below.
Setting Value
Data Type of
Received Value
Data Type of the Received Value
Not Entered
Text String (Enter KO)

Text String
Direct
Input

Indirect
Input

16 bit integer [0 or 1](Enter K1)

16 bit integer (Enter K2)

32 bit integer (Enter K3)

Single-precision Real Number


[32 bit](Enter K4)

: Setting Possible
X: Setting Not Possible
-: Item where direct value input
in FB is not possible

16 bit integer (1 word)


0 or 1
-3276832767
Direct
Indirect
Direct
Indirect
Input
Input
Input
Input

Error 3*1. Error 3*1. Error 2/3/6

Error 2/3/6

Operation

Operation 1 Operation 1
1

Error 3*1.

Error 2/3 Error 2/3 Error 2/3 Error 2/3


Error 2/3

Error
Error
Error
Error 1/3*1. Error 1/3*1.
1/3*1.
1/3*1.
1/3*1.

32 bit integer (2 words)

Single-precision Real
Number
Direct
Indirect
Input
Input

Direct
Input

Indirect
Input

Error 2/3/6

Error 2/3/6

Error 7*1.

Error 7*1.

Error 4*1.

Error 1*1.

Error 4*1.

Error 5*1.

Error 1: CPU operation error occurred due to a value conversion failure


Error 2: CPU operation error occurred due to a text string operation command
Error 3: Irregular value sent
Error 4: As a result of value conversion, an unexpected value was sent (Only the lower byte was sent)
Error 5: As a result of value conversion, an unexpected value was sent (A single-precision real number was sent as a
32 bit integer value)
Error 6: An error code was generated by a NULL non-detection when the set value data length was checked
Error 7: The sent value changed to 0 or 1 (0 when the lower byte is 0, 1 when the lower byte is not 0)
Operation 1: The sent value changed to 0 or 1 (0 when the sent value is 0, 1 when the sent value is not 0)

* For details of the conversion processing operation, refer to QCPU Programming Manual: Common Commands Edition.

Usable Native Commands That Can Be Sent With P+Cognex-In-Sight_SendCmd

Native commands that can be sent by this program are shown below.
No.
1
2
3
4
5
6
7

Native Command Name


LF
TF
RF
WF
DF
GF
SJ

8
9
10
11
12
13

TJ
RJ
WJ
DJ
GJ
RB

14

RI

15
16
17
18
19

WB
WI
GV
SI
SF

20
21
22
23
24
25
26
27
28
29
30

SS
GI
RS
WS
TS
SL
GL
SO
GO
SE
SW

31
32
33
34

RT
SM
Get Connections
Get Expr

35
36
37
38

Get Filelist
Put Live
Put Portnum
Put Timeout

39
40
41

Put Update
Put Watch
Put XML

Description
Loads the specified job from In-Sights flash memory and makes it the active job.
Saves the current job into In-Sights flash memory.
Reads the job from the specified In-Sight flash memory.
Sends the job to In-Sights flash memory.
Deletes the specified job or cell data (.CXD) file from In-Sights flash memory.
Returns the file name of the job currently active in In-Sight.
Loads the job from one of the job slots within In-Sights flash memory and makes it
the active job.
Saves the current job in the job slot specified within In-Sights flash memory.
Reads the job from the specified In-Sight job slot.
Sends the job to the In-Sight job slot specified within In-Sights flash memory.
Deletes the job from the slot specified within In-Sights flash memory.
Returns the ID of the job currently active in In-Sight.
Sends the current image from In-Sight to a remote device in ASCII hexadecimal
format (80 characters/line).
Sends the current image from In-Sight to a remote device in ASCII hexadecimal
format (80 characters/line).
Sends image data from a remote device to In-Sight.
Sends image data from a remote device to In-Sight.
Returns the value included in the specified cell.
Sets the control included in the cell to the specified integer value.
Sets the edit box control included in the cell to the specified floating point number
value.
Sets the edit box control included in the cell to the specified text string.
Returns In-Sight sensor information.
Reads In-Sight system setting data.
Sends system setting data from a remote device to In-Sight.
Saves In-Sights settings to the proc.set file.
Prevents unauthorized changes to In-Sights IP address.
Returns the security status of In-Sights IP address.
Sets In-Sight to the online or offline mode.
Returns In-Sight online.
Triggers the specified event.
Triggers the specified event and returns the response after completion of the
command.
Resets In-Sight. This command is the same as physically turning on the power again.
Sends the text string to In-Sights spreadsheet via the native mode connection.
Returns the current connection information for In-Sight.
Returns the parameter or value included in the cell specified by the row and line
address, as well as the state of that cell.
Returns the number of files and each file name stored in In-Sights memory.
Turns the live load mode ON or OFF.
Specifies the port In-Sight uses for data or image forwarding via the network.
Specifies the amount of time (milliseconds) to maintain the port connection from the
client when sending or receiving is not being carried out.
Refreshes the GUI (spreadsheet, image display, and cell graphics).
Returns the value included in the specified cell when the cell is refreshed.
Specifies whether or not to format the output result of the native mode command with
XML.

The native commands that can be sent by this program following the native command Put XML are shown below.
No.
1
2
3
4
5
6
7
8
9
10
11
12
13

Native Command Name


EV GetCustomize
EV
GetDeEnergizeOutputs
EV GetDiscreteInput
EV GetDiscreteOutput
EV GetEIPSingleAttribute
EV GetFTPSettings
EV GetHostTable
EV MSBuffer

14
15
16

EV GetNetwork
EV GetSerialPort
EV GetStartup
EV GetUserList
EV
SetDeEnergizeOutputs
EV EditRegion
EV SetEIPSingleAttribute
EV SetFavorHostTable

17
18

EV SetFTPSettings
EV SetSerialPort

Description
Reads the settings of the Customize dialog box from the GUI of In-Sight 3000/3400.
Returns the Turn off the output power when offline setting specified by the Discrete
output setting dialog box.
Returns the information set in the Discrete input setting dialog box.
Returns the information set in the Discrete output setting dialog box.
Returns the class and the instance attributes of In-Sight EtherNet/IP.
Returns the information set in the FTP settings dialog box.
Returns the information included in the In-Sight host table dialog box.
Returns the machine status data stored in one of the buffers (begins with 0) attached
to the 8 indices within the machine status stack.
Returns the information set in the Network settings dialog box.
Returns the information set in the Serial port settings dialog box.
Returns the information set in the Startup dialog box.
Returns the information set in the User list dialog box.
Changes the Turn off output power when offline setting of the Discrete output
setting dialog box.
Changes the cell settings that include the EditRegion function.
Sets the class and the instance attributes of In-SightEtherNet/IP.
Activates or deactivates the Give higher priority to the host table than DNS option of
the In-Sight host table.
Changes the FTP settings dialog box settings.
Changes the Serial port settings dialog box settings.

Example of Using the FB Library

Example of Operating In-Sight With Sequencer

The following is an example of operating In-Sight using a CPU with built-in Ethernet.
Select and use jobs stored in In-Sight.

(1) System configuration

(2) Device list

External input (command)


Device

FB Name

Application (when turned ON)

M100

P+Cognex-In-Sight_LogOn

Establish connection with In-Sight request

M110

P+Cognex-In-Sight_LoadJob

Operation job change request

M120

P+Cognex-In-Sight_TriggerAcq

Assess image request

M130

P+Cognex-In-Sight_GetData

Symbolic tag value acquisition request

M140

P+Cognex-In-Sight_SetData

Symbolic tag value change request

M150

P+Cognex-In-Sight_GetStatus

Acquire In-Sight online/offline status request

M160

P+Cognex-In-Sight_Online

In-Sight online request

M170

P+Cognex-In-Sight_Offline

In-Sight offline request

M180

P+Cognex-In-Sight_SaveJob

Save job request

M190

P+Cognex-In-Sight_SendCmd

Send native command request

External output (confirmation)


Device

FB Name

Application (when turned ON)

D10

P+Cognex-In-Sight_LogOn

Outputs the error code generated during connection with In-Sight.

D11

P+Cognex-In-Sight_LoadJob

Outputs the error code generated when the job file is changed.

D12

P+Cognex-In-Sight_TriggerAcq

Outputs the error code generated during image assessment and


assessment result acquisition.

D13

P+Cognex-In-Sight_GetData

Outputs the error code generated during symbolic tag value acquisition.

D14

P+Cognex-In-Sight_SetData

Outputs the error code generated when the symbolic tag value is
changed.

D15

P+Cognex-In-Sight_GetStatus

Outputs the error code generated during online/offline status acquisition.

D16

P+Cognex-In-Sight_Online

Outputs the error code generated when In-Sight goes online.

D17

P+Cognex-In-Sight_Offline

Outputs the error code generated when In-Sight goes offline.

D18

P+Cognex-In-Sight_SaveJob

Outputs the error code generated when the job file is saved in
In-Sights flash memory.

D19

P+Cognex-In-Sight_SendCmd

Outputs the error code generated during native command sending and
receiving.

D100

P+Cognex-In-Sight_TriggerAcq

Outputs the image assessment result.

D200

P+Cognex-In-Sight_GetData

Outputs the symbolic tag value.

D400

P+Cognex-In-Sight_SetData

Outputs the value change result for symbolic tags.

D500

P+Cognex-In-Sight_GetStatus

Outputs the current status for In-Sight (online/offline).

D600

P+Cognex-In-Sight_SendCmd

Outputs the native command send result.

Data register
Device

FB Name

Application

D300

P+Cognex-In-Sight_SetData

Specifies the type of value to set in the symbolic tag.

D301

P+Cognex-In-Sight_SetData

Specifies the type of set value set in D300.

(3) Input job file name

External input (command)


FB Name

Job Name

Job Description

Description written in D5500 or later with the MC


protocol

P+Cognex-In-Sight_LoadJob

xy-ja.job

Positioning

Trigger frequency, image assessment result,

inspection

positioning assessment result

P+Cognex-In-Sight_LoadJob

inspect-ja.job

Inspection

Trigger frequency, image assessment result

P+Cognex-In-Sight_LoadJob

IDCode-ja.job

QR code reading

Trigger frequency, image assessment result, QR


code details

(4) Example of Use Settings

Common settings
Input output items

Value

Description

Unit installation XY address

HFFFF

Conducts communication using the CPU w/ built-in


Ethernet port.

Connection No.

K1

Specifies the connection No. for communication with


In-Sight.
For details, refer to 1.4.3.

Timeout limit setting

K0

Enter the length of the timeout (in seconds) when


communication with In-Sight is broken. (30
seconds in this example.)

Logon user
FB Name

User Name

Password

P+Cognex-In-Sight_LogOn

operator

FB Name

Job Name

Job Description

P+Cognex-In-Sight_LoadJob

xy-ja.job

Determines positioning.

P+Cognex-In-Sight_SaveJob

xy-ja.job

Determines positioning.

FB Name

Tag Name

Description

P+Cognex-In-Sight_GetData

Pattern_1. Accept threshold

Threshold for a pass/no pass determination

P+Cognex-In-Sight_SetData

Pattern_1. Accept threshold

Threshold for a pass/no pass determination

(NULL password)

Input job file name

Input symbolic tag name

(5) FB Library Example

(a) P+Cognex-In-Sight_LogOn (Establish Connection with Vision System)


Logs on to In-Sight using the user name operator and password NULL password.

(b) P+Cognex-In-Sight_LoadJob (Selects, changes, and activates jobs)


Changes the job to xy-ja.job.

7XUQV21ZKHQWKHMRE
LVFKDQJHG

,QSXWVWKHMREILOHQDPH
WREHFKDQJHG

(c) P+Cognex-In-Sight_TriggerAcq (Acquisition of Image Assessment Result)


Assesses the image and receives the result.

7XUQV2QZKHQWKH
LPDJHLVGHWHUPLQHG

6DYHVWKHLPDJH
GHWHUPLQDWLRQUHVXOWVWR
WKHILOHUHJLVWHU

$IWHUWKHLPDJHLV
GHWHUPLQHGWKH
SRVLWLRQLQJH[DPLQDWLRQ
UHVXOWLVVWRUHGLQWKHILOH
UHJLVWHU 

5HVHWV WR  ZKHQ WKH


XSSHU OLPLW RI WKH ILOH
UHJLVWHULVH[FHHGHG

(d) P+Cognex-In-Sight_GetData (Acquisition of the Symbolic Tag Value)


Acquires the value of symbolic tag Pattern_1. Accept threshold value.

7XUQV 21 ZKHQ WKH


V\PEROLF WDJ YDOXH LV
DFTXLUHG

$FTXLUHVWKHYDOXHDQG
LQSXWVWKHWDJQDPH

(e) P+Cognex-In-Sight_SetData (Symbolic Tag Value Change)


Changes the value of symbolic tag Pattern_1. Access threshold value.

7XUQV21ZKHQWKH
V\PEROLFWDJYDOXHLV
FKDQJHG

,QSXWVWKHWDJQDPHIRU
ZKLFKWKHYDOXHZLOOEH
FKDQJHG

(f) P+Cognex-In-Sight_GetStatus (Online/Offline Status Acquisition)


Acquires the status of In-Sight.

Turns ON when the


current status of the
In-Sight
(online/offline) is
acquired.

(g) P+Cognex-In-Sight_SetOnline (Take Vision System Online)


Takes In-Sight online.

Turns On when the


current status
In-Sight goes online.

(h) P+Cognex-In-Sight_SetOffline (Take Vision System Offline)


Takes In-Sight offline.

7XUQV 21 ZKHQ WKH


FXUUHQW
VWDWXV
RI
,Q6LJKWpJRHVRIIOLQH

(i) P+Cognex-In-Sight_SaveJob (Save the Active Job in Flash Memory)


Saves the current job as file name xy-ja.job.

7XUQV21ZKHQVDYLQJ
WKH MRE WR ,Q6LJKWp
V
IODVKPHPRU\

(QWHUV WKH MRE ILOH


QDPHIRUVDYLQJ

(j) P+Cognex-In-Sight_SendCmd (Native Command Send/Receive)


Sends the native command GI, and acquires the sensor information.

7XUQV21ZKHQVDYLQJ
WKH MRE WR ,Q6LJKWp
V
IODVKPHPRU\

(QWHUV WKH QDWLYH


FRPPDQGIRUVHQGLQJ

(k) Processing example when an image is assessed in the sensors hardware trigger input port

Cautions
When image assessment is conducted in the sensors hardware trigger input port, the settings for the job description must
be changed.
P+Cognex-In-Sight_TriggerAcq cannot be used in conjunction with the hardware trigger input port to conduct image
assessment.

Remove the b contact point SM400 when actually in use.

6DYHVWKHLPDJH
GHWHUPLQDWLRQUHVXOWVWRWKH
ILOHUHJLVWHU

5HVHWVWRZKHQWKH
XSSHUOLPLWRIWKHILOH
UHJLVWHULVH[FHHGHG

The method for setting the file register is described on the next page.

(1) File Register settings

To set the file register, open the PLC File tab in PLC Parameter, and set the File Register items.
In the above example, the file register is created within the sequencer CPU.

Following setting, click the End button.

Você também pode gostar