Está en la página 1de 77

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

<<Index>>

Reference Manual Revision History.................................................................................................................................. 1


1䋮 Outline..................................................................................................................................................................... 2
1䋮1 FB Library Outline................................................................................................................................................ 2
1䋮2 FB Library Function Contents............................................................................................................................... 2
1䋮3 System Configuration Example ............................................................................................................................ 3
1䋮4 Settings for the CPU Unit w/ Built-in Ethernet Port ............................................................................................... 4
1䋮4䋮1 Operation Settings for the CPU Unit w/ Built-in Ethernet Port ........................................................................... 4
1䋮4䋮2 Open Settings for the CPU Unit w/ Built-in Ethernet Port.................................................................................. 5
1䋮5 Settings for the QJ71E71-100 Ethernet Unit......................................................................................................... 6
1䋮5䋮1 Operation Settings for the QJ71E71-100 Ethernet Unit .................................................................................... 6
1䋮5䋮2 Initial Settings for the QJ71E71-100 Ethernet Unit............................................................................................ 7
1䋮5䋮3 Open Settings for the QJ71E71-10 Ethernet Unit ............................................................................................. 8
1䋮6 Essential Cognex© EasyBuilder Settings for Using FB......................................................................................... 9
1䋮7 Startup Check Method For In-Sight® from Personal Computers Using Windows®.............................................. 10
1䋮8 Related manuals.................................................................................................................................................11
1䋮9 Important ............................................................................................................................................................11
2䋮 FB Library Details .................................................................................................................................................. 12
2䋮1 P+Cognex-In-Sight_LogOn (Establish Connection with Vision System) .............................................................. 12
2䋮2 P+Cognex-In-Sight_LoadJob (Selects, Changes and Activates Jobs)................................................................. 17
2䋮3 P+Cognex-In-Sight_TriggerAcq (Acquisition of Image Assessment Results) ....................................................... 22
2䋮4 P+Cognex-In-Sight_GetData (Value Acquisition of Symbolic Tags) ..................................................................... 26
2䋮5 P+Cognex-In-Sight_SetData (Value Change of Symbolic Tags).......................................................................... 31
2䋮6 P+Cognex-In-Sight_GetStatus (Online/Offline Acquisition) ................................................................................. 36
2䋮7 P+Cognex-In-Sight_SetOnline (Puts the In-Sight® Vision System Online).......................................................... 40
2䋮8 P+Cognex-In-Sight_SetOffline (Takes the In-Sight® Vision System Offline)........................................................ 44
2䋮9 P+Cognex-In-Sight_SaveJob (Save the Operation Job in Flash Memory) .......................................................... 48
2䋮10 P+Cognex-In-Sight_SendCmd (Native Command Send).................................................................................... 53
3䋮 Appendix ............................................................................................................................................................... 58
3䋮1 Using Passwords to Prevent Reading/Writing in Ladder Programs ..................................................................... 58
3䋮2 Finding Out which Symbolic Tags can be Used with an FB................................................................................. 61
3䋮3 Type Conversion Processing Combination Table for P+Cognex-In-Sight_GetData.............................................. 62
3䋮4 Type Conversion Processing Combination Table of P+Cognex-In-Sight_SetData ............................................... 62
3䋮5 Usable Native Commands That Can Be Sent With P+Cognex-In-Sight_SendCmd ............................................. 63
4䋮 Example of Using the FB Library............................................................................................................................ 65
4䋮1 Example of Operating In-Sight® With Sequencer ............................................................................................... 65

㩷 㪈
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
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” item in the "Unit installation
XY address” input label
3. Corrections due to connection No. range check processing change
All FBs: Error Code “-101” Definition deletion
All FBs: Error Code “-102” Language correction
All FBs: Error Code “-104” Language correction
All FBs: Error Code “-105” Language correction
All FBs: Error Code “-106” Language correction
v1.02C 2009/10/02 Correction of the number of connected units described in 1.3 System Configuration
v1.03D 2009/12/01 1. Description addition of L series CPU in 1.1 FB Library Outline.
2. 1.2 FB Library Function Contents were corrected as follows.
For P+Cognex-In-Sight_LogOn, “QnUCPU w/ built-in Ethernet” was changed
to “CPU w/ built-in Ethernet port”.
3. Language of 1.4: QnUCPU w/ built-in Ethernet was changed to CPU w/ built-in
Ethernet port.
4. FB Library Details - Description of Function: Corrected as follows.
All FBs: Target unit was changed from “QnUCPU w/ built-in Ethernet” to
“CPU w/ built-in Ethernet port”.
All FBs: L series CPU added to the target CPU.
All FBs: L series added to the GX Works2 version.
All FBs: Description of the input conditions for FB_EN deleted.
All FBs: FB operation: Pulse execution type (multiple scans) added.
5. FB Library Details - Input Labels: Changed as follows.
All FBs: Explanation for unit installation XY address changed to the
explanation for CPU w/ built-in Ethernet port.
6. FB Library Details - Related manuals: “MELSEC-L CPU Users Manual” added.
7. FB Library Details - Connection Destination Settings: Corrected as follows.
P+Cognex-In-Sight_LogOn: “CPU w/ built-in Ethernet” changed to CPU
w/ built-in Ethernet port.

㩷 㪈
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
㪈䋮 Outline
㪈䋮㪈 FB Library Outline
This FB library connects to Cognex© Corporation In-Sight® Vision Systems by using the QCPU w/ built-in Ethernet port
and LCPU (hereinafter, referred to as CPU w/ built-in Ethernet port) and ethernet unit QJ71E71-100.

㪈䋮㪉 FB Library Function Contents

No. Item Description


1 P+Cognex-In-Sight_LogOn Establishes the connection between the CPU w/ built-in Ethernet port,
QJ71E71-100 module and the In-Sight® Vision System.
2 P+Cognex-In-Sight_LoadJob Selects, changes and makes active jobs stored in the In-Sight® Vision System.
3 P+Cognex-In-Sight_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_GetData Acquires the data held by In-Sight®.
5 P+Cognex-In-Sight_SetData Changes the data held by In-Sight®.
6 P+Cognex-In-Sight_GetStatus Acquires the current status of the In-Sight® Vision System (online/offline).
7 P+Cognex-In-Sight_SetOnline Puts the In-Sight® Vision System online.
8 P+Cognex-In-Sight_SetOffline Takes the In-Sight® Vision System offline.
9 P+Cognex-In-Sight_SaveJob Saves the current job to the In-Sight® Vision System’s flash memory.
10 P+Cognex-In-Sight_SendCmd Sends the selected native command and receives the results.

㩷 㪉
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
㪈䋮㪊 System Configuration Example
In the Q series, the configuration is as follows. The system configuration is the same for the L series as well.

㪨㪇㪍㪬㪛㪜㪟㪚㪧㪬㩷

㪨㩷㪪㪼㫉㫀㪼㫊㩷㪪㪼㫈㫌㪼㫅㪺㪼㫉㩷

㪨㪡㪎㪈㪜㪎㪈㪄㪈㪇㪇㩷
㩷 㪞㪯㩷㪮㫆㫉㫂㫊㪉㩷
㪧㫆㫎㪼㫉㩷 㩷 㪜㪸㫊㫐㪙㫌㫀㫃㪻㪼㫉㩷
㪬㫅㫀㫋㩷

㪮㫀㫅㪻㫆㫎㫊㫤㩷
㪧㪼㫉㫊㫆㫅㪸㫃㩷㪚㫆㫄㫇㫌㫋㪼㫉㩷

㪜㫋㪿㪼㫉㫅㪼㫋㩷㪿㫌㪹㩷
㪚㫆㪾㫅㪼㫏㫟㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤㩷

㪪㪼㫉㫀㪼㫊㩷 㩷 㪧㫆㪜㩷㪬㫅㫀㫋㩷

No. Device Name Explanation


1 Q series sequencer Use base, power supply unit and QnUCPU unit w/ built-in Ethernet
with Serial Nos. with the first 5 digits of “11012” or later.
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.1
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 An ethernet hub is not essential. Operation is possible even with
compatible products system configurations directly connected to QnUCPU w/ built-in
Ethernet and 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.

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


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

㩷 㪊
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
㪈䋮㪋 Settings for the CPU Unit w/ Built-in Ethernet Port
㪈䋮㪋䋮㪈 Operation Settings for the CPU Unit w/ Built-in Ethernet Port

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

Use GX Works2 to program the following items.


(1) Your IP address Set the IP address of the ethernet unit as “192.168.0.2”.
(2) Enable online change Check the checkbox.

The following diagram is from GX Works2.

㩷 㪋
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
㪈䋮㪋䋮㪉 Open Settings for the CPU Unit w/ Built-in Ethernet Port

(1) Socket Communication settings


Select the connection No. that fits the system.
This will be the connection No. that is entered into the FB.

(a) Protocol Set to “TCP”.


(b) Open System Set to “Socket Communication”
(c) TCP connection Set to “Active”.
(d) Host Station Port No. Enter the hexadecimal number that matches the In-Sight® setting.
(hexadecimal number) (Refer to 1.6) The default setting is “0017”.
(e) Destination IP address Enter the decimal number that matches the In-Sight® setting. (Refer to 1.6)
The destination IP address is “192.168.0.1”.
(f) Destination Port No. Enter the hexadecimal number that matches the In-Sight® setting.
(hexadecimal number) (Refer to 1.6) The default setting is “0017”.
(2) MC Protocol settings
(a) Protocol Set to “TCP”.
(b) Open System Set to “MC Protocol”.
(c) TCP Connection No setting is required.
(d) Host Station Port No. Enter the hexadecimal number that matches the In-Sight® setting.
(hexadecimal number) (Refer to 1.6) The default setting is “3000”.
(e) Destination IP address No setting is required.
(f) Destination Port No. No setting is required.

Use GX Works2 to program the 2 Connection Open settings.

㩷 㪌
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
㪈䋮㪌 Settings for the QJ71E71-100 Ethernet Unit
㪈䋮㪌䋮㪈 Operation Settings for the QJ71E71-100 Ethernet Unit

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

Use GX Works2 to program the following items.


(1) Start I/O No. Enter in accordance with the installation unit No.
When installing in slot 0, set “0000”.
(2) Network No. Enter in accordance with the network configuration.
Set to “1”.
(3) Station No. Enter in accordance with the network configuration.
Set to “1”.
(4) Your IP address Set the IP address of the ethernet unit.
It is set to “192.168.0.3” in this program.
(5) Initial timing setting Select “Always wait for OPEN (Communication possible at STOP time)”.
(6) Enable Online Change Check the checkbox.

The following screenshot is from GX Works2.

㩷 㪍
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
㪈䋮㪌䋮㪉 Initial Settings for the QJ71E71-100 Ethernet Unit

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

Dest. Confirmation Start Interval


Dest. Confirmation Interval
Dest. Confirmation Resend

㩷 㪎
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
㪈䋮㪌䋮㪊 Open Settings for the QJ71E71-10 Ethernet Unit
Use GX Works2 to program the 3 Connection Open settings.

(1) TCP Communication Settings


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

(2) Connection No.3 (For MC protocol reception)


(a) Protocol Set to “TCP”.
(b) Open System Set to “Unpassive”.
(c) Fixed Buffer Set to “Receive”.
(d) Fixed Buffer Communication Procedure Set to “Procedure Exist”.
(e) Pairing Open Set to “Disable”.
(f) Existence Confirmation Set to “Confirm”.
(g) Host Station Port No. Enter the hexadecimal number that matches the In-Sight® setting.
(hexadecimal number) (Refer to 1.6) The default setting is “3000”.
(h) Destination IP address No setting is required.
(i) Destination Port No. No setting is required.

㩷 㪏
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
㪈䋮㪍 Essential Cognex© EasyBuilder Settings for Using FB
This section explains the Cognex© In-Sight® settings used by this program.
Set the job file settings and the network setting.
For details, refer to “In-Sight® EasyBuilder Help”.

Use EasyBuilder to program the following network settings.

(1) IP Address Set the IP address of Cognex© In-Sight® to “192.168.0.1” so the IP address
settings of sequencer CPU in In-Sight® EasyBuilder do not overlap.
(2) Subnet Mask Set the subnet mask in In-Sight® EasyBuilder to “255.255.255.0”.
(3) Telnet Port No. (decimal number) When connecting with the CPU w/ built-in Ethernet port, set to “23” in
In-Sight® EasyBuilder.
When connecting with the QJ71E71-100, set to “3000” in In-Sight®
EasyBuilder.

㩷 㪐
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
㪈䋮㪎 Startup Check Method For In-Sight® from Personal Computers Using Windows®
Use Command Prompt in Windows® to check the startup of In-Sight® by sending a ping.

(1) Click “Start” and select “Run”.

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

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

㩷 㪈㪇
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
㪈䋮㪏 Related manuals
MELSEC-L CPU Unit User’s Manual (Built-in Ethernet Function Edition)
QnUCPU User’s Manual (Built-in Ethernet Port Communication Edition)
Q-compatible Ethernet Interface Unit User’s Manual (Basic Edition)
In-Sight® EasyBuilder Help

㪈䋮㪐 Important
Be sure to read the corresponding User’s Manual before using each product.

㩷 㪈㪈
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
㪉䋮 FB Library Details
㪉䋮㪈 P+Cognex-In-Sight_LogOn (Establish Connection with Vision System)
Name
P+Cognex-In-Sight_LogOn

Description of Function

Item Description
Summary of Function Establishes the connection between the CPU w/ built-in Ethernet port, QJ71E71-100 module
and the In-Sight® Vision System.
Symbol
㪧㪂㪚㫆㪾㫅㪼㫏㪄㪠㫅㪄㪪㫀㪾㪿㫋㪶㪣㫆㪾㪦㫅

㪜㫏㪼㪺㫌㫋㫀㫆㫅㩷㪚㫆㫄㫄㪸㫅㪻 㪙㩷㪑㩷㪝㪙㪶㪜㪥 㪝㪙㪶㪜㪥㪦㩷㪑㩷㪙 㪜㫏㪼㪺㫌㫋㫀㫆㫅㩷㪪㫋㪸㫋㪼

㪥㫆㫉㫄㪸㫃
㪬㫅㫀㫋㩷㪪㫋㪸㫉㫋㩷㪯㪰㩷㪘㪻㪻㫉㪼㫊㫊 㪮㩷㪑㩷㫀㪶㪪㫋㪸㫉㫋㪶㪠㪦㪶㪥㫆 㪝㪙㪶㪦㪢㩷㪑㩷㪙
㪚㫆㫄㫇㫃㪼㫋㫀㫆㫅

㪘㪹㫅㫆㫉㫄㪸㫃
㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷㪥㫆㪅 㪮㩷㪑㩷㫀㪶㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㪶㪥㫆 㪝㪙㪶㪜㪩㪩㪦㪩㩷㪑㩷㪙
㪚㫆㫄㫇㫃㪼㫋㫀㫆㫅

㪫㫀㫄㪼㫆㫌㫋㩷㪭㪸㫃㫌㪼 㪮㩷㪑㩷㫀㪶㪫㫀㫄㪼㪦㫌㫋 㪜㪩㪩㪦㪩㪶㪠㪛㩷㪑㩷㪮 㪜㫉㫉㫆㫉㩷㪚㫆㪻㪼

㪬㫊㪼㫉㩷㪥㪸㫄㪼 㪪㩷㪑㩷㫀㪶㪬㫊㪼㫉㪥㪸㫄㪼

㪧㪸㫊㫊㫎㫆㫉㪻 㪪㩷㪑㩷㫀㪶㪧㪸㫊㫊㫎㫆㫉㪻

Compatible Devices Compatible units CPU w/ built-in Ethernet port, QJ71E71-100 module
Compatible Vision Cognex© In-Sight®
System
Compatible CPU
Series Model
MELSEC-Q Series QCPU w/ built-in Ethernet port*
MELSEC-L Series LCPU
* Serial Nos. with the first 5 digits of “11012” or later.
GX Works2 Q Series CPU: Version 1.09K or later
L Series CPU: Version 1.20W or later
Language Ladder
No. of Steps (Max.) QCPU w/ built-in Ethernet port: 1412
* The number of steps is indicated as a reference for the number of steps in the label program.
For details, refer to GX Works2 Version 1 Operating Manual (Simple Project Edition).
Explanation of With FB_EN (execution command) ON, logs on to In-Sight® from the ethernet unit.
Function

㩷 㪈㪉
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
Item Description
FB Compile Method Macro type
FB Operation Pulse execution type (multiple scans)
I/O Signal Movement [With normal end] [With abnormal end]

㪝㪙㪶㪜㪥 㪝㪙㪶㪜㪥
[Execution [Execution
Command] Command]

㪝㪙㪶㪜㪥㪦
㪝㪙㪶㪜㪥㪦
[Execution
[Execution
Status]
Status]

㪝㪙㪶㪦㪢
㪝㪙㪶㪦㪢
[Normal
[Normal
Completion]
Completion]

㪝㪙㪶㪜㪩㪩㪦㪩
㪝㪙㪶㪜㪩㪩㪦㪩
[Abnormal
[Abnormal
Completion]
Completion]

㪜㪩㪩㪦㪩㪶㪠㪛 䋰㪟
㪜㪩㪩㪦㪩㪶㪠㪛 䋰㪟 㪄㪈㪇㪇㪟
[Error Code]
[Error Code]

Constraints 1. This FB does not include error processing. Error processing can be created separately to
(Cautions)
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 User’s Manual and be sure to complete the settings.
3. Do not implement multiple FBs simultaneously for the same camera; if necessary, execute
multiple FBs sequentially.
Related manuals MELSEC-L CPU Unit User’s Manual (Built-in Ethernet Function Edition)
QnUCPU User’s Manual (Built-in Ethernet Port Communication Edition)
Q-compatible Ethernet Interface Unit User’s Manual (Basic Edition)
In-Sight® EasyBuilder Help

㩷 㪈㪊
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
Error Codes

Ŷ Error Code List


Error Code Description Action
Connection Open failed. Perform the operation again after checking whether
the connection No. for the FB input label is not outside
-102
the acceptable range and whether the connection
destination settings in GX Works2 are correct.
-103 Connection Open failed. The corresponding connection is already open.
A communication error occurred. Invalid data was received. Perform the operation again
-104
after checking the line status and the ladder program.
A communication error occurred. Perform the operation again after checking whether
-105 power has been disconnected to In-Sight® or the
communications cable has been disconnected, etc.
A communication error occurred. Perform the operation again after checking the
following.
1. Are multiple FBs running simultaneously?
-106
2. Is the connection No. for the FB input label outside
the acceptable range, or has an end logon to In-Sight®
command been executed (excluding “LogOn”)?
Logon to In-Sight® failed with the entered Re-confirm the user name and password.
-200
user name and password.
The length of the user name exceeds 15 The user name must be 15 characters or less.
-201
characters.
The length of the password exceeds 15 The password must be 15 characters or less.
-202
characters.

㩷 㪈㪋
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
Labels

Ŷ Input Labels
Name Variable name Data type Valid range Description
Execution command FB_EN Bit --- ON: Run the FB.
OFF: Do not run the FB.
Unit installation XY address i_Start_IO_No Word Depends upon the Use a hexadecimal number to
range of I/O points specify the first XY address
in the set in the corresponding
corresponding Ethernet unit. (For example,
CPU unit. enter “H10” in the case of
For the specific “X10”.)
range, refer to the Enter “H0FFFF” if a CPU with
User’s Manual for built-in Ethernet port is
the corresponding selected.
CPU.
Connection No. i_Connection_No Word 1 to 16 (decimal Specify the connection No. set
number) in the network parameter.
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).
User Name 1,2 i_UserName Text [0 to 9] [a to z] Enter a user name of 15
string [A to Z] characters or less that can log
on to In-Sight®.
If no entry is made, “operator”
is automatically entered.
Password 1,2 i_Password Text [0 to 9] [a to z] Enter a password of 15
string [A to Z] characters or less for the user
name.
If no entry is made, the
password is sent as “No
Password” to In-Sight®.
1: Use ASCII or Shift-JIS characters for the “User name” and “Password” input variables.
2: Passwords can be used in ladder programs to prevent reading of the “User name” and “Password”.
Refer to 3.1 “Using Passwords to Prevent Reading/Writing in Ladder Programs”.

㩷 㪈㪌
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
Ŷ Output labels
Name Variable name Data type Default Description
Execution status FB_ENO Bit OFF ON: The FB is running.
OFF: The FB is not running.
End flag FB_OK Bit OFF ON: The FB ended normally.
OFF: The FB did not end.
Abnormal end flag FB_ERROR Bit OFF ON: Abnormal FB end.
OFF: The FB did not end.
Error Code ERROR_ID Word 0 Returns the error code for the
abnormal result.

Connection Destination Settings

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

FB Version Update History

Version Date Description


1.00A 2009/02/20 Newly created
1.01B 2009/06/01 XY address range check processing change
Connection No. range check processing change

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

㩷 㪈㪍
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
㪉䋮㪉 P+Cognex-In-Sight_LoadJob (Selects, Changes and Activates Jobs)
Name
P+Cognex-In-Sight_LoadJob

Description of Function

Item Description
Summary of Function Selects, changes and activates jobs stored in the In-Sight® Vision System.
Symbol
㪧㪂㪚㫆㪾㫅㪼㫏㪄㪠㫅㪄㪪㫀㪾㪿㫋㪶㪣㫆㪸㪻㪡㫆㪹
㪜㫏㪼㪺㫌㫋㫀㫆㫅
㪜㫏㪼㪺㫌㫋㫀㫆㫅㩷㪚㫆㫄㫄㪸㫅㪻 㪙㩷㪑㩷㪝㪙㪶㪜㪥 㪝㪙㪶㪜㪥㪦㩷㪑㩷㪙
㪪㫋㪸㫋㫌㫊

㪥㫆㫉㫄㪸㫃
㪬㫅㫀㫋㩷㪪㫋㪸㫉㫋㩷㪯㪰㩷㪘㪻㪻㫉㪼㫊㫊 㪮㩷㪑㩷㫀㪶㪪㫋㪸㫉㫋㪶㪠㪦㪶㪥㫆 㪝㪙㪶㪦㪢㩷㪑㩷㪙
㪚㫆㫄㫇㫃㪼㫋㫀㫆㫅

㪘㪹㫅㫆㫉㫄㪸㫃
㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷㪥㫆㪅 㪮㩷㪑㩷㫀㪶㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㪶㪥㫆 㪝㪙㪶㪜㪩㪩㪦㪩㩷㪑㩷㪙
㪚㫆㫄㫇㫃㪼㫋㫀㫆㫅

㪫㫀㫄㪼㫆㫌㫋㩷㪭㪸㫃㫌㪼 㪮㩷㪑㩷㫀㪶㪫㫀㫄㪼㪦㫌㫋 㪜㪩㪩㪦㪩㪶㪠㪛㩷㪑㩷㪮 㪜㫉㫉㫆㫉㩷㪚㫆㪻㪼

㪡㫆㪹㩷㪝㫀㫃㪼㩷㪥㪸㫄㪼 㪪㩷㪑㩷㫀㪶㪡㫆㪹㪝㫀㫃㪼㪥㪸㫄㪼

Compatible Devices Compatible units CPU w/ built-in Ethernet port, QJ71E71-100 module
Compatible Vision Cognex© In-Sight®
System
Compatible CPU
Series Model
MELSEC-Q Series QCPU w/ built-in Ethernet port*
MELSEC-L Series LCPU
* Serial Nos. with the first 5 digits of “11012” or later.
GX Works2 Q Series CPU: Version 1.09K or later
L Series CPU: Version 1.20W or later
Language Ladder
No. of Steps (Max.) QCPU w/ built-in Ethernet port: 1356
* The number of steps is indicated as a reference for the number of steps in the label program.
For details, refer to GX Works2 Version 1 Operating Manual (Simple Project Edition).
Explanation of With FB_EN (Execution Command) ON, selects, changes and activates jobs stored in the
Function In-Sight® Vision System.
FB Compile Method Macro type
FB Operation Pulse execution type (multiple scans)

㩷 㪈㪎
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
Item Description
I/O Signal Movement [With normal end] [With abnormal end]

㪝㪙㪶㪜㪥 㪝㪙㪶㪜㪥
[Execution [Execution
Command] Command]

㪝㪙㪶㪜㪥㪦
㪝㪙㪶㪜㪥㪦
[Execution
[Execution
Status]
Status]

㪝㪙㪶㪦㪢
㪝㪙㪶㪦㪢
[Normal
[Normal
Completion]
Completion]

㪝㪙㪶㪜㪩㪩㪦㪩
㪝㪙㪶㪜㪩㪩㪦㪩
[Abnormal
[Abnormal
Completion]
Completion]

㪜㪩㪩㪦㪩㪶㪠㪛 䋰㪟
㪜㪩㪩㪦㪩㪶㪠㪛 䋰㪟 㪄㪈㪇㪇㪟
[Error Code]
[Error Code]

Constraints 1. This FB does not include error processing. Error processing can be created separately to
(Cautions) match your system and operation requirements.
2. In order to use this FB, it is necessary to use P+Cognex-In-Sight_LogOn and log onto
In-Sight® beforehand.
3. In this FB, there is processing for going offline and online before and after job change
processing.
It is, therefore, not necessary to separately use FBs that execute offline and online
commands.
4. Do not implement multiple FBs simultaneously for the same camera; if necessary, execute
multiple FBs sequentially.
Related manuals MELSEC-L CPU Unit User’s Manual (Built-in Ethernet Function Edition)
QnUCPU User’s Manual (Built-in Ethernet Port Communication Edition)
Q-compatible Ethernet Interface Unit User’s Manual (Basic Edition)
In-Sight® EasyBuilder Help

㩷 㪈㪏
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
Error Codes

Ŷ Error Code List


Error Code Description Action
The specified value is outside the range or Refer to the In-Sight® manual.
-1
is not a valid integer.
-2 The command could not be executed. Refer to the In-Sight® manual.
In-Sight®’s sensor does not have Refer to the In-Sight® manual.
-4
sufficient memory.
-5 The system is not online. Refer to the In-Sight® manual.
The user doesn’t have the necessary Refer to the In-Sight® manual.
-6 access privileges to execute the
command.
A communication error occurred. Perform the operation again after checking whether
-105 power has been disconnected to In-Sight® or the
communications cable has been disconnected, etc.
A communication error occurred. Perform the operation again after checking the
following.
1. Are multiple FBs running simultaneously?
-106
2. Is the connection No. for the FB input label outside
the acceptable range, or has an end logon to In-Sight®
command been executed (excluding “LogOn”)?
The length of the job file name to be Enter a job file name of between 1 and 32 characters,
-300 changed is not between 1 and 32 including the extension.
characters.

㩷 㪈㪐
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
Labels

Ŷ Input Labels
Name Variable name Data type Valid range Description
Execution command FB_EN Bit --- ON: Run the FB.
OFF: Do not run the FB.
Unit installation XY address i_Start_IO_No Word Depends upon the Use a hexadecimal number to
range of I/O points specify the first XY address
in the set in the corresponding
corresponding Ethernet unit. (For example,
CPU unit. enter “H10” in the case of
For the specific “X10”.)
range, refer to the Enter “H0FFFF” if a CPU with
User’s Manual for built-in Ethernet port is
the corresponding selected.
CPU.
Connection No. i_Connection_No Word 1 to 16 (decimal Specifies the connection No.
number) logged onto using
P+Cognex-In-Sight_LogOn.
Timeout value i_TimeOut Word 1 to 32767 Enter the length of the timeout
(decimal number) (in seconds) when
communication with In-Sight®
is broken.
If no entry is made, or a
negative number or “0” is
entered, the value will be
automatically set to “30”
(seconds).
1
Selected job file name i_JobFileName Text [0 to 9] [a to z] Specifies the job file name
string [A to Z] 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 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.

㩷 㪉㪇
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
FB Version Update History

Version Date Description


1.00A 2009/02/20 Newly created
1.01B 2009/06/01 XY address range check processing change
Connection No. range check processing change

Important

This chapter describes the function of the function block.


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

㩷 㪉㪈
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
㪉䋮㪊 P+Cognex-In-Sight_TriggerAcq (Acquisition of Image Assessment Results)
Name
P+Cognex-In-Sight_TriggerAcq

Description of Function

Item Description
Summary of Function After triggering loading of the In-Sight® Vision System images, acquires the result of the image
assessment (pass / no pass).
Symbol
㪧㪂㪚㫆㪾㫅㪼㫏㪄㪠㫅㪄㪪㫀㪾㪿㫋㪶㪫㫉㫀㪾㪾㪼㫉㪘㪺㫈
㪜㫏㪼㪺㫌㫋㫀㫆㫅
㪜㫏㪼㪺㫌㫋㫀㫆㫅㩷㪚㫆㫄㫄㪸㫅㪻 㪙㩷㪑㩷㪝㪙㪶㪜㪥 㪝㪙㪶㪜㪥㪦㩷㪑㩷㪙
㪪㫋㪸㫋㫌㫊

㪜㫏㪼㪺㫌㫋㫀㫆㫅
㪬㫅㫀㫋㩷㪪㫋㪸㫉㫋㩷㪯㪰㩷㪘㪻㪻㫉㪼㫊㫊 㪮㩷㪑㩷㫀㪶㪪㫋㪸㫉㫋㪶㪠㪦㪶㪥㫆 㫆㪶㪩㪼㫊㫌㫃㫋㩷㪑㩷㪮
㪩㪼㫊㫌㫃㫋

㪥㫆㫉㫄㪸㫃
㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷㪥㫆㪅 㪮㩷㪑㩷㫀㪶㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㪶㪥㫆 㪝㪙㪶㪦㪢㩷㪑㩷㪙
㪚㫆㫄㫇㫃㪼㫋㫀㫆㫅

㪘㪹㫅㫆㫉㫄㪸㫃
㪫㫀㫄㪼㫆㫌㫋㩷㪭㪸㫃㫌㪼 㪮㩷㪑㩷㫀㪶㪫㫀㫄㪼㪦㫌㫋 㪝㪙㪶㪜㪩㪩㪦㪩㩷㪑㩷㪙
㪚㫆㫄㫇㫃㪼㫋㫀㫆㫅

㪜㪩㪩㪦㪩㪶㪠㪛㩷㪑㩷㪮 㪜㫉㫉㫆㫉㩷㪚㫆㪻㪼

Compatible Devices Compatible units CPU w/ built-in Ethernet port, QJ71E71-100 module
Compatible Vision Cognex© In-Sight®
System
Compatible CPU
Series Model
MELSEC-Q Series QCPU w/ built-in Ethernet port*
MELSEC-L Series LCPU
* Serial Nos. with the first 5 digits of “11012” or later.
GX Works2 Q Series CPU: Version 1.09K or later
L Series CPU: Version 1.20W or later
Language Ladder
No. of Steps (Max.) QCPU w/ built-in Ethernet port: 1652
* The number of steps is indicated as a reference for the number of steps in the label program.
For details, refer to GX Works2 Version 1 Operating Manual (Simple Project Edition).
Explanation of With FB_EN (execution command) ON, triggers loading of the In-Sight® Vision System images
Function and then acquires the result of the image assessment (pass / no pass).
FB Compile Method Macro type
FB Operation Pulse execution type (multiple scans)

㩷 㪉㪉
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
Item Description
I/O Signal Movement [With normal end] [With abnormal end]

㪝㪙㪶㪜㪥 㪝㪙㪶㪜㪥
[Execution [Execution
Command] Command]

㪝㪙㪶㪜㪥㪦
㪝㪙㪶㪜㪥㪦
[Execution
[Execution
Status]
Status]

㪝㪙㪶㪦㪢
㪝㪙㪶㪦㪢
[Normal
[Normal
Completion]
Completion]

㪝㪙㪶㪜㪩㪩㪦㪩
㪝㪙㪶㪜㪩㪩㪦㪩
[Abnormal
[Abnormal
Completion]
Completion]

㪜㪩㪩㪦㪩㪶㪠㪛 䋰㪟
㪜㪩㪩㪦㪩㪶㪠㪛 䋰㪟 㪄㪈㪇㪇㪟
[Error Code]
[Error Code]

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

Error Codes

Ŷ Error Code List


Error Code Description Action
-2 The command could not be executed. Refer to the In-Sight® manual.
The user doesn’t have the necessary Refer to the In-Sight® manual.
-6 access privileges to execute the
command.
A communication error occurred. Invalid data was received. Perform the operation again
-104
after checking the line status and the ladder program.
A communication error occurred. Perform the operation again after checking whether
-105 power has been disconnected to In-Sight® or the
communications cable has been disconnected, etc.
A communication error occurred. Perform the operation again after checking the
following.
1. Are multiple FBs running simultaneously?
-106
2. Is the connection No. for the FB input label outside
the acceptable range, or has an end logon to In-Sight®
command been executed (excluding “LogOn”)?
㩷 㪉㪊
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
Labels

Ŷ Input Labels
Name Variable name Data type Valid range Description
Execution command FB_EN Bit --- ON: Run the FB.
OFF: Do not run the FB.

Unit installation XY address i_Start_IO_No Word Depends upon the Use a hexadecimal number to
range of I/O points specify the first XY address
in the set in the corresponding
corresponding Ethernet unit. (For example,
CPU unit. enter “H10” in the case of
For the specific “X10”.)
range, refer to the Enter “H0FFFF” if a CPU with
User’s Manual for built-in Ethernet port is
the corresponding selected.
CPU.
Connection No. i_Connection_No Word 1 to 16 (decimal Specifies the connection No.
number) logged onto using
P+Cognex-In-Sight_LogOn.
Timeout value i_TimeOut Word 1 to 32767 Enter the length of the timeout
(decimal number) (in seconds) when
communication with In-Sight®
is broken.
If no entry is made, or a
negative number or “0” is
entered, the value will be
automatically set to “30”
(seconds).

Ŷ Output labels
Name Variable name Data type Default Description
Execution status FB_ENO Bit OFF ON: The FB is running.
OFF: The FB is not running.
Execution result o_Result Word 0 -1: Pass/no pass status
acquisition failure
0: Image assessment result is
no pass
1: Image assessment result is
no pass
End flag FB_OK Bit OFF ON: The FB ended normally.
OFF: The FB did not end.
Abnormal end flag FB_ERROR Bit OFF ON: Abnormal FB end.
OFF: The FB did not end.
Error Code ERROR_ID Word 0 Returns the error code for the
abnormal result.
㩷 㪉㪋
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
FB Version Update History

Version Date Description


1.00A 2009/02/20 Newly created
1.01B 2009/06/01 XY address range check processing change
Connection No. range check processing change

Important

This chapter describes the function of the function block.


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

㩷 㪉㪌
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
㪉䋮㪋 P+Cognex-In-Sight_GetData (Value Acquisition of Symbolic Tags)
FB Definition Name
P+Cognex-In-Sight_GetData

Description of Function

Item Description
Summary of Function Acquires the data held by In-Sight®.
Symbol
㪧㪂㪚㫆㪾㫅㪼㫏㪄㪠㫅㪄㪪㫀㪾㪿㫋㪶㪞㪼㫋㪛㪸㫋㪸
㪜㫏㪼㪺㫌㫋㫀㫆㫅
㪜㫏㪼㪺㫌㫋㫀㫆㫅㩷㪚㫆㫄㫄㪸㫅㪻㩷 㪙㩷㪑㩷㪝㪙㪶㪜㪥 㪝㪙㪶㪜㪥㪦㩷㪑㩷㪙
㪪㫋㪸㫋㫌㫊

㪜㫏㪼㪺㫌㫋㫀㫆㫅
㪬㫅㫀㫋㩷㪪㫋㪸㫉㫋㩷㪯㪰㩷㪘㪻㪻㫉㪼㫊㫊 㪮㩷㪑㩷㫀㪶㪪㫋㪸㫉㫋㪶㪠㪦㪶㪥㫆 㫆㪶㪩㪼㫊㫌㫃㫋㩷㪑㩷㪪
㪩㪼㫊㫌㫃㫋

㪥㫆㫉㫄㪸㫃
㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷㪥㫆㪅 㪮㩷㪑㩷㫀㪶㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㪶㪥㫆 㪝㪙㪶㪦㪢㩷㪑㩷㪙
㪚㫆㫄㫇㫃㪼㫋㫀㫆㫅

㪘㪹㫅㫆㫉㫄㪸㫃
㪫㫀㫄㪼㫆㫌㫋㩷㪭㪸㫃㫌㪼 㪮㩷㪑㩷㫀㪶㪫㫀㫄㪼㪦㫌㫋 㪝㪙㪶㪜㪩㪩㪦㪩㩷㪑㩷㪙
㪚㫆㫄㫇㫃㪼㫋㫀㫆㫅

㪪㫐㫄㪹㫆㫃㫀㪺㩷㪫㪸㪾㪁 㪪㩷㪑㩷㫀㪶㫋㪸㪾 㪜㪩㪩㪦㪩㪶㪠㪛㩷㪑㩷㪮 㪜㫉㫉㫆㫉㩷㪚㫆㪻㪼

㪩㪼㫊㫌㫃㫋㩷㪭㪸㫃㫌㪼㩷㪛㪸㫋㪸㩷㪫㫐㫇㪼 㪮㩷㪑㩷㫀㪶㪩㪼㫊㫌㫃㫋㪶㪫㫐㫇㪼

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

Compatible Devices Compatible units CPU w/ built-in Ethernet port, QJ71E71-100 module
Compatible Vision Cognex© In-Sight®
System
Compatible CPU
Series Model
MELSEC-Q Series QCPU w/ built-in Ethernet port*
MELSEC-L Series LCPU
* Serial Nos. with the first 5 digits of “11012” or later.
GX Works2 Q Series CPU: Version 1.09K or later
L Series CPU: Version 1.20W or later
Language Ladder
No. of Steps (Max.) QCPU w/ built-in Ethernet port: 1512
* The number of steps is indicated as a reference for the number of steps in the label program.
For details, refer to GX Works2 Version 1 Operating Manual (Simple Project Edition).

㩷 㪉㪍
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
Item Description
Explanation of With FB_EN (execution command) ON, sends the symbolic tag set in i_tag to the In-Sight®
Function Vision System, and acquires the value.
FB Compile Method Macro type
FB Operation Pulse execution type (multiple scans)
I/O Signal Movement [With normal end] [With abnormal end]

㪝㪙㪶㪜㪥 㪝㪙㪶㪜㪥
[Execution [Execution
Command] Command]

㪝㪙㪶㪜㪥㪦
㪝㪙㪶㪜㪥㪦
[Execution
[Execution
Status]
Status]

㪝㪙㪶㪦㪢
㪝㪙㪶㪦㪢
[Normal
[Normal
Completion]
Completion]

㪝㪙㪶㪜㪩㪩㪦㪩
㪝㪙㪶㪜㪩㪩㪦㪩
[Abnormal
[Abnormal
Completion]
Completion]

㪜㪩㪩㪦㪩㪶㪠㪛 䋰㪟
㪜㪩㪩㪦㪩㪶㪠㪛 䋰㪟 㪄㪈㪇㪇㪟
[Error Code]
[Error Code]

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

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

㩷 㪉㪎
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
Error Codes

Ŷ Error Code List


Error Code Description Action
The specified value is outside the range or Refer to the In-Sight® manual.
-1
is not a valid integer.
-2 The command could not be executed. Refer to the In-Sight® manual.
The user doesn’t have the necessary Refer to the In-Sight® manual.
-6 access privileges to execute the
command.
A communication error occurred. Invalid data was received. Perform the operation again
-104
after checking the line status and the ladder program.
A communication error occurred. Perform the operation again after checking whether
-105 power has been disconnected to In-Sight® or the
communications cable has been disconnected, etc.
A communication error occurred. Perform the operation again after checking the
following.
1. Are multiple FBs running simultaneously?
-106
2. Is the connection No. for the FB input label outside
the acceptable range, or has an end logon to In-Sight®
command been executed (excluding “LogOn”)?
The length of the symbolic tag name is not Enter a symbolic tag name of between 1 and 32
-301
between 1 and 32 characters. characters.
-305 The set data type is not between 0 and 4. Set the data type to between 0 and 4.

㩷 㪉㪏
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
Labels

Ŷ Input Labels
Name Variable name Data type Valid range Description
Execution command FB_EN Bit --- ON: Run the FB.
OFF: Do not run the FB.
Unit installation XY address i_Start_IO_No Word Depends upon the Use a hexadecimal number
range of I/O points to specify the first XY address
in the corresponding set in the corresponding
CPU unit. Ethernet unit. (For example,
For the specific enter “H10” in the case of
range, refer to the “X10”.)
User’s Manual for Enter “H0FFFF” if a CPU with
the corresponding built-in Ethernet port is
CPU. selected.
Connection No. i_Connection_No Word 1 to 16 (decimal Specifies the connection No.
number) logged onto using
P+Cognex-In-Sight_LogOn.
Timeout value i_TimeOut Word 1 to 32767 (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).
1
Symbolic tag i_tag Text string [0 to 9] [a to z] Sets the transmitted symbolic
[A to Z] tag to between 1 to 32
characters.
2
Data type of the received value i_Result_Type Word 0 to 4 (decimal Specifies the data type of the
number) received value for the
symbolic tag.
0: Text string
1: 16 bit integer (“0” or “1”)
2: 16 bit integer
3: 32 bit integer
4: Single-precision real
number (32 bits)
1: Use ASCII or Shift-JIS characters for the “Symbolic tag” input variable.
2: For the type conversion operation of the received value data type and received data, refer to “3.3 Type Conversion
Processing Combination Table for P+Cognex-In-Sight_GetData”.

㩷 㪉㪐
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
Ŷ Output labels
Name Variable name Data type Default Description
Execution status FB_ENO Bit OFF ON: The FB is running.
OFF: The FB is not running.
Execution result o_Result Text string 0 The result for the sent
16 bit integer symbolic tag will be saved.
32 bit integer For a text string, a maximum
Single- of 255 characters is stored.
precision real
number
End flag FB_OK Bit OFF ON: The FB ended normally.
OFF: The FB did not end.
Abnormal end flag FB_ERROR Bit OFF ON: Abnormal FB end.
OFF: The FB did not end.
Error Code ERROR_ID Word 0 Returns the error code for the
abnormal result.

FB Version Update History

Version Date Description


1.00A 2009/02/20 Newly created
1.01B 2009/06/01 XY address range check processing change
Connection No. range check processing change

Important

This chapter describes the function of the function block.


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

㩷 㪊㪇
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
㪉䋮㪌 P+Cognex-In-Sight_SetData (Value Change of Symbolic Tags)
1. Name
Name
P+Cognex-In-Sight_SetData

Description of Function

Item Description
Summary of Function Changes the data held by In-Sight®.
Symbol
㪧㪂㪚㫆㪾㫅㪼㫏㪄㪠㫅㪄㪪㫀㪾㪿㫋㪶㪪㪼㫋㪛㪸㫋㪸
㪜㫏㪼㪺㫌㫋㫀㫆㫅
㪜㫏㪼㪺㫌㫋㫀㫆㫅㩷㪚㫆㫄㫄㪸㫅㪻 㪙㩷㪑㩷㪝㪙㪶㪜㪥 㪝㪙㪶㪜㪥㪦㩷㪑㩷㪙
㪪㫋㪸㫋㫌㫊

㪜㫏㪼㪺㫌㫋㫀㫆㫅
㪬㫅㫀㫋㩷㪪㫋㪸㫉㫋㩷㪯㪰㩷㪘㪻㪻㫉㪼㫊㫊 㪮㩷㪑㩷㫀㪶㪪㫋㪸㫉㫋㪶㪠㪦㪶㪥㫆 㫆㪶㪩㪼㫊㫌㫃㫋㩷㪑㩷㪮
㪩㪼㫊㫌㫃㫋

㪥㫆㫉㫄㪸㫃
㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷㪥㫆㪅 㪮㩷㪑㩷㫀㪶㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㪶㪥㫆 㪝㪙㪶㪦㪢㩷㪑㩷㪙
㪚㫆㫄㫇㫃㪼㫋㫀㫆㫅

㪘㪹㫅㫆㫉㫄㪸㫃
㪫㫀㫄㪼㫆㫌㫋㩷㪭㪸㫃㫌㪼 㪮㩷㪑㩷㫀㪶㪫㫀㫄㪼㪦㫌㫋 㪝㪙㪶㪜㪩㪩㪦㪩㩷㪑㩷㪙
㪚㫆㫄㫇㫃㪼㫋㫀㫆㫅

㪪㫐㫄㪹㫆㫃㫀㪺㩷㪫㪸㪾㪁 㪪㩷㪑㩷㫀㪶㫋㪸㪾 㪜㪩㪩㪦㪩㪶㪠㪛㩷㪑㩷㪮 㪜㫉㫉㫆㫉㩷㪚㫆㪻㪼

㪪㪼㫋㫋㫀㫅㪾㩷㪭㪸㫃㫌㪼 㪮㩷㪑㩷㫀㪶㫋㪸㪾㪶㪭㪸㫃㫌㪼

㪪㪼㫋㫋㫀㫅㪾㩷㪭㪸㫃㫌㪼㩷㪛㪸㫋㪸㩷㪫㫐㫇㪼 㪮㩷㪑㩷㫀㪶㫋㪸㪾㪶㪛㪸㫋㪸㪶㪫㫐㫇㪼

* When the symbolic tag name is unknown, refer to


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

Compatible Devices Compatible units CPU w/ built-in Ethernet port, QJ71E71-100 module
Compatible Vision Cognex© In-Sight®
System
Compatible CPU
Series Model
MELSEC-Q Series QCPU w/ built-in Ethernet port*
MELSEC-L Series LCPU
* Serial Nos. with the first 5 digits of “11012” or later.
GX Works2 Q Series CPU: Version 1.09K or later
L Series CPU: Version 1.20W or later
Language Ladder

㩷 㪊㪈
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
Item Description
No. of Steps (Max.) QCPU w/ built-in Ethernet port: 2323
* The number of steps is indicated as a reference for the number of steps in the label program.
For details, refer to GX Works2 Version 1 Operating Manual (Simple Project Edition).
Explanation of With FB_EN (execution command) ON, sends a random symbolic tag to the In-Sight® Vision
Function System, and sets the value.
FB Compile Method Macro type
FB Operation Pulse execution type (multiple scans)
I/O Signal Movement [With normal end] [With abnormal end]

㪝㪙㪶㪜㪥 㪝㪙㪶㪜㪥
[Execution [Execution
Command] Command]

㪝㪙㪶㪜㪥㪦
㪝㪙㪶㪜㪥㪦
[Execution
[Execution
Status]
Status]

㪝㪙㪶㪦㪢
㪝㪙㪶㪦㪢
[Normal
[Normal
Completion]
Completion]

㪝㪙㪶㪜㪩㪩㪦㪩
㪝㪙㪶㪜㪩㪩㪦㪩
[Abnormal
[Abnormal
Completion]
Completion]

㪜㪩㪩㪦㪩㪶㪠㪛 䋰㪟
㪜㪩㪩㪦㪩㪶㪠㪛 䋰㪟 㪄㪈㪇㪇㪟
[Error Code]
[Error Code]

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

㩷 㪊㪉
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
Error Codes

Ŷ Error Code List


Error Code Description Action
The specified value is outside the range or Refer to the In-Sight® manual.
-1
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 doesn’t have the necessary Refer to the In-Sight® manual.
-6 access privileges to execute the
command.
A communication error occurred. Invalid data was received. Perform the operation again
-104
after checking the line status and the ladder program.
A communication error occurred. Perform the operation again after checking whether
-105 power has been disconnected to In-Sight® or the
communications cable has been disconnected, etc.
A communication error occurred. Perform the operation again after checking the
following.
1. Are multiple FBs running simultaneously?
-106
2. Is the connection No. for the FB input label outside
the acceptable range, or has an end logon to In-Sight®
command been executed (excluding “LogOn”)?
The length of the symbolic tag name is not Enter a symbolic tag name of between 1 and 32
-301
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
-302
32 characters. characters.
-305 The set data type is not between 0 and 4. Set the data type to between 0 and 4.

㩷 㪊㪊
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
Labels

Ŷ Input Labels
Name Variable name Data type Valid range Description
Execution command FB_EN Bit --- ON: Run the FB.
OFF: Do not run the FB.
Unit installation XY i_Start_IO_No Word Depends upon the Use a hexadecimal number to
address range of I/O points in specify the first XY address set in
the corresponding the corresponding Ethernet unit.
CPU unit. (For example, enter “H10” in the
For the specific case of “X10”.)
range, refer to the Enter “H0FFFF” if a CPU with
User’s Manual for built-in Ethernet port is selected.
the corresponding
CPU.
Connection No. i_Connection_No Word 1 to 16 (decimal Specifies the connection No.
number) logged onto using
P+Cognex-In-Sight_LogOn.
Timeout value i_TimeOut Word 1 to 32767 (decimal Enter the length of the timeout (in
number) seconds) when communication
with In-Sight® is broken.
If no entry is made, or a negative
number or “0” is entered, the
value will be automatically set to
“30” (seconds).
Symbolic tag i_tag Text string [0 to 9] [a to z] Sets the transmitted symbolic tag
[A to Z] to between 1 to 32 characters.
Set value1,2 i_tag_Value Text string --- Sets the value specified in the
16 bit integer data type of the set value.
32 bit integer When saving a text string, enter
Single- between 1 and 32 characters.
precision real
number
Data type of the set i_tag_Data_Type Word 0 to 4 (decimal Specifies the data type of the
value2 number) transmitted value.
0: Text string (1 to 32 characters)
1: 16 bit integer (“0” or “1”)
2: 16 bit integer
3: 32 bit integer
4: Single-precision real number
(32 bits)
1: Use ASCII or Shift-JIS characters for the “Symbolic tag” and “Set value (when the set value data type is a text string)”
input variables.
2: Refer to “3.4 Type Conversion Processing Combination Table for P+Cognex-In-Sight_SetData” for the type conversion
operation of the set value data type and set values.

㩷 㪊㪋
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
Ŷ Output labels
Name Variable name Data type Default Description
Execution status FB_ENO Bit OFF ON: The FB is running.
OFF: The FB is not running.
Execution result o_Result Word 0 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

Version Date Description


1.00A 2009/02/20 Newly created
1.01B 2009/06/01 XY address range check processing change
Connection No. range check processing change

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

㩷 㪊㪌
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
㪉䋮㪍 P+Cognex-In-Sight_GetStatus (Online/Offline Acquisition)
Name
P+Cognex-In-Sight_GetStatus

Description of Function

Item Description
Summary of Function Acquires the current status of the In-Sight® Vision System (online/offline).
Symbol
㪧㪂㪚㫆㪾㫅㪼㫏㪄㪠㫅㪄㪪㫀㪾㪿㫋㪶㪞㪼㫋㪪㫋㪸㫋㫌㫊
㪜㫏㪼㪺㫌㫋㫀㫆㫅
㪜㫏㪼㪺㫌㫋㫀㫆㫅㩷㪚㫆㫄㫄㪸㫅㪻 㪙㩷㪑㩷㪝㪙㪶㪜㪥 㪝㪙㪶㪜㪥㪦㩷㪑㩷㪙
㪪㫋㪸㫋㫌㫊

㪜㫏㪼㪺㫌㫋㫀㫆㫅
㪬㫅㫀㫋㩷㪪㫋㪸㫉㫋㩷㪯㪰㩷㪘㪻㪻㫉㪼㫊㫊 㪮㩷㪑㩷㫀㪶㪪㫋㪸㫉㫋㪶㪠㪦㪶㪥㫆 㫆㪶㪩㪼㫊㫌㫃㫋㩷㪑㩷㪮
㪩㪼㫊㫌㫃㫋

㪥㫆㫉㫄㪸㫃
㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷㪥㫆㪅 㪮㩷㪑㩷㫀㪶㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㪶㪥㫆 㪝㪙㪶㪦㪢㩷㪑㩷㪙
㪚㫆㫄㫇㫃㪼㫋㫀㫆㫅

㪘㪹㫅㫆㫉㫄㪸㫃
㪫㫀㫄㪼㫆㫌㫋㩷㪭㪸㫃㫌㪼 㪮㩷㪑㩷㫀㪶㪫㫀㫄㪼㪦㫌㫋 㪝㪙㪶㪜㪩㪩㪦㪩㩷㪑㩷㪙
㪚㫆㫄㫇㫃㪼㫋㫀㫆㫅

㪜㪩㪩㪦㪩㪶㪠㪛㩷㪑㩷㪮 㪜㫉㫉㫆㫉㩷㪚㫆㪻㪼

Compatible Devices Compatible units CPU w/ built-in Ethernet port, QJ71E71-100 module
Compatible Vision Cognex© In-Sight®
System
Compatible CPU
Series Model
MELSEC-Q Series QCPU w/ built-in Ethernet port*
MELSEC-L Series LCPU
* Serial Nos. with the first 5 digits of “11012” or later.
GX Works2 Q Series CPU: Version 1.09K or later
L Series CPU: Version 1.20W or later
Language Ladder
No. of Steps (Max.) QCPU w/ built-in Ethernet port: 700
* The number of steps is indicated as a reference for the number of steps in the label program.
For details, refer to GX Works2 Version 1 Operating Manual (Simple Project Edition).
Explanation of With FB_EN (execution command) ON, acquires the current status of the In-Sight® Vision
Function System (online/offline).
FB Compile Method Macro type
FB Operation Pulse execution type (multiple scans)

㩷 㪊㪍
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
Item Description
I/O Signal Movement [With normal end] [With abnormal end]

㪝㪙㪶㪜㪥 㪝㪙㪶㪜㪥
[Execution [Execution
Command] Command]

㪝㪙㪶㪜㪥㪦
㪝㪙㪶㪜㪥㪦
[Execution
[Execution
Status]
Status]

㪝㪙㪶㪦㪢
㪝㪙㪶㪦㪢
[Normal
[Normal
Completion]
Completion]

㪝㪙㪶㪜㪩㪩㪦㪩
㪝㪙㪶㪜㪩㪩㪦㪩
[Abnormal
[Abnormal
Completion]
Completion]

㪜㪩㪩㪦㪩㪶㪠㪛 䋰㪟
㪜㪩㪩㪦㪩㪶㪠㪛 䋰㪟 㪄㪈㪇㪇㪟
[Error Code]
[Error Code]

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

Error Codes

Ŷ Error Code List


Error Code Description Action
-2 The command could not be executed. Refer to the In-Sight® manual.
The user doesn’t have the necessary Refer to the In-Sight® manual.
-6 access privileges to execute the
command.
A communication error occurred. Perform the operation again after checking whether
-105 power has been disconnected to In-Sight® or the
communications cable has been disconnected, etc.
A communication error occurred. Perform the operation again after checking the
following.
1. Are multiple FBs running simultaneously?
-106
2. Is the connection No. for the FB input label outside
the acceptable range, or has an end logon to In-Sight®
command been executed (excluding “LogOn”)?

㩷 㪊㪎
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
Labels

Ŷ Input Labels
Name Variable name Data type Valid range Description
Execution command FB_EN Bit --- ON: Run the FB.
OFF: Do not run the FB.
Unit installation XY address i_Start_IO_No Word Depends upon the Use a hexadecimal number to
range of I/O points specify the first XY address
in the set in the corresponding
corresponding Ethernet unit. (For example,
CPU unit. enter “H10” in the case of
For the specific “X10”.)
range, refer to the Enter “H0FFFF” if a CPU with
User’s Manual for built-in Ethernet port is
the corresponding selected.
CPU.
Connection No. i_Connection_No Word 1 to 16 (decimal Specifies the connection No.
number) logged onto using
P+Cognex-In-Sight_LogOn.
Timeout value i_TimeOut Word 1 to 32767 Enter the length of the timeout
(decimal number) (in seconds) when
communication with In-Sight®
is broken.
If no entry is made, or a
negative number or “0” is
entered, the value will be
automatically set to “30”
(seconds).

Ŷ Output labels
Name Variable name Data type Default Description
Execution status FB_ENO Bit OFF ON: The FB is running.
OFF: The FB is not running.
Execution result o_Result Word 0 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 0 Returns the error code for the
abnormal result.

㩷 㪊㪏
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
FB Version Update History

Version Date Description


1.00A 2009/02/20 Newly created
1.01B 2009/06/01 XY address range check processing change
Connection No. range check processing change

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

㩷 㪊㪐
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
㪉䋮㪎 P+Cognex-In-Sight_SetOnline (Puts the In-Sight® Vision System Online)
Name
P+Cognex-In-Sight_SetOnline

Description of Function

Item Description
Summary of Function Puts the In-Sight® Vision System online.
Symbol
㪧㪂㪚㫆㪾㫅㪼㫏㪄㪠㫅㪄㪪㫀㪾㪿㫋㪶㪪㪼㫋㪦㫅㫃㫀㫅㪼
㪜㫏㪼㪺㫌㫋㫀㫆㫅
㪜㫏㪼㪺㫌㫋㫀㫆㫅㩷㪚㫆㫄㫄㪸㫅㪻 㪙㩷㪑㩷㪝㪙㪶㪜㪥 㪝㪙㪶㪜㪥㪦㩷㪑㩷㪙
㪪㫋㪸㫋㫌㫊

㪥㫆㫉㫄㪸㫃
㪬㫅㫀㫋㩷㪪㫋㪸㫉㫋㩷㪯㪰㩷㪘㪻㪻㫉㪼㫊㫊 㪮㩷㪑㩷㫀㪶㪪㫋㪸㫉㫋㪶㪠㪦㪶㪥㫆 㪝㪙㪶㪦㪢㩷㪑㩷㪙
㪚㫆㫄㫇㫃㪼㫋㫀㫆㫅

㪘㪹㫅㫆㫉㫄㪸㫃
㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷㪥㫆㪅 㪮㩷㪑㩷㫀㪶㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㪶㪥㫆 㪝㪙㪶㪜㪩㪩㪦㪩㩷㪑㩷㪙
㪚㫆㫄㫇㫃㪼㫋㫀㫆㫅

㪫㫀㫄㪼㫆㫌㫋㩷㪭㪸㫃㫌㪼 㪮㩷㪑㩷㫀㪶㪫㫀㫄㪼㪦㫌㫋 㪜㪩㪩㪦㪩㪶㪠㪛㩷㪑㩷㪮 㪜㫉㫉㫆㫉㩷㪚㫆㪻㪼

Compatible Devices Compatible units CPU w/ built-in Ethernet port, QJ71E71-100 module
Compatible Vision Cognex© In-Sight®
System
Compatible CPU
Series Model
MELSEC-Q Series QCPU w/ built-in Ethernet port*
MELSEC-L Series LCPU
* Serial Nos. with the first 5 digits of “11012” or later.
GX Works2 Q Series CPU: Version 1.09K or later
L Series CPU: Version 1.20W or later
Language Ladder
No. of Steps (Max.) QCPU w/ built-in Ethernet port: 697
* The number of steps is indicated as a reference for the number of steps in the label program.
For details, refer to GX Works2 Version 1 Operating Manual (Simple Project Edition).
Explanation of With FB_EN (execution command) ON, puts the In-Sight® Vision System online.
Function
FB Compile Method Macro type
FB Operation Pulse execution type (multiple scans)

㩷 㪋㪇
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
Item Description
I/O Signal Movement [With normal end] [With abnormal end]

㪝㪙㪶㪜㪥 㪝㪙㪶㪜㪥
[Execution [Execution
Command] Command]

㪝㪙㪶㪜㪥㪦
㪝㪙㪶㪜㪥㪦
[Execution
[Execution
Status]
Status]

㪝㪙㪶㪦㪢
㪝㪙㪶㪦㪢
[Normal
[Normal
Completion]
Completion]

㪝㪙㪶㪜㪩㪩㪦㪩
㪝㪙㪶㪜㪩㪩㪦㪩
[Abnormal
[Abnormal
Completion]
Completion]

㪜㪩㪩㪦㪩㪶㪠㪛 䋰㪟
㪜㪩㪩㪦㪩㪶㪠㪛 䋰㪟 㪄㪈㪇㪇㪟
[Error Code]
[Error Code]

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

Error Codes

Ŷ Error Code List


Error Code Description Action
-2 The command could not be executed. Refer to the In-Sight® manual.
-5 The system is not online. Refer to the In-Sight® manual.
The user doesn’t have the necessary Refer to the In-Sight® manual.
-6 access privileges to execute the
command.
A communication error occurred. Perform the operation again after checking whether
-105 power has been disconnected to In-Sight® or the
communications cable has been disconnected, etc.
A communication error occurred. Perform the operation again after checking the
following.
1. Are multiple FBs running simultaneously?
-106
2. Is the connection No. for the FB input label outside
the acceptable range, or has an end logon to In-Sight®
command been executed (excluding “LogOn”)?

㩷 㪋㪈
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
Labels

Ŷ Input Labels
Name Variable name Data type Valid range Description
Execution command FB_EN Bit --- ON: Run the FB.
OFF: Do not run the FB.
Unit installation XY address i_Start_IO_No Word Depends upon the Use a hexadecimal number to
range of I/O points specify the first XY address
in the set in the corresponding
corresponding Ethernet unit. (For example,
CPU unit. enter “H10” in the case of
For the specific “X10”.)
range, refer to the Enter “H0FFFF” if a CPU with
User’s Manual for built-in Ethernet port is
the corresponding selected.
CPU.
Connection No. i_Connection_No Word 1 to 16 (decimal Specifies the connection No.
number) logged onto using
P+Cognex-In-Sight_LogOn.
Timeout value i_TimeOut Word 1 to 32767 Enter the length of the timeout
(decimal number) (in seconds) when
communication with In-Sight®
is broken.
If no entry is made, or a
negative number or “0” is
entered, the value will be
automatically set to “30”
(seconds).

Ŷ Output labels
Name Variable name Data type Default Description
Execution status FB_ENO Bit OFF ON: The FB is running.
OFF: The FB is not running.
End flag FB_OK Bit OFF ON: The FB ended normally.
OFF: The FB did not end.
Abnormal end flag FB_ERROR Bit OFF ON: Abnormal FB end.
OFF: The FB did not end.
Error Code ERROR_ID Word 0 Returns the error code.

㩷 㪋㪉
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
FB Version Update History

Version Date Description


1.00A 2009/02/20 Newly created
1.01B 2009/06/01 XY address range check processing change
Connection No. range check processing change

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

㩷 㪋㪊
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
㪉䋮㪏 P+Cognex-In-Sight_SetOffline (Takes the In-Sight® Vision System Offline)
Name
P+Cognex-In-Sight_SetOffline

Description of Function

Item Description
Summary of Function Takes the In-Sight® Vision System offline.
Symbol
㪧㪂㪚㫆㪾㫅㪼㫏㪄㪠㫅㪄㪪㫀㪾㪿㫋㪶㪪㪼㫋㪦㪽㪽㫃㫀㫅㪼
㪜㫏㪼㪺㫌㫋㫀㫆㫅
㪜㫏㪼㪺㫌㫋㫀㫆㫅㩷㪚㫆㫄㫄㪸㫅㪻 㪙㩷㪑㩷㪝㪙㪶㪜㪥 㪝㪙㪶㪜㪥㪦㩷㪑㩷㪙
㪪㫋㪸㫋㫌㫊

㪥㫆㫉㫄㪸㫃
㪬㫅㫀㫋㩷㪪㫋㪸㫉㫋㩷㪯㪰㩷㪘㪻㪻㫉㪼㫊㫊 㪮㩷㪑㩷㫀㪶㪪㫋㪸㫉㫋㪶㪠㪦㪶㪥㫆 㪝㪙㪶㪦㪢㩷㪑㩷㪙
㪚㫆㫄㫇㫃㪼㫋㫀㫆㫅

㪘㪹㫅㫆㫉㫄㪸㫃
㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷㪥㫆㪅 㪮㩷㪑㩷㫀㪶㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㪶㪥㫆 㪝㪙㪶㪜㪩㪩㪦㪩㩷㪑㩷㪙
㪚㫆㫄㫇㫃㪼㫋㫀㫆㫅

㪫㫀㫄㪼㫆㫌㫋㩷㪭㪸㫃㫌㪼 㪮㩷㪑㩷㫀㪶㪫㫀㫄㪼㪦㫌㫋 㪜㪩㪩㪦㪩㪶㪠㪛㩷㪑㩷㪮 㪜㫉㫉㫆㫉㩷㪚㫆㪻㪼

Compatible Devices Compatible units CPU w/ built-in Ethernet port, QJ71E71-100 module
Compatible Vision Cognex© In-Sight®
System
Compatible CPU
Series Model
MELSEC-Q Series QCPU w/ built-in Ethernet port*
MELSEC-L Series LCPU
* Serial Nos. with the first 5 digits of “11012” or later.
GX Works2 Q Series CPU: Version 1.09K or later
L Series CPU: Version 1.20W or later
Language Ladder
No. of Steps (Max.) QCPU w/ built-in Ethernet port: 688
* The number of steps is indicated as a reference for the number of steps in the label program.
For details, refer to GX Works2 Version 1 Operating Manual (Simple Project Edition).
Explanation of With FB_EN (execution command) ON, takes the In-Sight® Vision System offline.
Function
FB Compile Method Macro type
FB Operation Pulse execution type (multiple scans)

㩷 㪋㪋
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
Item Description
I/O Signal Movement [With normal end] [With abnormal end]

㪝㪙㪶㪜㪥 㪝㪙㪶㪜㪥
[Execution [Execution
Command] Command]

㪝㪙㪶㪜㪥㪦
㪝㪙㪶㪜㪥㪦
[Execution
[Execution
Status]
Status]

㪝㪙㪶㪦㪢
㪝㪙㪶㪦㪢
[Normal
[Normal
Completion]
Completion]

㪝㪙㪶㪜㪩㪩㪦㪩
㪝㪙㪶㪜㪩㪩㪦㪩
[Abnormal
[Abnormal
Completion]
Completion]

㪜㪩㪩㪦㪩㪶㪠㪛 䋰㪟
㪜㪩㪩㪦㪩㪶㪠㪛 䋰㪟 㪄㪈㪇㪇㪟
[Error Code]
[Error Code]

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

Error Codes

Ŷ Error Code List


Error Code Description Action
-2 The command could not be executed. Refer to the In-Sight® manual.
The user doesn’t have the necessary Refer to the In-Sight® manual.
-6 access privileges to execute the
command.
A communication error occurred. Perform the operation again after checking whether
-105 power has been disconnected to In-Sight® or the
communications cable has been disconnected, etc.
A communication error occurred. Perform the operation again after checking the
following.
1. Are multiple FBs running simultaneously?
-106
2. Is the connection No. for the FB input label outside
the acceptable range, or has an end logon to In-Sight®
command been executed (excluding “LogOn”)?

㩷 㪋㪌
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
Labels

Ŷ Input Labels
Name Variable name Data type Valid range Description
Execution command FB_EN Bit --- ON: Run the FB.
OFF: Do not run the FB.
Unit installation XY address i_Start_IO_No Word Depends upon the Use a hexadecimal number to
range of I/O points specify the first XY address
in the set in the corresponding
corresponding Ethernet unit. (For example,
CPU unit. enter “H10” in the case of
For the specific “X10”.)
range, refer to the Enter “H0FFFF” if a CPU with
User’s Manual for built-in Ethernet port is
the corresponding selected.
CPU.
Connection No. i_Connection_No Word 1 to 16 (decimal Specifies the connection No.
number) logged onto using
P+Cognex-In-Sight_LogOn.
Timeout value i_TimeOut Word 1 to 32767 Enter the length of the timeout
(decimal number) (in seconds) when
communication with In-Sight®
is broken.
If no entry is made, or a
negative number or “0” is
entered, the value will be
automatically set to “30”
(seconds).

Ŷ Output labels
Name Variable name Data type Default Description
Execution status FB_ENO Bit OFF ON: The FB is running.
OFF: The FB is not running.
End flag FB_OK Bit OFF ON: The FB ended normally.
OFF: The FB did not end.
Abnormal end flag FB_ERROR Bit OFF ON: Abnormal FB end.
OFF: The FB did not end.
Error Code ERROR_ID Word 0 Returns the error code.

㩷 㪋㪍
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
FB Version Update History

Version Date Description


1.00A 2009/02/20 Newly created
1.01B 2009/06/01 XY address range check processing change
Connection No. range check processing change

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

㩷 㪋㪎
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
㪉䋮㪐 P+Cognex-In-Sight_SaveJob (Save the Operation Job in Flash Memory)
Name
P+Cognex-In-Sight_SaveJob

Description of Function

Item Description
Summary of Function Saves the current job to the In-Sight® Vision System’s flash memory.
Symbol
㪧㪂㪚㫆㪾㫅㪼㫏㪄㪠㫅㪄㪪㫀㪾㪿㫋㪶㪪㪸㫍㪼㪡㫆㪹
㪜㫏㪼㪺㫌㫋㫀㫆㫅
㪜㫏㪼㪺㫌㫋㫀㫆㫅㩷㪚㫆㫄㫄㪸㫅㪻 㪙㩷㪑㩷㪝㪙㪶㪜㪥 㪝㪙㪶㪜㪥㪦㩷㪑㩷㪙
㪪㫋㪸㫋㫌㫊

㪥㫆㫉㫄㪸㫃
㪬㫅㫀㫋㩷㪪㫋㪸㫉㫋㩷㪯㪰㩷㪘㪻㪻㫉㪼㫊㫊 㪮㩷㪑㩷㫀㪶㪪㫋㪸㫉㫋㪶㪠㪦㪶㪥㫆 㪝㪙㪶㪦㪢㩷㪑㩷㪙
㪚㫆㫄㫇㫃㪼㫋㫀㫆㫅

㪘㪹㫅㫆㫉㫄㪸㫃
㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷㪥㫆㪅 㪮㩷㪑㩷㫀㪶㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㪶㪥㫆 㪝㪙㪶㪜㪩㪩㪦㪩㩷㪑㩷㪙
㪚㫆㫄㫇㫃㪼㫋㫀㫆㫅

㪫㫀㫄㪼㫆㫌㫋㩷㪭㪸㫃㫌㪼 㪮㩷㪑㩷㫀㪶㪫㫀㫄㪼㪦㫌㫋 㪜㪩㪩㪦㪩㪶㪠㪛㩷㪑㩷㪮 㪜㫉㫉㫆㫉㩷㪚㫆㪻㪼

㪡㫆㪹㩷㪝㫀㫃㪼㫅㪸㫄㪼 㪪㩷㪑㩷㫀㪶㪡㫆㪹㪝㫀㫃㪼㪥㪸㫄㪼

Compatible Devices Compatible units CPU w/ built-in Ethernet port, QJ71E71-100 module
Compatible Vision Cognex© In-Sight®
System
Compatible CPU
Series Model
MELSEC-Q Series QCPU w/ built-in Ethernet port*
MELSEC-L Series LCPU
* Serial Nos. with the first 5 digits of “11012” or later.
GX Works2 Q Series CPU: Version 1.09K or later
L Series CPU: Version 1.20W or later
Language Ladder
No. of Steps (Max.) QCPU w/ built-in Ethernet port: 1351
* The number of steps is indicated as a reference for the number of steps in the label program.
For details, refer to GX Works2 Version 1 Operating Manual (Simple Project Edition).
Explanation of With FB_EN (execution command) ON, saves the current job to the In-Sight® Vision System’s
Function flash memory.
FB Compile Method Macro type
FB Operation Pulse execution type (multiple scans)

㩷 㪋㪏
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
Item Description
I/O Signal Movement [With normal end] [With abnormal end]

㪝㪙㪶㪜㪥 㪝㪙㪶㪜㪥
[Execution [Execution
Command] Command]

㪝㪙㪶㪜㪥㪦
㪝㪙㪶㪜㪥㪦
[Execution
[Execution
Status]
Status]

㪝㪙㪶㪦㪢
㪝㪙㪶㪦㪢
[Normal
[Normal
Completion]
Completion]

㪝㪙㪶㪜㪩㪩㪦㪩
㪝㪙㪶㪜㪩㪩㪦㪩
[Abnormal
[Abnormal
Completion]
Completion]

㪜㪩㪩㪦㪩㪶㪠㪛 䋰㪟
㪜㪩㪩㪦㪩㪶㪠㪛 䋰㪟 㪄㪈㪇㪇㪟
[Error Code]
[Error Code]

Constraints 1. This FB does not include error processing. Error processing can be created separately to
(Cautions) match your system and operation requirements.
2. In order to use this FB, it is necessary to use P+Cognex-In-Sight_LogOn and log onto
In-Sight® beforehand.
3. In this FB, there is processing for going offline and online before and after save processing.
It is, therefore, not necessary to separately use FBs that execute offline and online
commands.
4. Do not implement multiple FBs simultaneously for the same camera; if necessary, execute
multiple FBs sequentially.
Related manuals MELSEC-L CPU Unit User’s Manual (Built-in Ethernet Function Edition)
QnUCPU User’s Manual (Built-in Ethernet Port Communication Edition)
Q-compatible Ethernet Interface Unit User’s Manual (Basic Edition)
In-Sight® EasyBuilder Help

㩷 㪋㪐
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
Error Codes

Ŷ Error Code List


Error Code Description Action
The command could not be executed Refer to the In-Sight® manual.
-2 because saving the job failed, In-Sight®
was online, or the file was not found.
-5 The system is not online. Refer to the In-Sight® manual.
The user doesn’t have the necessary Refer to the In-Sight® manual.
-6 access privileges to execute the
command.
A communication error occurred. Perform the operation again after checking whether
-105 power has been disconnected to In-Sight® or the
communications cable has been disconnected, etc.
A communication error occurred. Perform the operation again after checking the
following.
1. Are multiple FBs running simultaneously?
-106
2. Is the connection No. for the FB input label outside
the acceptable range, or has an end logon to In-Sight®
command been executed (excluding “LogOn”)?
The length of the job file name to be saved Enter a job file name of between 1 and 32 characters,
-303
is not between 1 and 32 characters. including the extension.

㩷 㪌㪇
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
Labels

Ŷ Input Labels
Name Variable name Data type Valid range Description
Execution command FB_EN Bit --- ON: Run the FB.
OFF: Do not run the FB.
Unit installation XY address i_Start_IO_No Word Depends upon the Use a hexadecimal number to
range of I/O points specify the first XY address
in the set in the corresponding
corresponding Ethernet unit. (For example,
CPU unit. enter “H10” in the case of
For the specific “X10”.)
range, refer to the Enter “H0FFFF” if a CPU with
User’s Manual for built-in Ethernet port is
the corresponding selected.
CPU.
Connection No. i_Connection_No Word 1 to 16 (decimal Specifies the connection No.
number) logged onto using
P+Cognex-In-Sight_LogOn.
Timeout value i_TimeOut Word 1 to 32767 Enter the length of the timeout
(decimal number) (in seconds) when
communication with In-Sight®
is broken.
If no entry is made, or a
negative number or “0” is
entered, the value will be
automatically set to “30”
(seconds).
1
Save job file name i_JobFileName Text [0 to 9] [a to z] Specifies a job file name to be
string [A to Z] 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 0 Returns the error code.

㩷 㪌㪈
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
FB Version Update History

Version Date Description


1.00A 2009/02/20 Newly created
1.01B 2009/06/01 XY address range check processing change
Connection No. range check processing change

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

㩷 㪌㪉
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
㪉䋮㪈㪇 P+Cognex-In-Sight_SendCmd (Native Command Send)
Name
P+Cognex-In-Sight_SendCmd

Description of Function

Item Description
Summary of Function Sends the selected native command and receives the results.
Symbol
㪧㪂㪚㫆㪾㫅㪼㫏㪄㪠㫅㪄㪪㫀㪾㪿㫋㪶㪪㪼㫅㪻㪚㫄㪻
㪜㫏㪼㪺㫌㫋㫀㫆㫅
㪜㫏㪼㪺㫌㫋㫀㫆㫅㩷㪚㫆㫄㫄㪸㫅㪻 㪙㩷㪑㩷㪝㪙㪶㪜㪥 㪝㪙㪶㪜㪥㪦㩷㪑㩷㪙
㪪㫋㪸㫋㫌㫊

㪜㫏㪼㪺㫌㫋㫀㫆㫅
㪬㫅㫀㫋㩷㪪㫋㪸㫉㫋㩷㪯㪰㩷㪘㪻㪻㫉㪼㫊㫊 㪮㩷㪑㩷㫀㪶㪪㫋㪸㫉㫋㪶㪠㪦㪶㪥㫆 㫆㪶㪩㪼㫊㫌㫃㫋㩷㪑㩷㪮
㪩㪼㫊㫌㫃㫋

㪥㫆㫉㫄㪸㫃
㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷㪥㫆㪅 㪮㩷㪑㩷㫀㪶㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㪶㪥㫆 㪝㪙㪶㪦㪢㩷㪑㩷㪙
㪚㫆㫄㫇㫃㪼㫋㫀㫆㫅

㪘㪹㫅㫆㫉㫄㪸㫃
㪫㫀㫄㪼㫆㫌㫋㩷㪭㪸㫃㫌㪼 㪮㩷㪑㩷㫀㪶㪫㫀㫄㪼㪦㫌㫋 㪝㪙㪶㪜㪩㪩㪦㪩㩷㪑㩷㪙
㪚㫆㫄㫇㫃㪼㫋㫀㫆㫅

㪥㪸㫋㫀㫍㪼㩷㪚㫆㫄㫄㪸㫅㪻㪁 㪪㩷㪑㩷㫀㪶㪥㪸㫋㫀㫍㪼㪶㪚㫆㫄㫄㪸㫅㪻 㪜㪩㪩㪦㪩㪶㪠㪛㩷㪑㩷㪮 㪜㫉㫉㫆㫉㩷㪚㫆㪻㪼

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

Compatible Devices Compatible units CPU w/ built-in Ethernet port, QJ71E71-100 module
Compatible Vision System Cognex© In-Sight®
Compatible CPU
Series Model
MELSEC-Q Series QCPU w/ built-in Ethernet port*
MELSEC-L Series LCPU
* Serial Nos. with the first 5 digits of “11012” or later.
GX Works2 Q Series CPU: Version 1.09K or later
L Series CPU: Version 1.20W or later
Language Ladder
No. of Steps (Max.) QCPU w/ built-in Ethernet port: 778
* The number of steps is indicated as a reference for the number of steps in the label program.
For details, refer to GX Works2 Version 1 Operating Manual (Simple Project Edition).
Explanation of With FB_EN (execution command) ON, sends and receives a random native command.
Function
FB Compile Method Macro type
FB Operation Pulse execution type (multiple scans)

㩷 㪌㪊
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
Item Description
I/O Signal Movement [With normal end] [With abnormal end]

㪝㪙㪶㪜㪥 㪝㪙㪶㪜㪥
[Execution [Execution
Command] Command]

㪝㪙㪶㪜㪥㪦
㪝㪙㪶㪜㪥㪦
[Execution
[Execution
Status]
Status]

㪝㪙㪶㪦㪢
㪝㪙㪶㪦㪢
[Normal
[Normal
Completion]
Completion]

㪝㪙㪶㪜㪩㪩㪦㪩
㪝㪙㪶㪜㪩㪩㪦㪩
[Abnormal
[Abnormal
Completion]
Completion]

㪜㪩㪩㪦㪩㪶㪠㪛 䋰㪟
㪜㪩㪩㪦㪩㪶㪠㪛 䋰㪟 㪄㪈㪇㪇㪟
[Error Code]
[Error Code]

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

㩷 㪌㪋
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
Error Codes

Ŷ Error Code List


Error Code Description Action
0 An unrecognizable command was sent. Refer to the In-Sight® manual.
The specified value is outside the range or Refer to the In-Sight® manual.
-1
is not a valid integer.
-2 The command could not be executed. Refer to the In-Sight® manual.
In-Sight®’s sensor does not have Refer to the In-Sight® manual.
-4
sufficient memory.
-5 The system is not online. Refer to the In-Sight® manual.
The user doesn’t have the necessary Refer to the In-Sight® manual.
-6 access privileges to execute the
command.
A communication error occurred. Perform the operation again after checking whether
-105 power has been disconnected to In-Sight® or the
communications cable has been disconnected, etc.
A communication error occurred. Perform the operation again after checking the
following.
1. Are multiple FBs running simultaneously?
-106
2. Is the connection No. for the FB input label outside
the acceptable range, or has an end logon to In-Sight®
command been executed (excluding “LogOn”)?
The length of the native command to be Set the native command to be sent to between 1 and
-304
sent is not between 1 and 199 characters. 199 characters.

㩷 㪌㪌
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
Labels

Ŷ Input Labels
Name Variable name Data Valid range Description
type
Execution command FB_EN Bit --- ON: Run the FB.
OFF: Do not run the FB.
Unit installation XY address i_Start_IO_No Word Depends upon the Use a hexadecimal number to
range of I/O points specify the first XY address set in
in the the corresponding Ethernet unit.
corresponding (For example, enter “H10” in the
CPU unit. case of “X10”.)
For the specific Enter “H0FFFF” if a CPU with
range, refer to the built-in Ethernet port is selected.
User’s Manual for
the corresponding
CPU.
Connection No. i_Connection_No Word 1 to 16 (decimal Specifies the connection No.
number) logged onto using
P+Cognex-In-Sight_LogOn.
Timeout value i_TimeOut Word 1 to 32767 Enter the length of the timeout (in
(decimal number) 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 [0 to 9] [a to z] Enter an arbitrary native
string [A to Z] 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 “” The result of the sent arbitrary
string 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.

㩷 㪌㪍
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
FB Version Update History

Version Date Description


1.00A 2009/02/20 Newly created
1.01B 2009/06/01 XY address range check processing change
Connection No. range check processing change

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

㩷 㪌㪎
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
㪊䋮 Appendix
㪊䋮㪈 Using Passwords to Prevent Reading/Writing in Ladder Programs

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

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

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

㩷 㪌㪏
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
(3) Set “Read/Write Protection” in “Registration Condition” and, after the password is set, click the “OK” button.

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

㩷 㪌㪐
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
(5) Whether or not the password is set can be confirmed by the “Disable password” prompt displayed during the “Read
from PLC” operation after the completion of password registration.

㩷 㪍㪇
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
㪊䋮㪉 Finding Out which Symbolic Tags can be Used with an FB

“Communication” for the application step in In-Sight® EasyBuilder.


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

㩷 㪍㪈
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
㪊䋮㪊 Type Conversion Processing Combination Table for P+Cognex-In-Sight_GetData

P+Cognex-In-Sight_GetData converts and outputs the value received from In-Sight® in accordance with the specified
received value data type (i_Result_Type).
Whether or not settings are possible for the received value data type and the value received from In-Sight® is shown below
along with the operation for the set values.

Type of Tag Numerical Value


Numerical Value Numerical Value Range Numerical Value
Text String Numerical Value Range
Data Type of Range - Range
-32768̚32767
Received Value "0" or "1" 2.147e+009̚2.147e+009 Other Ranges
Data Type of the Received Value
ż ż ż ż
Not Entered ż
Operation 2 Operation 2 Operation 2 Operation 2
Text String (Enter KO)
ż ż ż ż
16 bit integer [0 or 1](Enter K1) ż
Operation 1 Operation 1 Operation 1 Operation 1
× ż × ×
16 bit integer (Enter K2) ż
Error 1*1. Operation 3 Error 1*1. Error 1*1.
× ż ż ×
32 bit integer (Enter K3) ż
Error 1*1. Operation 4 Operation 4 Error 1*1.
Single-precision Real Number × ż ż ż
ż
[32 bit](Enter K4) Error 1*1. Operation 5 Operation 5 Operation 5

ż: Setting Possible Error 1: CPU operation error occurred due to a value conversion failure
X: Setting not possible Operation 1: When the received value is "0", 0 is output When it is not "0", 1 is output
Operation 2: The numerical value is output as a text string
Operation 3: A 16 bit integer is output (Rounded off to one digit after the decimal point)
Operation 4: A 32 bit integer is output (Rounded off to one digit after the decimal point)
Operation 5: A single-precision real number (32 bits) is output

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

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

P+Cognex-In-Sight_SetData converts the set value (i_tag_Value) to text string based on set value data type
(i_tag_Data_Type) and sends the set value to In-Sight®.
Whether or not settings corresponding to the set value data type and the set value are possible and operation for the set
values are shown below.

Setting Value 16 bit integer (1 word) Single-precision Real


Text String 32 bit integer (2 words)
0 or 1 -32768ǂ̚ǂ32767 Number
Data Type of Direct Indirect Direct Indirect Direct Indirect Direct Indirect Direct Indirect
Received Value Input Input Input Input Input Input Input Input Input Input
Data Type of the Received Value
× × × × × ×
Not Entered - ż - -
Error 3*1. Error 3*1. Error 2/3/6 Error 2/3/6 Error 2/3/6 Error 2/3/6
Text String (Enter KO)
ż
ż ż × ×
16 bit integer [0 or 1](Enter K1) - Operation ż ż - -
Operation 1 Operation 1 Error 7*1. Error 7*1.
1
× × ×
16 bit integer (Enter K2) - ż ż ż ż - -
Error 3*1. Error 4*1. Error 4*1.
× × × × × ×
32 bit integer (Enter K3) - - ż -
Error 2/3 Error 2/3 Error 2/3 Error 2/3 Error 2/3 Error 5*1.
× × ×
Single-precision Real Number × × ×
- Error Error Error - - ż
[32 bit](Enter K4) Error 1/3*1. Error 1/3*1. Error 1*1.
1/3*1. 1/3*1. 1/3*1.

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

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

㩷 㪍㪉
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
㪊䋮㪌 Usable Native Commands That Can Be Sent With P+Cognex-In-Sight_SendCmd

Native commands that can be sent by this program are shown below.
No. Native Command Name Description
1 LF Loads the specified job from In-Sight®’s flash memory and makes it the active job.
2 TF Saves the current job into In-Sight®’s flash memory.
3 RF Reads the job from the specified In-Sight® flash memory.
4 WF Sends the job to In-Sight®’s flash memory.
5 DF Deletes the specified job or cell data (.CXD) file from In-Sight®’s flash memory.
6 GF Returns the file name of the job currently active in In-Sight®.
7 SJ Loads the job from one of the job slots within In-Sight®’s flash memory and makes it
the active job.
8 TJ Saves the current job in the job slot specified within In-Sight®’s flash memory.
9 RJ Reads the job from the specified In-Sight® job slot.
10 WJ Sends the job to the In-Sight® job slot specified within In-Sight®’s flash memory.
11 DJ Deletes the job from the slot specified within In-Sight®’s flash memory.
12 GJ Returns the ID of the job currently active in In-Sight®.
13 RB Sends the current image from In-Sight® to a remote device in ASCII hexadecimal
format (80 characters/line).
14 RI Sends the current image from In-Sight® to a remote device in ASCII hexadecimal
format (80 characters/line).
15 WB Sends image data from a remote device to In-Sight®.
16 WI Sends image data from a remote device to In-Sight®.
17 GV Returns the value included in the specified cell.
18 SI Sets the control included in the cell to the specified integer value.
19 SF Sets the edit box control included in the cell to the specified floating point number
value.
20 SS Sets the edit box control included in the cell to the specified text string.
21 GI Returns In-Sight® sensor information.
22 RS Reads In-Sight® system setting data.
23 WS Sends system setting data from a remote device to In-Sight®.
24 TS Saves In-Sight®’s settings to the proc.set file.
25 SL Prevents unauthorized changes to In-Sight®’s IP address.
26 GL Returns the security status of In-Sight®’s IP address.
27 SO Sets In-Sight® to the online or offline mode.
28 GO Returns In-Sight® online.
29 SE Triggers the specified event.
30 SW Triggers the specified event and returns the response after completion of the
command.
31 RT Resets In-Sight®. This command is the same as physically turning on the power again.
32 SM Sends the text string to In-Sight®’s spreadsheet via the native mode connection.
33 Get Connections Returns the current connection information for In-Sight®.
34 Get Expr Returns the parameter or value included in the cell specified by the row and line
address, as well as the state of that cell.
35 Get Filelist Returns the number of files and each file name stored in In-Sight®’s memory.
36 Put Live Turns the live load mode ON or OFF.
37 Put Portnum Specifies the port In-Sight® uses for data or image forwarding via the network.
38 Put Timeout Specifies the amount of time (milliseconds) to maintain the port connection from the
client when sending or receiving is not being carried out.
39 Put Update Refreshes the GUI (spreadsheet, image display, and cell graphics).
40 Put Watch Returns the value included in the specified cell when the cell is refreshed.
41 Put XML Specifies whether or not to format the output result of the native mode command with
XML.

㩷 㪍㪊
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
The native commands that can be sent by this program following the native command “Put XML” are shown below.
No. 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 Returns the “Turn off the output power when offline” setting specified by the “Discrete
GetDeEnergizeOutputs 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 Changes the “Turn off output power when offline” setting of the “Discrete output
SetDeEnergizeOutputs 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-Sight®EtherNet/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.

㩷 㪍㪋
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
㪋䋮 Example of Using the FB Library
㪋䋮㪈 Example of Operating In-Sight® With Sequencer
The following is an example of operating In-Sight® using a CPU with built-in Ethernet.
Select and use jobs stored in In-Sight®.

(1) System configuration


㪨㪇㪍㪬㪛㪜㪟㪚㪧㪬㩷

㪨㩷㪪㪼㫉㫀㪼㫊㩷㪪㪼㫈㫌㪼㫅㪺㪼㫉㩷

㩷 㪞㪯㩷㪮㫆㫉㫂㫊㪉㩷
㪧㫆㫎㪼㫉㩷 㩷 㪜㪸㫊㫐㪙㫌㫀㫃㪻㪼㫉㩷
㪬㫅㫀㫋㩷

㪮㫀㫅㪻㫆㫎㫊㫤㩷
㪧㪼㫉㫊㫆㫅㪸㫃㩷㪺㫆㫄㫇㫌㫋㪼㫉㩷 㩷 㩷 㪁㪊㩷

㪜㫋㪿㪼㫉㫅㪼㫋㩷㪿㫌㪹㩷
㪚㫆㪾㫅㪼㫏㫟㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤㩷

㪪㪼㫉㫀㪼㫊㩷 㩷 㪧㫆㪜㩷㪬㫅㫀㫋㩷

(2) Device list

Ŷ External input (command)


Device FB Name Application (when turned ON)
M100 P+Cognex-In-Sight_LogOn Establish connection with In-Sight® request
M110 P+Cognex-In-Sight_LoadJob Operation job change request
M120 P+Cognex-In-Sight_TriggerAcq Assess image request
M130 P+Cognex-In-Sight_GetData Symbolic tag value acquisition request
M140 P+Cognex-In-Sight_SetData Symbolic tag value change request
M150 P+Cognex-In-Sight_GetStatus Acquire In-Sight® online/offline status request
M160 P+Cognex-In-Sight_Online In-Sight® online request
M170 P+Cognex-In-Sight_Offline In-Sight® offline request
M180 P+Cognex-In-Sight_SaveJob Save job request
M190 P+Cognex-In-Sight_SendCmd Send native command request

㩷 㪍㪌
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
Ŷ External output (confirmation)
Device FB Name Application (when turned ON)
D10 P+Cognex-In-Sight_LogOn Outputs the error code generated during connection with In-Sight®.
D11 P+Cognex-In-Sight_LoadJob Outputs the error code generated when the job file is changed.
D12 P+Cognex-In-Sight_TriggerAcq Outputs the error code generated during image assessment and
assessment result acquisition.
D13 P+Cognex-In-Sight_GetData Outputs the error code generated during symbolic tag value acquisition.
D14 P+Cognex-In-Sight_SetData Outputs the error code generated when the symbolic tag value is
changed.
D15 P+Cognex-In-Sight_GetStatus Outputs the error code generated during online/offline status acquisition.
D16 P+Cognex-In-Sight_Online Outputs the error code generated when In-Sight® goes online.
D17 P+Cognex-In-Sight_Offline Outputs the error code generated when In-Sight® goes offline.
D18 P+Cognex-In-Sight_SaveJob Outputs the error code generated when the job file is saved in
In-Sight®’s flash memory.
D19 P+Cognex-In-Sight_SendCmd Outputs the error code generated during native command sending and
receiving.
D100 P+Cognex-In-Sight_TriggerAcq Outputs the image assessment result.
D200 P+Cognex-In-Sight_GetData Outputs the symbolic tag value.
D400 P+Cognex-In-Sight_SetData Outputs the value change result for symbolic tags.
D500 P+Cognex-In-Sight_GetStatus Outputs the current status for In-Sight® (online/offline).
D600 P+Cognex-In-Sight_SendCmd Outputs the native command send result.

Ŷ Data register
Device FB Name Application
D300 P+Cognex-In-Sight_SetData Specifies the type of value to set in the symbolic tag.
D301 P+Cognex-In-Sight_SetData Specifies the type of set value set in D300.

(3) Input job file name

Ŷ External input (command)


FB Name Job Name Job Description Description written in D5500 or later with the MC
protocol
P+Cognex-In-Sight_LoadJob xy-ja.job Positioning Trigger frequency, image assessment result,
inspection positioning assessment result
P+Cognex-In-Sight_LoadJob inspect-ja.job Inspection Trigger frequency, image assessment result
P+Cognex-In-Sight_LoadJob IDCode-ja.job QR code reading Trigger frequency, image assessment result, QR
code details

㩷 㪍㪍
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
(4) Example of Use Settings

Ŷ Common settings
Input output items Value Description
Unit installation XY address HFFFF Conducts communication using the CPU w/ built-in
Ethernet port.
Connection No. K1 Specifies the connection No. for communication with
In-Sight®.
For details, refer to 1.4.3.
Timeout limit setting K0 Enter the length of the timeout (in seconds) when
communication with In-Sight® is broken. (30
seconds in this example.)

Ŷ Logon user
FB Name User Name Password
P+Cognex-In-Sight_LogOn operator “” (NULL password)

Ŷ Input job file name


FB Name Job Name Job Description
P+Cognex-In-Sight_LoadJob xy-ja.job Determines positioning.
P+Cognex-In-Sight_SaveJob xy-ja.job Determines positioning.

Ŷ Input symbolic tag name


FB Name Tag Name Description
P+Cognex-In-Sight_GetData Pattern_1. Accept threshold Threshold for a pass/no pass determination
P+Cognex-In-Sight_SetData Pattern_1. Accept threshold Threshold for a pass/no pass determination

㩷 㪍㪎
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
(5) FB Library Example

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


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

㪫㫌㫉㫅㫊㩷㪦㪥㩷㫎㪿㪼㫅㩷㪸㩷
㪺㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷㫎㫀㫋㪿㩷
㪠㫅㪄㪪㫀㪾㪿㫋㫤㩷㫀㫊㩷㪼㫊㫋㪸㪹㫃㫀㫊㪿㪼㪻㪅㩷

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


Changes the job to “xy-ja.job”.

7XUQV21ZKHQWKHMRE
LVFKDQJHG

,QSXWVWKHMREILOHQDPH
WREHFKDQJHG

㩷 㪍㪏
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
(c) P+Cognex-In-Sight_TriggerAcq (Acquisition of Image Assessment Result)
Assesses the image and receives the result.

7XUQV2QZKHQWKH
LPDJHLVGHWHUPLQHG

6DYHVWKHLPDJH
GHWHUPLQDWLRQUHVXOWVWR
WKHILOHUHJLVWHU

$IWHUWKHLPDJHLV
GHWHUPLQHGWKH
SRVLWLRQLQJH[DPLQDWLRQ
UHVXOWLVVWRUHGLQWKHILOH
UHJLVWHU 

5HVHWV WR  ZKHQ WKH


XSSHU OLPLW RI WKH ILOH
UHJLVWHULVH[FHHGHG

㩷 㪍㪐
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
(d) P+Cognex-In-Sight_GetData (Acquisition of the Symbolic Tag Value)
Acquires the value of symbolic tag “Pattern_1. Accept threshold value”.

7XUQV 21 ZKHQ WKH


V\PEROLF WDJ YDOXH LV
DFTXLUHG

$FTXLUHVWKHYDOXHDQG
LQSXWVWKHWDJQDPH

㩷 㪎㪇
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
(e) P+Cognex-In-Sight_SetData (Symbolic Tag Value Change)
Changes the value of symbolic tag “Pattern_1. Access threshold value”.

7XUQV21ZKHQWKH
V\PEROLFWDJYDOXHLV
FKDQJHG

,QSXWVWKHWDJQDPHIRU
ZKLFKWKHYDOXHZLOOEH
FKDQJHG

㩷 㪎㪈
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
(f) P+Cognex-In-Sight_GetStatus (Online/Offline Status Acquisition)
Acquires the status of In-Sight®.

Turns ON when the


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

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


Takes In-Sight® online.

Turns On when the


current status
In-Sight® goes online.

㩷 㪎㪉
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
(h) P+Cognex-In-Sight_SetOffline (Take Vision System Offline)
Takes In-Sight® offline.

7XUQV 21 ZKHQ WKH


FXUUHQW VWDWXV RI
,Q6LJKWpJRHVRIIOLQH

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


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

7XUQV21ZKHQVDYLQJ
WKH MRE WR ,Q6LJKWp
V
IODVKPHPRU\

(QWHUV WKH MRE ILOH


QDPHIRUVDYLQJ

㩷 㪎㪊
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
(j) P+Cognex-In-Sight_SendCmd (Native Command Send/Receive)
Sends the native command “GI”, and acquires the sensor information.

7XUQV21ZKHQVDYLQJ
WKH MRE WR ,Q6LJKWp
V
IODVKPHPRU\

(QWHUV WKH QDWLYH


FRPPDQGIRUVHQGLQJ

㩷 㪎㪋
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
(k) Processing example when an image is assessed in the sensor’s hardware trigger input port

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

Remove the b contact point SM400 when actually in use.

6DYHVWKHLPDJH

GHWHUPLQDWLRQUHVXOWVWRWKH

ILOHUHJLVWHU

5HVHWVWRZKHQWKH

XSSHUOLPLWRIWKHILOH

UHJLVWHULVH[FHHGHG

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

㩷 㪎㪌
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷
(1) File Register settings

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

Following setting, click the “End” button.

㩷 㪎㪍
㪝㪙㩷㪣㫀㪹㫉㪸㫉㫐㩷㪩㪼㪽㪼㫉㪼㫅㪺㪼㩷㪤㪸㫅㫌㪸㫃㩷㪽㫆㫉㩷㪠㫅㪄㪪㫀㪾㪿㫋㫤䋭㪚㪧㪬㩷㫎㫀㫋㪿㩷㪙㫌㫀㫃㫋㪄㫀㫅㩷㪜㫋㪿㪼㫉㫅㪼㫋㩷㪧㫆㫉㫋㩷㪚㫆㫅㫅㪼㪺㫋㫀㫆㫅㩷

También podría gustarte