of 75
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
1/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
1
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
2/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
1
Reference Manual Revision History
Version Revised
Date
Revision Contents
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.
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
3/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
2
Outline
FB Library Outline
This FB library is for systems that use the QJ71E71-100 moduleto connect to Cognex CorporationIn-Sight Vision
Systems.
FB Library Function Contents
No. Item Description
1 P+Cognex-In-Sight-E71_LogOn Establishes the connection between the QJ71E71-100 module and the
In-Sight Vision System.
2 P+Cognex-In-Sight-E71_LoadJob Selects, changes and activates jobs stored in the In-Sight Vision System.
3 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).
4 P+Cognex-In-Sight-E71_GetData Acquires the data held by In-Sight.
5 P+Cognex-In-Sight-E71_SetData Changes the data held by In-Sight.
6 P+Cognex-In-Sight-E71_GetStatus Acquires the current status of the In-Sight Vision System (online/offline).7 P+Cognex-In-Sight-E71_SetOnline Puts the In-Sight Vision System online.
8 P+Cognex-In-Sight-E71_SetOffline Takes the In-Sight Vision System offline.
9 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.
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
4/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
3
System Configuration Example
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)
No. Device Name Explanation1 Q series sequencer Use base, power supply unit and high performance QnH CPU unit
1or
universal QnU CPU model.
2 GX Works2 Use Version 1.09K or later
3 QJ71E71-100 Q series sequencer Ethernet unit
4 Cognex In-Sight series In-Sight Vision System
Connecting multiple devices with In-Sight is possible using an
ethernet hub.2
5 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.
6 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.
7 Windows personal computer Used when connecting to the In-Sight series using EasyBuilder.
8 Cognex EasyBuilder Version 4.3 Used when connecting with In-Sight and for programming settings.
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
5/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
4
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.
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
6/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
5
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 IntervalDest. Confirmation Resend
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
7/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
6
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 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 Station Port No. Enter the hexadecimal number that matches the In-Sight setting.
(hexadecimal number) (Refer to 1.5) Enter 0BB8.
(g) Destination IP address Enter the decimal number that matches the In-Sight setting.
(Refer to 1.5) Enter 192.168.0.1.
(h) Destination Port number Enter the hexadecimal number that matches the In-Sight setting.(hexadecimal number) (Refer to 1.5) Enter 0BB8.
(2) MC protocol settings
(a) Protocol Set to TCP.
(b) Open System Set to MC Protocol.
(c) TCP connection method No setting is required.
(d) Host Station Port No. Enter the hexadecimal number that matches the In-Sight setting.
(hexadecimal number) (Refer to 1.5) The default setting is 3000.
(e) Destination IP address No setting is required.
(f) Destination Port number No setting is required.
Use GX Works2 to program the 3 Connection Open settings.
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
8/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
7
Essential Cognex EasyBuilder Settings for Using FB
This section explains the CognexIn-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.
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
9/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
8
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/10/2019 Function Block Example Reference for E71 Module Application Note-En
10/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
9
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.
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
11/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
10
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 Description
Summary of Function Establishes the connection between the QJ71E71-100 module and the In-Sight Vision
System.
Symbol
Compatible units QJ71E71-100
Compatible Vision
SystemCognex In-Sight
Compatible CPU
Series Model
High performance QCPU model2MELSEC-Q Series
1
Universal QCPU model
1: QCPU-A (A mode) cannot be used.
2: Serial Nos. with the first 5 digits of 04012 or later.
Compatible Devices
GX Works2 Version 1.09K or later
Language Ladder
No. of Steps (Max.) Universal models: 963
* 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
FunctionWith 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)
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
12/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
11
Item Description
I/O Signal Movement [With normal end]
[Execution
Command]
[Execution
Status]
[Normal
Completion]
[Abnormal
Completion]
[Error Code]
[With abnormal end]
[Execution
Command]
[Execution
Status]
[Normal
Completion]
[Abnormal
Completion]
[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. 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
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
13/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
12
Error Code
Error Code List
Error Code Description Action
-102
Connection Open failed. Perform the operation again after checking whether
the connection No. for the FB input label is not outside
the acceptable range and whether the connection
destination settings in GX Works2 are correct.
-103 Connection Open failed. The corresponding connection is already open.
-104A communication error occurred. Invalid data was received. Perform the operation again
after checking the line status and the ladder program.
-105
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.
-106
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)?
-200Logon to In-Sight failed with the entered
user name and password.
Re-confirm the user name and password.
-201The length of the user name exceeds
15 characters.
The user name must be 15 characters or less.
-202The length of the password exceeds
15 characters.
The password must be 15 characters or less.
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
14/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
13
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
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.
Password1,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.
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
15/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
14
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 0 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 forGX Works2. Be sure to read the GX Works2 Operating Manual (General Edition) for the setting method.
FB Version Update History
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.
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
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
16/75
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
17/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
16
Item Description
I/O Signal Movement [With normal end]
[Execution
Command]
[Execution
Status]
[Normal
Completion]
[Abnormal
Completion]
[Error Code]
[With abnormal end]
[Execution
Command]
[Execution
Status]
[Normal
Completion]
[Abnormal
Completion]
[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 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
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
18/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
17
Error Code
Error Code List
Error Code Description Action
-1The specified value is outside the range or
is not a valid integer.
Refer to the In-Sight manual.
-2 The command could not be executed. Refer to the In-Sight manual.
-4In-Sights sensor does not have
sufficient memory.
Refer to the In-Sight manual.
-5 The system is not online. Refer to the In-Sight manual.
-6
The user doesnt have the necessary
access privileges to execute the
command.
Refer to the In-Sight manual.
-105A 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.
-106
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)?
-300
The length of the job file name to be
changed is not between 1 and 32
characters.
Enter a job file name of between 1 and 32 characters,
including the extension.
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
19/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
18
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 beautomatically set to 30
(seconds).
Selected job file name1 i_JobFileName Text
string
[0 to 9] [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 DescriptionExecution 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 0 Returns the error code for the
abnormal result.
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
20/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
19
FB Version Update History
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.
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
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
21/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
20
P+Cognex-In-Sight-E71_TriggerAcq (Acquisition of Image Assessment Results)
Name
P+Cognex-In-Sight-E71_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 units QJ71E71-100
Compatible Vision
SystemCognex In-Sight
Compatible CPU
Series Model
High performance QCPU model2MELSEC-Q Series
1
Universal QCPU model
1: QCPU-A (A mode) cannot be used.
2: Serial Nos. with the first 5 digits of 04012 or later.
Compatible Devices
GX Works2 Version 1.09K or laterLanguage Ladder
No. of Steps (Max.) Universal models: 1358
* 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, triggers loading of the In-Sight Vision System images
and then acquires the result of the image assessment (pass / no pass).
FB Compile Method Macro type
FB Operation Pulse execution type (multiple scans)
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
22/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
21
Item Description
I/O Signal Movement [With normal end]
[Execution
Command]
[Execution
Status]
[Normal
Completion]
[Abnormal
Completion]
[Error Code]
[With abnormal end]
[Execution
Command]
[Execution
Status]
[Normal
Completion]
[Abnormal
Completion]
[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. 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.
-6
The user doesnt have the necessary
access privileges to execute the
command.
Refer to the In-Sight manual.
-104A communication error occurred. Invalid data was received. Perform the operation again
after checking the line status and the ladder program.
-105
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.
-106
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)?
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
23/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
22
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 FBUnit 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 isentered, 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.
Execution result o_Result Word 0 -1: Pass/no pass statusacquisition 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 0 Returns the error code for theabnormal result.
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
24/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
23
FB Version Update History
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.
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
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
25/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
24
P+Cognex-In-Sight-E71_GetData (Value Acquisition of Symbolic Tags)
FB Definition Name
P+Cognex-In-Sight-E71_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 units QJ71E71-100
Compatible Vision
SystemCognex In-Sight
Compatible CPU
Series Model
High performance QCPU model
2
MELSEC-Q Series1Universal QCPU model
1: QCPU-A (A mode) cannot be used.
2: Serial Nos. with the first 5 digits of 04012 or later.
Compatible Devices
GX Works2 Version 1.09K or later
Language Ladder
No. of Steps (Max.) Universal models: 1358
* 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).
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
26/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
25
Item Description
Explanation of
FunctionWith FB_EN (execution command) ON, sends the symbolic tag set in i_tag to the In-Sight
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]
[Execution
Command]
[Execution
Status]
[Normal
Completion]
[Abnormal
Completion]
[Error Code]
[With abnormal end]
[Execution
Command]
[Execution
Status]
[Normal
Completion]
[Abnormal
Com letion
[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. 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
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
27/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
26
Error Code
Error Code List
Error Code Description Action
-1The specified value is outside the range or
is not a valid integer.
Refer to the In-Sight manual.
-2 The command could not be executed. Refer to the In-Sight manual.
-6
The user doesnt have the necessary
access privileges to execute the
command.
Refer to the In-Sight manual.
-104A communication error occurred. Invalid data was received. Perform the operation again
after checking the line status and the ladder program.
-105
A communication error occurred. Perform the operation again after checking whether
power has been disconnected to In-Sight or thecommunications cable has been disconnected, etc.
-106
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)?
-301The length of the symbolic tag name is not
between 1 and 32 characters.
Enter a symbolic tag name of between 1 and 32
characters.
-305 The set data type is not between 0 and 4. Set the data type to between 0 and 4.
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
28/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
27
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_Lo
gOn.
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 isentered, the value will be
automatically set to
30 (seconds).
Symbolic tag1 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 value2 i_Result_Type Word 0 to 4 (decimal
number)
Specifies the data type of
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.
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
29/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
28
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
16 bit integer
32 bit integer
Single-
precision real
number
0 The result for the sent symbolic
tag will be saved.
For a text string, a maximum of
255 characters is saved.
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 0 Returns the error code for the
abnormal result.
FB Version Update History
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.
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
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
30/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
29
P+Cognex-In-Sight-E71_SetData (Value Change of Symbolic Tags)
Name
P+Cognex-In-Sight-E71_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 units QJ71E71-100
Compatible Vision
SystemCognex In-Sight
Compatible CPU
Series ModelHigh performance QCPU model
2MELSEC-Q Series
1
Universal QCPU model
1: QCPU-A (A mode) cannot be used.
2: Serial Nos. with the first 5 digits of 04012 or later.
Compatible Devices
GX Works2 Version 1.09K or later
Language Ladder
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
31/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
30
Item Description
No. of Steps (Max.) 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
FunctionWith FB_EN (execution command) ON, sends a random symbolic tag to the In-Sight Vision
System, and sets the value.
FB Compile Method Macro type
FB Operation Pulse execution type (multiple scans)
I/O Signal Movement [With normal end]
[Execution
Command]
[Execution
Status]
[Normal
Completion]
[Abnormal
Completion]
[Error Code]
[With abnormal end]
[Execution
Command]
[Execution
Status]
[Normal
Completion]
[Abnormal
Com letion
[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
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
32/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
31
Error Code
Error Code List
Error Code Description Action
-1The specified value is outside the range or
is not a valid integer.
Refer to the In-Sight manual.
-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.
-6
The user doesnt have the necessary
access privileges to execute the
command.
Refer to the In-Sight manual.
-104A communication error occurred. Invalid data was received. Perform the operation again
after checking the line status and the ladder program.
-105A 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.
-106
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)?
-301The length of the symbolic tag name is not
between 1 and 32 characters.
Enter a symbolic tag name of between 1 and 32
characters.
-302The set value length is not between 1 and
32 characters.
Enter a set value length of between 1 and 32
characters.
-305 The set data type is not between 0 and 4. Set the data type to between 0 and 4.
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
33/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
32
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).
Symbolic tag1 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
Single-preci
sion 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 value
2
i_tag_Data_Type Word 0 to 4 (decimal number) Specifies the data type ofthe 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 ProcessingCombination Table of P+Cognex-In-Sight-E71_SetData.
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
34/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
33
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 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 0 Returns the error code for
the abnormal result.
FB Version Update History
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.
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
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
35/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
34
P+Cognex-In-Sight-E71_GetStatus (Online/Offline Acquisition)
Name
P+Cognex-In-Sight-E71_GetStatus
Description of Function
Item Description
Summary of Function Acquires the current status of the In-Sight Vision System (online/offline).
Symbol
Compatible units QJ71E71-100
Compatible Vision
SystemCognex In-Sight
Compatible CPU
Series Model
High performance QCPU model2MELSEC-Q Series
1
Universal QCPU model
1: QCPU-A (A mode) cannot be used.
2: Serial Nos. with the first 5 digits of 04012 or later.
Compatible Devices
GX Works2 Version 1.09K or laterLanguage Ladder
No. of Steps (Max.) Universal models: 547
* 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
System (online/offline).
FB Compile Method Macro type
FB Operation Pulse execution type (multiple scans)
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
36/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
35
Item Description
I/O Signal Movement [With normal end]
[Execution
Command]
[Execution
Status]
[Normal
Completion]
[Abnormal
Completion]
[Error Code]
[With abnormal end]
[Execution
Command]
[Execution
Status]
[Normal
Completion]
[Abnormal
Completion]
[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. 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.
-6
The user doesnt have the necessary
access privileges to execute the
command.
Refer to the In-Sight manual.
-105
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.
-106
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)?
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
37/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
36
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 beautomatically 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.
Execution result o_Result Word 0 0: Offline
1: OnlineEnd 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 0 Returns the error code for the
abnormal result.
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
38/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
37
FB Version Update History
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.
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
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
39/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
38
P+Cognex-In-Sight-E71_SetOnline (Puts the In-Sight Vision System Online)
Name
P+Cognex-In-Sight-E71_SetOnline
Description of Function
Item Description
Summary of Function Puts the In-Sight Vision System online.
Symbol
Compatible units QJ71E71-100
Compatible Vision
SystemCognex In-Sight
Compatible CPU
Series Model
High performance QCPU model2MELSEC-Q Series
1
Universal QCPU model
1: QCPU-A (A mode) cannot be used.
2: Serial Nos. with the first 5 digits of 04012 or later.
Compatible Devices
GX Works2 Version 1.09K or later
Language LadderNo. of Steps (Max.) Universal models: 544
* 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)
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
40/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
39
Item Description
I/O Signal Movement [With normal end]
[Execution
Command]
[Execution
Status]
[Normal
Completion]
[Abnormal
Completion]
[Error Code]
[With abnormal end]
[Execution
Command]
[Execution
Status]
[Normal
Completion]
[Abnormal
Completion]
[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. 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.
-6
The user doesnt have the necessary
access privileges to execute the
command.
Refer to the In-Sight manual.
-105
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.
-106
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)?
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
41/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
40
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 thecorresponding 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).
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 0 Returns the error code.
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
42/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
41
FB Version Update History
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.
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
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
43/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
42
P+Cognex-In-Sight-E71_SetOffline (Takes the In-Sight Vision System Offline)
Name
P+Cognex-In-Sight-E71_SetOffline
Description of Function
Item Description
Summary of Function Takes the In-Sight Vision System offline.
Symbol
Compatible units QJ71E71-100
Compatible Vision
SystemCognex In-Sight
Compatible CPU
Series Model
High performance QCPU model2MELSEC-Q Series
1
Universal QCPU model
1: QCPU-A (A mode) cannot be used.
2: Serial Nos. with the first 5 digits of 04012 or later.
Compatible Devices
GX Works2 Version 1.09K or later
Language LadderNo. of Steps (Max.) Universal models: 535
* 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)
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
44/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
43
Item Description
I/O Signal Movement [With normal end]
[Execution
Command]
[Execution
Status]
[Normal
Completion]
[Abnormal
Completion]
[Error Code]
[With abnormal end]
[Execution
Command]
[Execution
Status]
[Normal
Completion]
[Abnormal
Completion]
[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. 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.
-6
The user doesnt have the necessary
access privileges to execute the
command.
Refer to the In-Sight manual.
-105
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.
-106
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)?
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
45/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
44
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).
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 0 Returns the error code.
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
46/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
45
FB Version Update History
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.
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
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
47/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
46
P+Cognex-In-Sight-E71_SaveJob (Save the Operation Job in Flash Memory)
Name
P+Cognex-In-Sight-E71_SaveJob
Description of Function
Item Description
Summary of Function Saves the current job to the In-Sight Vision Systems flash memory.
Symbol
Compatible units QJ71E71-100
Compatible Vision
SystemCognex In-Sight
Compatible CPU
Series Model
High performance QCPU model2MELSEC-Q Series
1
Universal QCPU model
1: QCPU-A (A mode) cannot be used.
2: Serial Nos. with the first 5 digits of 04012 or later.
Compatible Devices
GX Works2 Version 1.09K or later
Language LadderNo. of Steps (Max.) Universal models: 936
* 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
FunctionWith FB_EN (execution command) ON, saves the current job to the In-Sight Vision Systems
flash memory.
FB Compile Method Macro type
FB Operation Pulse execution type (multiple scans)
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
48/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
47
Item Description
I/O Signal Movement [With normal end]
[Execution
Command]
[Execution
Status]
[Normal
Completion]
[Abnormal
Completion]
[Error Code]
[With abnormal end]
[Execution
Command]
[Execution
Status]
[Normal
Completion]
[Abnormal
Completion]
[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 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
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
49/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
48
Error Code
Error Code List
Error Code Description Action
-2
The command could not be executed
because saving the job failed, In-Sight
was online, or the file was not found.
Refer to the In-Sight manual.
-5 The system is not online. Refer to the In-Sight manual.
-6
The user doesnt have the necessary
access privileges to execute the
command.
Refer to the In-Sight manual.
-105
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.
-106
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)?
-303The length of the job file name to be saved
is not between 1 and 32 characters.
Enter a job file name of between 1 and 32 characters,
including the extension.
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
50/75
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
51/75
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
52/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
51
P+Cognex-In-Sight-E71_SendCmd (Native Command Send)
Name
P+Cognex-In-Sight-E71_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-E71_SendCmd.
Compatible units QJ71E71-100
Compatible Vision
SystemCognex In-Sight
Compatible CPU
Series Model
High performance QCPU model2MELSEC-Q Series
1
Universal QCPU model
1: QCPU-A (A mode) cannot be used.
2: Serial Nos. with the first 5 digits of 04012 or later.
Compatible Devices
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
FunctionWith 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)
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
53/75
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
54/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
53
Error Code
Error Code List
Error Code Description Action
0 An unrecognizable command was sent. Refer to the In-Sight manual.
-1 The specified value is outside the range or
is not a valid integer.
Refer to the In-Sight manual.
-2 The command could not be executed. Refer to the In-Sight manual.
-4In-Sights sensor does not have
sufficient memory.
Refer to the In-Sight manual.
-5 The system is not online. Refer to the In-Sight manual.
-6
The user doesnt have the necessary
access privileges to execute the
command.
Refer to the In-Sight manual.
-105
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.
-106
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)?
-304The length of the native command to be
sent is not between 1 and 199 characters.
Set the native command to be sent to between 1 and
199 characters.
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
55/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
54
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 (decimalnumber)
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).
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 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 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 0 Returns the error code.
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
56/75
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
57/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
56
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.
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
58/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
57
(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.
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
59/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
58
(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.
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
60/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
59
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.
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
61/75
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
62/75
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
63/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
62
The native commands that can be sent by this program following the native command Put XML are shown below.
No. Native Command Name Description
1 EV GetCustomize Reads the settings of the Customize dialog box from the GUI of In-Sight 3000/3400.
2 EV
GetDeEnergizeOutputs
Returns the Turn off the output power when offline setting specified by the Discrete
output setting dialog box.
3 EV GetDiscreteInput Returns the information set in the Discrete input setting dialog box.
4 EV GetDiscreteOutput Returns the information set in the Discrete output setting dialog box.
5 EV GetEIPSingleAttribute Returns the class and the instance attributes of In-Sight EtherNet/IP.6 EV GetFTPSettings Returns the information set in the FTP settings dialog box.
7 EV GetHostTable Returns the information included in the In-Sight host table dialog box.
8 EV MSBuffer Returns the machine status data stored in one of the buffers (begins with 0) attached
to the 8 indices within the machine status stack
9 EV GetNetwork Returns the information set in the Network settings dialog box.
10 EV GetSerialPort Returns the information set in the Serial port settings dialog box.
11 EV GetStartup Returns the information set in the Startup dialog box.
12 EV GetUserList Returns the information set in the User list dialog box.
13 EV
SetDeEnergizeOutputs
Changes the Turn off output power when offline setting of the Discrete output
setting dialog box.
14 EV EditRegion Changes the cell settings that include the EditRegion function.
15 EV SetEIPSingleAttribute Sets the class and the instance attributes of In-SightEtherNet/IP.16 EV SetFavorHostTable Activates or deactivates the Give higher priority to the host table than DNS option of
the In-Sight host table.
17 EV SetFTPSettings Changes the FTP settings dialog box settings.
18 EV SetSerialPort Changes the Serial port settings dialog box settings.
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
64/75
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
65/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
64
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
inspection
Trigger frequency, image assessment result,
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
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
66/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
65
(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 (NULL password)
Input job file name
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.
Input symbolic tag name
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
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
67/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
66
(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.
(b) P+Cognex-In-Sight-E71_LoadJob (Select, Change and Activate Jobs)
Changes the job to xy-ja.job.
Turns ON when aconnection with
In-Sight is
established.
Enters the user namefor logging on.
Enters the password
for the user name.
Turns ON when the job
is changed.
Inputs the job file name
to be changed.
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
68/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
67
(c) P+Cognex-In-Sight-E71_TriggerAcq (Acquisition of Image Assessment Result)
Assesses the image and receives the result.
After the image is
assessed, the
positioning inspection
result is saved to the
file register.
Turns ON when the
image is being
assessed.
Resets to "0" when the
upper limit of the file
register is exceeded.
Saves the image
assessment results to
the file register.
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
69/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
68
(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.
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
70/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
69
(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.
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
71/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
70
(f) P+Cognex-In-Sight-E71_GetStatus (Online/Offline Status Acquisition)
Acquires the status of In-Sight.
(g) P+Cognex-In-Sight-E71_SetOnline (Put Vision System Online)
Puts In-Sight online.
Turns ON when the
current status of
In-Sight
(online/offline) is
acquired.
Turns ON when
In-Sight is put online.
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
72/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
71
(h) P+Cognex-In-Sight-E71_SetOffline (Take Vision System Offline)
Takes In-Sight 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
In-Sight is taken
offline.
Turns ON when saving
the job to In-Sight's
flash memory.
Enters the job file
name for saving.
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
73/75
FB Library Reference Manual for In-Sight QnH/QnU CPU QJ71E71-100 Connection
72
(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.
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
74/75
8/10/2019 Function Block Example Reference for E71 Module Application Note-En
75/75
(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.