Вы находитесь на странице: 1из 75

FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

<<Index>>

1
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

Reference Manual Revision History


Version

Revised

Revision Contents

Date
v1.00A

2009/02/20

Newly created

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 for 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/11/10

1. Addition of version update history for each FB due to internal FB correction


2. Compatibility of high performance model added to 1.3 System Configuration Example
3. FB Library Details - Description of Function: Corrected as follows.
All FBs: Target devices: Target CPU described in each model.
All FBs: Target devices: Compatibility of high performance models added.
All FBs: Description of the input conditions for FB_EN deleted.
All FBs: FB operation: Pulse execution type (multiple scans) added.

1
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

Outline

FB Library Outline
This FB library is for systems that use the QJ71E71-100 module to connect to Cognex Corporation In-Sight Vision
Systems.

No.

FB Library Function Contents


Item

Description

P+Cognex-In-Sight-E71_LogOn

Establishes the connection between the QJ71E71-100 module and the


In-Sight Vision System.

P+Cognex-In-Sight-E71_LoadJob

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

P+Cognex-In-Sight-E71_TriggerAcq

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

P+Cognex-In-Sight-E71_GetData

Acquires the data held by In-Sight.

P+Cognex-In-Sight-E71_SetData

Changes the data held by In-Sight.

P+Cognex-In-Sight-E71_GetStatus

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

P+Cognex-In-Sight-E71_SetOnline

Puts the In-Sight Vision System online.

P+Cognex-In-Sight-E71_SetOffline

Takes the In-Sight Vision System offline.

P+Cognex-In-Sight-E71_SaveJob

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

10

P+Cognex-In-Sight-E71_SendCmd

Sends the selected native command and receives the results.

2
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

System Configuration Example

No.

Device Name

Explanation

Q series sequencer

Use base, power supply unit and high performance QnH CPU unit1 or
universal QnU CPU model.

GX Works2

Use Version 1.09K or later

QJ71E71-100

Q series sequencer Ethernet unit

Cognex In-Sight series

In-Sight Vision System


Connecting multiple devices with In-Sight is possible using an
ethernet hub.2

PoE (Power over Ethernet) unit

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.

Ethernet hub 100BASE-TX


compatible products

An ethernet hub is not essential. Operation is possible even with


system configurations connected directly to ethernet units with the
Cognex In-Sight series.

Windows personal computer

Used when connecting to the In-Sight series using EasyBuilder.

Cognex EasyBuilder Version 4.3

Used when connecting with In-Sight and for programming settings.

1: Regarding Serial Nos. of high performance models


This FB is compatible with high performance models with Serial Nos. with the first 5 digits of 04012 or later.
2: Regarding the number of devices connected to an In-Sight Vision System
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)

3
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

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.2 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.

4
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

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

5
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

Open Settings for the QJ71E71-100 Ethernet Unit

(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
(b) Open System
(c) Fixed buffer communication procedure
(d) Pairing Open
(e) Existence Confirmation
(f) Host Station Port No.
(hexadecimal number)
(g) Destination IP address
(h) Destination Port number
(hexadecimal number)

Set to TCP.
Set to Active.
Set to No Procedure.
Set to Enable.
Set to Confirm.
Enter the hexadecimal number that matches the In-Sight setting.
(Refer to 1.5) Enter 0BB8.
Enter the decimal number that matches the In-Sight setting.
(Refer to 1.5) Enter 192.168.0.1.
Enter the hexadecimal number that matches the In-Sight setting.
(Refer to 1.5) Enter 0BB8.

(2) MC protocol settings


(a) Protocol
(b) Open System
(c) TCP connection method
(d) Host Station Port No.
(hexadecimal number)
(e) Destination IP address
(f) Destination Port number

Set to TCP.
Set to MC Protocol.
No setting is required.
Enter the hexadecimal number that matches the In-Sight setting.
(Refer to 1.5) The default setting is 3000.
No setting is required.
No setting is required.

Use GX Works2 to program the 3 Connection Open settings.

6
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

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.

Make the following settings in In-Sight EasyBuilder.


(1) IP Address

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


settings of the 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 number (decimal number)

Set to 3000 in In-Sight EasyBuilder.

7
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

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 click 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

8
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

Related manuals
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.

9
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

FB Library Details

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


Name
P+Cognex-In-Sight-E71_LogOn
Description of Function

Item
Summary of Function

Description
Establishes the connection between the QJ71E71-100 module and the In-Sight Vision
System.

Symbol

Compatible Devices

Compatible units

QJ71E71-100

Compatible Vision
System

Cognex In-Sight

Compatible CPU
Series
MELSEC-Q Series1

Model
High performance QCPU model2
Universal QCPU model

1: QCPU-A (A mode) cannot be used.


2: Serial Nos. with the first 5 digits of 04012 or later.
GX Works2
Language

Ladder

No. of Steps (Max.)

Universal models: 963

Version 1.09K or later

* 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.

FB Compile Method

Macro type

FB Operation

Pulse execution type (multiple scans)


10
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

Item
I/O Signal Movement

Description
[With abnormal end]

[With normal 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

Q-compatible Ethernet Interface Unit Users Manual (Basic Edition)


In-Sight EasyBuilder Help

11
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

Error Code

Error Code List


Error Code

Description
Connection Open failed.

Action
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.


-105

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?

-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

The user name must be 15 characters or less.

15 characters.
The length of the password exceeds

The password must be 15 characters or less.

15 characters.

12
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

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.)

Connection No.

i_Connection_No

Word

1 to 15 (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 Name1,2

i_UserName

Text

[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.

[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

string

Password1,2

i_Password

Text
string

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.

13
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

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 QJ71E71-100 module must be set.
Set the corresponding connection destination of In-Sight from the network parameter Ethernet/CC IE/MELSECNET for
GX Works2. Be sure to read the GX Works2 Operating Manual (General Edition) 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

1.02C

2009/11/10

Special command argument specification 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.

14
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

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

Name
P+Cognex-In-Sight-E71_LoadJob

Description of Function

Item
Summary of Function

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

Symbol

Compatible Devices

Compatible units

QJ71E71-100

Compatible Vision
System

Cognex In-Sight

Compatible CPU
Series

Model
1

MELSEC-Q Series

High performance QCPU model2


Universal QCPU model

1: QCPU-A (A mode) cannot be used.


2: Serial Nos. with the first 5 digits of 04012 or later.
GX Works2
Language

Ladder

No. of Steps (Max.)

Universal models: 938

Version 1.09K or later

* 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, selects, changes and activates jobs stored in the
In-Sight Vision System.

FB Compile Method

Macro type

FB Operation

Pulse execution type (multiple scans)

15
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

Item
I/O Signal Movement

Description
[With abnormal end]

[With normal 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-E71_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

Q-compatible Ethernet Interface Unit Users Manual (Basic Edition)


In-Sight EasyBuilder Help

16
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

Error Code

Error Code List


Error Code
-1
-2
-4
-5

-6

Description
The specified value is outside the range or

Action
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.

-105

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?

-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.

17
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

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.)

Connection No.

i_Connection_No

Word

1 to 15 (decimal
number)

Specifies the connection No.


logged onto using
P+Cognex-In-Sight-E71_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).

Selected job file name1

i_JobFileName

Text

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

Specifies the job file name


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

string

1: Use ASCII or Shift-JIS characters for the Selected 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 for the


abnormal result.

18
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

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

1.02C

2009/11/10

Special command argument specification 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.

19
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

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

Name
P+Cognex-In-Sight-E71_TriggerAcq

Description of Function

Item
Summary of Function

Description
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

QJ71E71-100

Compatible Vision
System

Cognex In-Sight

Compatible CPU
Series
MELSEC-Q Series1

Model
High performance QCPU model2
Universal QCPU model

1: QCPU-A (A mode) cannot be used.


2: Serial Nos. with the first 5 digits of 04012 or later.
GX Works2
Language

Ladder

No. of Steps (Max.)

Universal models: 1358

Version 1.09K or later

* 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)

20
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

Item

Description

I/O Signal Movement

[With abnormal end]

[With normal 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-E71_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

Q-compatible Ethernet Interface Unit Users Manual (Basic Edition)


In-Sight EasyBuilder Help

Error Code

Error Code List


Error Code
-2

-6

Description

Action

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


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.

-105

-106

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)?
21
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

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.)

Connection No.

i_Connection_No

Word

1 to 15 (decimal
number)

Specifies the connection No.


logged onto using
P+Cognex-In-Sight-E71_Log
On.

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

Output labels

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.

22
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

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

1.02C

2009/11/10

Special command argument specification 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.

23
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

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

FB Definition Name
P+Cognex-In-Sight-E71_GetData

Description of Function

Item
Summary of Function

Description
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

QJ71E71-100

Compatible Vision
System

Cognex In-Sight

Compatible CPU
Series
MELSEC-Q Series1

Model
High performance QCPU model2
Universal QCPU model

1: QCPU-A (A mode) cannot be used.


2: Serial Nos. with the first 5 digits of 04012 or later.
GX Works2
Language

Ladder

No. of Steps (Max.)

Universal models: 1358

Version 1.09K or later

* 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).

24
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

Item

Description

Explanation of
Function

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

FB Compile Method

Macro type

FB Operation

Pulse execution type (multiple scans)

I/O Signal Movement

[With normal end]

Vision System, and acquires the value.

[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-E71_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 error may occur when the type is converted.
For details, refer to 3.3 Type Conversion Processing Combination Table for
P+Cognex-In-Sight-E71_GetData.

Related manuals

Q-compatible Ethernet Interface Unit Users Manual (Basic Edition)


In-Sight EasyBuilder Help

25
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

Error Code

Error Code List


Error Code
-1
-2

-6

Description
The specified value is outside the range or

Action
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.


-105

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?

-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.

26
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

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

range of I/O points in

to specify the first XY

the corresponding
CPU unit.
For the specific

address set in the


corresponding Ethernet
unit. (For example, enter
H10 in the case of X10.)

range, refer to the


Users Manual for the
corresponding CPU.
Connection No.

i_Connection_No

Word

1 to 15 (decimal

Specifies the connection

number)

No. logged onto using


P+Cognex-In-Sight-E71_Lo
gOn.

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

[0 to 9]

string

[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

number)

the 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 received value data type and the type conversion operation for the received data, refer to 3.3 Type Conversion
Processing Combination Table of P+Cognex-In-Sight-E71_GetData.

27
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

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 symbolic

16 bit integer

tag will be saved.

32 bit integer

For a text string, a maximum of

Single-

255 characters is saved.

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

1.02C

2009/11/10

Special command argument specification 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.

28
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

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

Name
P+Cognex-In-Sight-E71_SetData

Description of Function

Item
Summary of Function

Description
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

QJ71E71-100

Compatible Vision
System

Cognex In-Sight

Compatible CPU
Series

Model
1

MELSEC-Q Series

High performance QCPU model2


Universal QCPU model

1: QCPU-A (A mode) cannot be used.


2: Serial Nos. with the first 5 digits of 04012 or later.
GX Works2
Language

Version 1.09K or later

Ladder

29
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

Item
No. of Steps (Max.)

Description
Universal models: 1876
* 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, sends a random symbolic tag to the In-Sight Vision

FB Compile Method

Macro type

FB Operation

Pulse execution type (multiple scans)

I/O Signal Movement

[With normal end]

System, and sets the value.

[With abnormal end]

[Execution
Command]

[Execution
Command]

[Execution
Status]

[Execution
Status]

[Normal
Completion]

[Normal
Completion]

[Abnormal
Completion]

[Abnormal
Completion]

[Error Code]

[Error Code]

Constraints
(Cautions)

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-E71_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, a 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, a 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-E71_SetData.

Related manuals

Q-compatible Ethernet Interface Unit Users Manual (Basic Edition)


In-Sight EasyBuilder Help

30
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

Error Code

Error Code List


Error Code
-1

Description
The specified value is outside the range or

Action
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.


-105

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?

-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.

31
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

Labels

Input Labels
Name

Variable name

Data type

Valid range

Description

Execution command

FB_EN

Bit

---

Unit installation XY

i_Start_IO_No

Word

Connection No.

i_Connection_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.
1 to 15 (decimal number)

ON: Run the FB.


OFF: Do not run the FB.
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.)

Timeout value

i_TimeOut

Word

1 to 32767 (decimal
number)

Symbolic tag1

i_tag

Text string

[0 to 9]

Set value1,2

i_tag_Value

Text string

---

address

[a to z] [A to Z]

16 bit integer
32 bit integer
Single-preci
sion real

Specifies the connection


No. logged onto using
P+Cognex-In-Sight-E71_
LogOn.
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).
Sets the transmitted
symbolic tag to between 1
to 32 characters.
Sets the value specified in
the data type of the set
value.
When saving a text string,
enter between 1 and 32
characters.

number
Data type of the set value2

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: For the set value data type and the type conversion operation for the set data, refer to 3.4. Type Conversion Processing
Combination Table of P+Cognex-In-Sight-E71_SetData.
i_tag_Data_Type

Word

0 to 4 (decimal number)

32
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

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

1.02C

2009/11/10

Special command argument specification 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.

33
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

P+Cognex-In-Sight-E71_GetStatus (Online/Offline Acquisition)

Name
P+Cognex-In-Sight-E71_GetStatus

Description of Function

Item
Summary of Function

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

Symbol

Compatible Devices

Compatible units

QJ71E71-100

Compatible Vision
System

Cognex In-Sight

Compatible CPU
Series
MELSEC-Q Series1

Model
High performance QCPU model2
Universal QCPU model

1: QCPU-A (A mode) cannot be used.


2: Serial Nos. with the first 5 digits of 04012 or later.
GX Works2
Language

Ladder

No. of Steps (Max.)

Universal models: 547

Version 1.09K or later

* 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, acquires the current status of the In-Sight Vision

FB Compile Method

Macro type

FB Operation

Pulse execution type (multiple scans)

System (online/offline).

34
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

Item

Description

I/O Signal Movement

[With abnormal end]

[With normal 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-E71_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

Q-compatible Ethernet Interface Unit Users Manual (Basic Edition)


In-Sight EasyBuilder Help

Error Code

Error Code List


Error Code
-2

-6

Description

Action

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.
A communication error occurred.

-105

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.

-106

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)?
35
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

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.)

Connection No.

i_Connection_No

Word

1 to 15 (decimal
number)

Specifies the connection No.


logged onto using
P+Cognex-In-Sight-E71_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

36
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

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

1.02C

2009/11/10

Special command argument specification 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.

37
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

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

Name
P+Cognex-In-Sight-E71_SetOnline

Description of Function

Item
Summary of Function

Description
Puts the In-Sight Vision System online.

Symbol

Compatible Devices

Compatible units

QJ71E71-100

Compatible Vision
System

Cognex In-Sight

Compatible CPU
Series

Model
1

MELSEC-Q Series

High performance QCPU model2


Universal QCPU model

1: QCPU-A (A mode) cannot be used.


2: Serial Nos. with the first 5 digits of 04012 or later.
GX Works2
Language

Ladder

No. of Steps (Max.)

Universal models: 544

Version 1.09K or later

* 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, puts the In-Sight Vision System online.

FB Compile Method

Macro type

FB Operation

Pulse execution type (multiple scans)

38
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

Item

Description

I/O Signal Movement

[With abnormal end]

[With normal 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-E71_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

Q-compatible Ethernet Interface Unit Users Manual (Basic Edition)


In-Sight EasyBuilder Help

Error Code

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


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

Refer to the In-Sight manual.

-6

-105
A communication error occurred.
-106

Perform the operation again after checking whether


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)?

39
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

Labels

Input Labels
Name

Variable name

Data

Valid range

Description

ON: Run the FB.

type
Execution command

FB_EN

Bit

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 in

specify the first XY address

the corresponding CPU

set in the corresponding

unit.

Ethernet unit. (For example,

For the specific range,

enter H10 in the case of

refer to the Users

X10.)

Manual for the


corresponding CPU.
Connection No.

i_Connection_No

Word

1 to 15 (decimal

Specifies the connection No.

number)

logged onto using


P+Cognex-In-Sight-E71_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).

Output labels
Name

Variable name

Data

Default

Description

OFF

ON: The FB is running.

type
Execution status

FB_ENO

Bit

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.

40
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

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

1.02C

2009/11/10

Special command argument specification 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.

41
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

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

Name
P+Cognex-In-Sight-E71_SetOffline

Description of Function

Item
Summary of Function

Description
Takes the In-Sight Vision System offline.

Symbol

Compatible Devices

Compatible units

QJ71E71-100

Compatible Vision
System

Cognex In-Sight

Compatible CPU
Series

Model
1

MELSEC-Q Series

High performance QCPU model2


Universal QCPU model

1: QCPU-A (A mode) cannot be used.


2: Serial Nos. with the first 5 digits of 04012 or later.
GX Works2
Language

Ladder

No. of Steps (Max.)

Universal models: 535

Version 1.09K or later

* 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, takes the In-Sight Vision System offline.

FB Compile Method

Macro type

FB Operation

Pulse execution type (multiple scans)

42
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

Item

Description

I/O Signal Movement

[With abnormal end]

[With normal 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-E71_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

Q-compatible Ethernet Interface Unit Users Manual (Basic Edition)


In-Sight EasyBuilder Help

Error Code

Error Code List


Error Code
-2

-6

Description

Action

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.
A communication error occurred.

-105

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.

-106

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)?
43
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

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


Users Manual for
the corresponding
CPU.
Connection No.

i_Connection_No

Word

1 to 15 (decimal

Specifies the connection No.

number)

logged onto using


P+Cognex-In-Sight-E71_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.

44
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

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

1.02C

2009/11/10

Special command argument specification 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.

45
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

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

Name
P+Cognex-In-Sight-E71_SaveJob

Description of Function

Item
Summary of Function

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

Symbol

Compatible Devices

Compatible units

QJ71E71-100

Compatible Vision
System

Cognex In-Sight

Compatible CPU
Series

Model
1

MELSEC-Q Series

High performance QCPU model2


Universal QCPU model

1: QCPU-A (A mode) cannot be used.


2: Serial Nos. with the first 5 digits of 04012 or later.
GX Works2
Language

Ladder

No. of Steps (Max.)

Universal models: 936

Version 1.09K or later

* 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, saves the current job to the In-Sight Vision Systems

FB Compile Method

Macro type

FB Operation

Pulse execution type (multiple scans)

flash memory.

46
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

Item
I/O Signal Movement

Description
[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-E71_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

Q-compatible Ethernet Interface Unit Users Manual (Basic Edition)


In-Sight EasyBuilder Help

47
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

Error Code

Error Code List


Error Code

Description
The command could not be executed

-2

Action
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.

-105

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?

-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.

48
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

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


Users Manual for
the corresponding
CPU.
Connection No.

i_Connection_No

Word

1 to 15 (decimal

Specifies the connection No.

number)

logged onto using


P+Cognex-In-Sight-E71_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.

49
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

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

1.02C

2009/11/10

Special command argument specification 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.

50
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

P+Cognex-In-Sight-E71_SendCmd (Native Command Send)

Name
P+Cognex-In-Sight-E71_SendCmd

Description of Function

Item
Summary of Function

Description
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-E71_SendCmd.

Compatible Devices

Compatible units

QJ71E71-100

Compatible Vision
System

Cognex In-Sight

Compatible CPU
Series

Model
1

MELSEC-Q Series

High performance QCPU model2


Universal QCPU model

1: QCPU-A (A mode) cannot be used.


2: Serial Nos. with the first 5 digits of 04012 or later.
GX Works2

Version 1.09K or later

Language

Ladder

No. of Steps (Max.)

Universal models: 624


* 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, sends a random native command, and receives the
result.

FB Compile Method

Macro type

FB Operation

Pulse execution type (multiple scans)

51
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

Item

Description
[With abnormal end]

[With normal 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-E71_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

Q-compatible Ethernet Interface Unit Users Manual (Basic Edition)


In-Sight EasyBuilder Help

52
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

Error Code

Error Code List


Error Code
0
-1
-2
-4
-5

-6

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.

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.

-105

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?

-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.

53
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

Labels

Input Labels
Name

Variable name

Data type

Valid range

Description

Execution command

FB_EN

Bit

---

Unit installation XY address

i_Start_IO_No

Word

Connection No.

i_Connection_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.
1 to 15 (decimal
number)

ON: Run the FB.


OFF: Do not run the FB.
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.)

Timeout value

i_TimeOut

Word

1 to 32767
(decimal number)

Native command1

i_Native_Command

Text
string

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

Specifies the connection No.


logged onto using
P+Cognex-In-Sight-E71_Log
On.
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).
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

Description

Execution status

FB_ENO

Bit

OFF

Execution result

o_Result

Text
string

End flag

FB_OK

Bit

OFF

Abnormal end flag

FB_ERROR

Bit

OFF

Error Code

ERROR_ID

Word

ON: The FB is running.


OFF: The FB is not running.
The result of the sent arbitrary
native command is saved as
255 characters or less.
ON: The FB ended normally.
OFF: The FB did not end.
ON: Abnormal FB end.
OFF: The FB did not end.
Returns the error code.

54
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

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

1.02C

2009/11/10

Special command argument specification 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.

55
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

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) Click on Online, select Password/Keyword and then New.

(2) Select the program to set the password for, and click on Setting.

56
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

(3) Set Registration Condition to Read/Write Protection and, after setting the password, click the OK button.

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

57
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

(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.

58
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

Finding Out which Symbolic Tags can be Used with an FB

Communication for the application step in In-Sight EasyBuilder.


MC Protocol for communication.
The name of the symbolic tag can be checked by selecting the Format Input (Output) Data tab and clicking the Add
button.

59
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

Type Conversion Processing Combination Table of P+Cognex-In-Sight-E71_GetData

P+Cognex-In-Sight-E71_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.
Numerical Value
Numerical Value Range
2.147e+0092.147e+009

Type of Tag
Text String

Data Type of
Received Value
Data Type of the Received Value
Not Entered
Text String (Enter KO)

Operation 1

Error 1*1.

Error 1*1.

Error 1*1.

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
Other Ranges

Numerical Value
Range
"0" or "1"

Numerical Value Range


-3276832767

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 for P+Cognex-In-Sight-E71_SetData

P+Cognex-In-Sight-E71_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.
60
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

Usable Native Commands That Can Be Sent With P+Cognex-In-Sight-E71_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 c. 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-Sight 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.

61
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

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.

62
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

Example of Using the FB Library

Example of Operating In-Sight With Sequencer


The following is an example of operating In-Sight using QJ71E71-100.
Select and use jobs stored in In-Sight.

(1) System configuration

QJ71E71-100

Q Series Sequencer

Unit

Q06HCPU

Power

Windows
Personal computer

In-Sight
Micro

(2) Device list

External input (command)


Device

FB Name

Application (when turned ON)

M100

P+Cognex-In-Sight-E71_LogOn

Establish connection with In-Sight request

M110

P+Cognex-In-Sight-E71_LoadJob

Operation job change request

M120

P+Cognex-In-Sight-E71_TriggerAcq

Assess image request

M130

P+Cognex-In-Sight-E71_GetData

Symbolic tag value acquisition request

M140

P+Cognex-In-Sight-E71_SetData

Symbolic tag value change request

M150

P+Cognex-In-Sight-E71_GetStatus

Acquire In-Sight online/offline status request

M160

P+Cognex-In-Sight-E71_Online

In-Sight online request

M170

P+Cognex-In-Sight-E71_Offline

In-Sight offline request

M180

P+Cognex-In-Sight-E71_SaveJob

Save job request

M190

P+Cognex-In-Sight-E71_SendCmd

Send native command request

63
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

External output (confirmation)


Device

FB Name

Application (when turned ON)

D10

P+Cognex-In-Sight-E71_LogOn

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

D11

P+Cognex-In-Sight-E71_LoadJob

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

D12

P+Cognex-In-Sight-E71_TriggerAcq

Outputs the error code generated during image assessment and


assessment result acquisition.

D13

P+Cognex-In-Sight-E71_GetData

Outputs the error code generated during symbolic tag value acquisition.

D14

P+Cognex-In-Sight-E71_SetData

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

D15

P+Cognex-In-Sight-E71_GetStatus

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

D16

P+Cognex-In-Sight-E71_Online

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

D17

P+Cognex-In-Sight-E71_Offline

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

D18

P+Cognex-In-Sight-E71_SaveJob

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

D19

P+Cognex-In-Sight-E71_SendCmd

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

D100

P+Cognex-In-Sight-E71_TriggerAcq

Outputs the image assessment result.

D200

P+Cognex-In-Sight-E71_GetData

Outputs the symbolic tag value.

D400

P+Cognex-In-Sight-E71_SetData

Outputs the value change result for symbolic tags.

D500

P+Cognex-In-Sight-E71_GetStatus

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

D600

P+Cognex-In-Sight-E71_SendCmd

Outputs the native command send result.

Data register
Device

FB Name

Application

D300

P+Cognex-In-Sight-E71_SetData

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

D301

P+Cognex-In-Sight-E71_SetData

Specifies the type of set value set in D300.

D5500

P+Cognex-In-Sight-E71_TriggerAcq

Enters the image assessment frequency.

D5501

P+Cognex-In-Sight-E71_TriggerAcq

Enters the image assessment result.

D5502

P+Cognex-In-Sight-E71_TriggerAcq

Writes data on the image assessment result (50 words or less).

R0

P+Cognex-In-Sight-E71_TriggerAcq

Saves data on the image assessment result.

(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-E71_LoadJob

xy-ja.job

Positioning

Trigger frequency, image assessment result,

inspection

positioning assessment result

P+Cognex-In-Sight-E71_LoadJob

inspect-ja.job

Inspection

Trigger frequency, image assessment result

P+Cognex-In-Sight-E71_LoadJob

IDCode-ja.job

QR code reading

Trigger frequency, image assessment result, QR


code details

64
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

(4) Example of Use Settings

Common settings
Input output items

Value

Description

Unit installation XY address

H0

Specifies the unit installation XY address of the


QJ71E71-100 that carries out communication.

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-E71_LogOn

operator

FB Name

Job Name

Job Description

P+Cognex-In-Sight-E71_LoadJob

xy-ja.job

Determines positioning.

P+Cognex-In-Sight-E71_SaveJob

xy-ja.job

Determines positioning.

FB Name

Tag Name

Description

P+Cognex-In-Sight-E71_GetData

Pattern_1. Accept threshold

Threshold for a pass/no pass determination

P+Cognex-In-Sight-E71_SetData

Pattern_1. Accept threshold

Threshold for a pass/no pass determination

(NULL password)

Input job file name

Input symbolic tag name

65
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

(5) FB Library Example


(a) P+Cognex-In-Sight-E71_LogOn (Establish Connection with Vision System)
Logs on to In-Sight using the user name operator and password NULL password.

Turns ON when a
connection with
In-Sight is
established.

Enters the user name


for logging on.

Enters the password


for the user name.

(b) P+Cognex-In-Sight-E71_LoadJob (Select, Change and Activate Jobs)


Changes the job to xy-ja.job.

Turns ON when the job


is changed.

Inputs the job file name


to be changed.

66
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

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


Assesses the image and receives the result.

Turns ON when the


image is being
assessed.

Saves the image


assessment results to
the file register.

After the image is


assessed, the
positioning inspection
result is saved to the
file register.

Resets to "0" when the


upper limit of the file
register is exceeded.

67
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

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


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

Turns ON when the


symbolic tag value is
acquired.

Acquires the value and


inputs the tag name.

68
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

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


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

Turns ON when the


symbolic tag value is
changed.

Inputs the tag name for


which the value will be
changed.

69
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

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


Acquires the status of In-Sight.

Turns ON when the


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

(g) P+Cognex-In-Sight-E71_SetOnline (Put Vision System Online)


Puts In-Sight online.

Turns ON when
In-Sight is put online.

70
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

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


Takes In-Sight offline.

Turns ON when
In-Sight is taken
offline.

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


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

Turns ON when saving


the job to In-Sight's
flash memory.

Enters the job file


name for saving.

71
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

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


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

Turns ON when saving


the job to In-Sight's
flash memory.

Enters the native


command for sending.

72
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

(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-E71_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.

Saves the image


assessment results to the
file register.

Resets to "0" when the


upper limit of the file
register is exceeded.

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

73
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

(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.

74
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection

Вам также может понравиться