Escolar Documentos
Profissional Documentos
Cultura Documentos
<<Index>>
Reference Manual Revision History.................................................................................................................................. 1
1
Outline..................................................................................................................................................................... 2
11
FB Library Outline................................................................................................................................................ 2
12
13
14
141
Operation Settings for the CPU Unit w/ Built-in Ethernet Port ........................................................................... 4
142
15
151
152
153
16
17
Startup Check Method For In-Sight from Personal Computers Using Windows.............................................. 10
18
Related manuals.................................................................................................................................................11
19
Important ............................................................................................................................................................11
21
22
23
24
25
26
27
28
29
210
Appendix ............................................................................................................................................................... 58
31
32
33
34
35
4
41
Revised
Date
2009/02/20
Revision Contents
v1.01B
2009/06/01
v1.02C
2009/10/02
v1.03D
2009/12/01
Newly created
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.
No.
1
Item
P+Cognex-In-Sight_LogOn
2
3
P+Cognex-In-Sight_LoadJob
P+Cognex-In-Sight_TriggerAcq
P+Cognex-In-Sight_GetData
P+Cognex-In-Sight_SetData
P+Cognex-In-Sight_GetStatus
P+Cognex-In-Sight_SetOnline
P+Cognex-In-Sight_SetOffline
P+Cognex-In-Sight_SaveJob
Saves the current job to the In-Sight Vision Systems flash memory.
10
P+Cognex-In-Sight_SendCmd
Description
Establishes the connection between the CPU w/ built-in Ethernet port,
QJ71E71-100 module and the In-Sight Vision System.
Selects, changes and makes active jobs stored in the In-Sight Vision System.
After triggering loading of the In-Sight Vision System images, acquires the
result of the image assessment (pass / no pass).
In the Q series, the configuration is as follows. The system configuration is the same for the L series as well.
No.
1
Device Name
Q series sequencer
2
3
4
GX Works2
QJ71E71-100
Cognex In-Sight series
7
8
Explanation
Use base, power supply unit and QnUCPU unit w/ built-in Ethernet
with Serial Nos. with the first 5 digits of 11012 or later.
Use Version 1.09K or later
Q series sequencer ethernet unit
In-Sight Vision System
Connecting multiple devices with In-Sight is possible using an
ethernet hub.1
Power is supplied to the Cognex In-Sight series via an ethernet
cable.
Power can also be supplied using methods other than an ethernet
cable.
An ethernet hub is not essential. Operation is possible even with
system configurations directly connected to QnUCPU w/ built-in
Ethernet and ethernet units with the Cognex In-Sight series.
Used when connecting to the In-Sight series using EasyBuilder.
Used when connecting with In-Sight and for programming settings.
This section explains the settings for CPU units w/ built-in Ethernet ports used by this program.
Set to TCP.
Set to Socket Communication
Set to Active.
Enter the hexadecimal number that matches the In-Sight setting.
(Refer to 1.6) The default setting is 0017.
Enter the decimal number that matches the In-Sight setting. (Refer to 1.6)
The destination IP address is 192.168.0.1.
Enter the hexadecimal number that matches the In-Sight setting.
(Refer to 1.6) The default setting is 0017.
Set to TCP.
Set to MC Protocol.
No setting is required.
Enter the hexadecimal number that matches the In-Sight setting.
(Refer to 1.6) The default setting is 3000.
No setting is required.
No setting is required.
Set to TCP.
Set to Unpassive.
Set to Receive.
Set to Procedure Exist.
Set to Disable.
Set to Confirm.
Enter the hexadecimal number that matches the In-Sight setting.
(Refer to 1.6) The default setting is 3000.
No setting is required.
No setting is required.
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.
(1) IP Address
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.
(2) In the Run dialog box, enter cmd and press the OK button.
(3) Enter the following command in Command Prompt to check the startup of In-Sight from the displayed response.
Ping 192.168.0.1
Related manuals
MELSEC-L CPU Unit Users Manual (Built-in Ethernet Function Edition)
QnUCPU Users Manual (Built-in Ethernet Port Communication Edition)
Q-compatible Ethernet Interface Unit Users Manual (Basic Edition)
In-Sight EasyBuilder Help
Important
Be sure to read the corresponding Users Manual before using each product.
FB Library Details
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
Compatible Vision
System
Cognex In-Sight
Compatible CPU
Series
Model
MELSEC-Q Series
MELSEC-L Series
LCPU
Language
Ladder
Explanation of
Function
With FB_EN (execution command) ON, logs on to In-Sight from the ethernet unit.
Item
Description
FB Compile Method
Macro type
FB Operation
[Execution
Command]
[Execution
Command]
[Execution
Status]
[Execution
Status]
[Normal
Completion]
[Normal
Completion]
[Abnormal
Completion]
[Abnormal
Completion]
[Error Code]
Constraints
(Cautions)
[Error Code]
1. This FB does not include error processing. Error processing can be created separately to
match your system and operation requirements.
2. When this FB is used, the connection destination must be set in advance in the open setting
of the network parameter. Refer to the Users Manual and be sure to complete the settings.
3. Do not implement multiple FBs simultaneously for the same camera; if necessary, execute
multiple FBs sequentially.
Related manuals
Error Codes
Description
Action
-102
-103
-104
-105
-106
-200
-201
-202
characters.
The length of the password exceeds 15
characters.
Labels
Input Labels
Name
Variable name
Data type
Valid range
Description
Execution command
FB_EN
Bit
---
i_Start_IO_No
Word
Connection No.
i_Connection_No
Word
1 to 16 (decimal
number)
Timeout value
i_TimeOut
Word
1 to 32767
(decimal number)
i_UserName
Text
string
[0 to 9] [a to z]
[A to Z]
Password 1,2
i_Password
Text
string
[0 to 9] [a to z]
[A to Z]
Enter a password of 15
characters or less for the user
name.
If no entry is made, the
password is sent as No
Password to In-Sight.
1: Use ASCII or Shift-JIS characters for the User name and Password input variables.
2: Passwords can be used in ladder programs to prevent reading of the User name and Password.
Refer to 3.1 Using Passwords to Prevent Reading/Writing in Ladder Programs.
Output labels
Name
Variable name
Data type
Default
Description
Execution status
FB_ENO
Bit
OFF
End flag
FB_OK
Bit
OFF
FB_ERROR
Bit
OFF
Error Code
ERROR_ID
Word
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.
Version
Date
Description
1.00A
2009/02/20
Newly created
1.01B
2009/06/01
Important
This chapter describes the function of the function block.
It does not describe the constraints of using the unit or sequencer CPU nor the constraints generated by their combination,
etc.
Be sure to read the corresponding Users Manual before using each product.
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
Compatible Vision
Cognex In-Sight
System
Compatible CPU
Series
Model
MELSEC-Q Series
MELSEC-L Series
LCPU
Language
Ladder
Explanation of
With FB_EN (Execution Command) ON, selects, changes and activates jobs stored in the
Function
FB Compile Method
Macro type
FB Operation
Item
Description
[Execution
Command]
[Execution
Command]
[Execution
Status]
[Execution
Status]
[Normal
Completion]
[Normal
Completion]
[Abnormal
Completion]
[Abnormal
Completion]
[Error Code]
Constraints
(Cautions)
[Error Code]
1. This FB does not include error processing. Error processing can be created separately to
match your system and operation requirements.
2. In order to use this FB, it is necessary to use P+Cognex-In-Sight_LogOn and log onto
In-Sight beforehand.
3. In this FB, there is processing for going offline and online before and after job change
processing.
It is, therefore, not necessary to separately use FBs that execute offline and online
commands.
4. Do not implement multiple FBs simultaneously for the same camera; if necessary, execute
multiple FBs sequentially.
Related manuals
Error Codes
-6
Description
Action
sufficient memory.
The system is not online.
-105
-106
-300
characters.
Labels
Input Labels
Name
Variable name
Data type
Valid range
Description
Execution command
FB_EN
Bit
---
i_Start_IO_No
Word
in the
corresponding
CPU unit.
X10.)
the corresponding
selected.
CPU.
Connection No.
i_Connection_No
Word
1 to 16 (decimal
number)
Timeout value
i_TimeOut
Word
1 to 32767
(decimal number)
i_JobFileName
Text
[0 to 9]
string
[A to Z]
[a to z]
1: Use ASCII or Shift-JIS characters for the Selected job file name input variable.
Output labels
Name
Variable name
Data type
Default
Execution status
FB_ENO
Bit
OFF
Description
ON: The FB is running.
OFF: The FB is not running.
End flag
FB_OK
Bit
OFF
FB_ERROR
Bit
OFF
Error Code
ERROR_ID
Word
Version
Date
Description
1.00A
2009/02/20
Newly created
1.01B
2009/06/01
Important
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
Compatible Vision
Cognex In-Sight
System
Compatible CPU
Series
Model
MELSEC-Q Series
MELSEC-L Series
LCPU
Language
Ladder
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
Item
Description
[Execution
Command]
[Execution
Command]
[Execution
Status]
[Execution
Status]
[Normal
Completion]
[Normal
Completion]
[Abnormal
Completion]
[Abnormal
Completion]
[Error Code]
Constraints
(Cautions)
[Error Code]
1. This FB does not include error processing. Error processing can be created separately to
match your system and operation requirements.
2. In order to use this FB, it is necessary to use P+Cognex-In-Sight_LogOn and log onto
In-Sight beforehand.
3. Do not implement multiple FBs simultaneously for the same camera; if necessary, execute
multiple FBs sequentially.
Related manuals
Error Codes
Description
Action
-2
-6
-104
-105
-106
Labels
Input Labels
Name
Variable name
Data type
Valid range
Description
Execution command
FB_EN
Bit
---
i_Start_IO_No
Word
CPU.
Connection No.
i_Connection_No
Word
1 to 16 (decimal
number)
Timeout value
i_TimeOut
Word
1 to 32767
(decimal number)
Name
Variable name
Data type
Default
Description
Execution status
FB_ENO
Bit
OFF
Execution result
o_Result
Word
End flag
FB_OK
Bit
OFF
FB_ERROR
Bit
OFF
Error Code
ERROR_ID
Word
Output labels
Version
Date
Description
1.00A
2009/02/20
Newly created
1.01B
2009/06/01
Important
FB Definition Name
P+Cognex-In-Sight_GetData
Description of Function
Item
Description
Summary of Function
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
Compatible Vision
Cognex In-Sight
System
Compatible CPU
Series
Model
MELSEC-Q Series
MELSEC-L Series
LCPU
Language
Ladder
Item
Description
Explanation of
With FB_EN (execution command) ON, sends the symbolic tag set in i_tag to the In-Sight
Function
FB Compile Method
Macro type
FB Operation
[Execution
Command]
[Execution
Command]
[Execution
Status]
[Execution
Status]
[Normal
Completion]
[Normal
Completion]
[Abnormal
Completion]
[Abnormal
Completion]
[Error Code]
Constraints
(Cautions)
[Error Code]
1. This FB does not include error processing. Error processing can be created separately to
match your system and operation requirements.
2. In order to use this FB, it is necessary to use P+Cognex-In-Sight_LogOn and log onto
In-Sight beforehand.
3. Do not implement multiple FBs simultaneously for the same camera; if necessary, execute
multiple FBs sequentially.
4. Be sure to match the type of value received with i_Result_Type.
When the type does not match, a CPU operation error may occur when the type is converted.
For details refer to "3.3 Type Conversion Processing Combination Table for
P+Cognex-In-Sight_GetData".
Related manuals
Error Codes
-6
Description
Action
-104
-105
-106
-301
-305
characters.
Labels
Input Labels
Name
Variable name
Data type
Valid range
Description
Execution command
FB_EN
Bit
---
i_Start_IO_No
Connection No.
i_Connection_No
Word
Word
in the corresponding
CPU unit.
X10.)
the corresponding
CPU.
selected.
1 to 16 (decimal
number)
Timeout value
i_TimeOut
Word
1 to 32767 (decimal
number)
Symbolic tag
i_tag
Text string
[0 to 9]
[a to z]
[A to Z]
i_Result_Type
Word
0 to 4 (decimal
number)
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
Execution result
o_Result
Text string
16 bit integer
32 bit integer
Single-
precision real
number
End flag
FB_OK
Bit
OFF
FB_ERROR
Bit
OFF
Error Code
ERROR_ID
Word
Date
Description
1.00A
2009/02/20
Newly created
1.01B
2009/06/01
Important
1. Name
Name
P+Cognex-In-Sight_SetData
Description of Function
Item
Description
Summary of Function
Symbol
Compatible Devices
Compatible units
Compatible Vision
Cognex In-Sight
System
Compatible CPU
Series
Model
MELSEC-Q Series
MELSEC-L Series
LCPU
Language
Ladder
Item
Description
Explanation of
With FB_EN (execution command) ON, sends a random symbolic tag to the In-Sight Vision
Function
FB Compile Method
Macro type
FB Operation
[Execution
Command]
[Execution
Command]
[Execution
Status]
[Execution
Status]
[Normal
Completion]
[Normal
Completion]
[Abnormal
Completion]
[Abnormal
Completion]
[Error Code]
Constraints
(Cautions)
Related manuals
[Error Code]
1. This FB does not include error processing. Error processing can be created separately to
match your system and operation requirements.
2. In order to use this FB, it is necessary to use P+Cognex-In-Sight_LogOn and log onto
In-Sight beforehand.
3. In this FB, there is processing for going offline and online before and after data change
processing.
It is, therefore, not necessary to separately use FBs that execute offline and online commands.
4. Do not implement multiple FBs simultaneously for the same camera; if necessary, execute
multiple FBs sequentially.
5. Do not directly enter the value for i_tag_Value and i_tag_Data_Type.
Create the MAIN program so it refers to the values stored in D300, etc.
When the values are entered directly, an operation CPU error may occur.
6. Be sure to match the type of i_tag_Data_Type with i_tag_Value.
When the type does not match, an operation CPU error may occur when the type is
converted.
For details, refer to 3.4 Type Conversion Processing Combination Table for
P+Cognex-In-Sight_SetData.
MELSEC-L CPU Unit Users Manual (Built-in Ethernet Function Edition)
QnUCPU Users Manual (Built-in Ethernet Port Communication Edition)
Q-compatible Ethernet Interface Unit Users Manual (Basic Edition)
In-Sight EasyBuilder Help
Error Codes
Description
Action
-2
-5
-6
-104
-105
-106
-301
-302
-305
characters.
32 characters.
characters.
Labels
Input Labels
Name
Variable name
Data type
Valid range
Description
Execution command
FB_EN
Bit
---
Unit installation XY
address
i_Start_IO_No
Word
Connection No.
i_Connection_No
Word
1 to 16 (decimal
number)
Timeout value
i_TimeOut
Word
1 to 32767 (decimal
number)
Symbolic tag
i_tag
Text string
[0 to 9] [a to z]
[A to Z]
Set value1,2
i_tag_Value
Text string
16 bit integer
32 bit integer
Singleprecision real
number
---
i_tag_Data_Type
Word
0 to 4 (decimal
number)
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
Execution result
o_Result
Word
End flag
FB_OK
Bit
OFF
FB_ERROR
Bit
OFF
Error Code
ERROR_ID
Word
Version
Date
Description
1.00A
2009/02/20
Newly created
1.01B
2009/06/01
Important
This chapter describes the function of the function block.
It does not describe the constraints of using the unit or sequencer CPU nor the constraints generated by their combination,
etc.
Be sure to read the corresponding Users Manual before using each product.
Name
P+Cognex-In-Sight_GetStatus
Description of Function
Item
Description
Summary of Function
Symbol
Compatible Devices
Compatible units
Compatible Vision
Cognex In-Sight
System
Compatible CPU
Series
Model
MELSEC-Q Series
MELSEC-L Series
LCPU
Language
Ladder
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
Item
Description
[Execution
Command]
[Execution
Command]
[Execution
Status]
[Execution
Status]
[Normal
Completion]
[Normal
Completion]
[Abnormal
Completion]
[Abnormal
Completion]
[Error Code]
Constraints
(Cautions)
Related manuals
[Error Code]
1. This FB does not include error processing. Error processing can be created separately to
match your system and operation requirements.
2. In order to use this FB, it is necessary to use P+Cognex-In-Sight_LogOn and log onto
In-Sight beforehand.
3. Do not implement multiple FBs simultaneously for the same camera; if necessary, execute
multiple FBs sequentially.
MELSEC-L CPU Unit Users Manual (Built-in Ethernet Function Edition)
QnUCPU Users Manual (Built-in Ethernet Port Communication Edition)
Q-compatible Ethernet Interface Unit Users Manual (Basic Edition)
In-Sight EasyBuilder Help
Error Codes
Description
Action
-2
-6
-105
-106
Labels
Input Labels
Name
Variable name
Data type
Valid range
Description
Execution command
FB_EN
Bit
---
i_Start_IO_No
Word
Connection No.
i_Connection_No
Word
1 to 16 (decimal
number)
Timeout value
i_TimeOut
Word
1 to 32767
(decimal number)
Name
Variable name
Data type
Default
Description
Execution status
FB_ENO
Bit
OFF
Execution result
o_Result
Word
0: Offline
1: Online
End flag
FB_OK
Bit
OFF
FB_ERROR
Bit
OFF
Error Code
ERROR_ID
Word
Output labels
Version
Date
Description
1.00A
2009/02/20
Newly created
1.01B
2009/06/01
Important
This chapter describes the function of the function block.
It does not describe the constraints of using the unit or sequencer CPU nor the constraints generated by their combination,
etc.
Be sure to read the corresponding Users Manual before using each product.
Name
P+Cognex-In-Sight_SetOnline
Description of Function
Item
Description
Summary of Function
Symbol
Compatible Devices
Compatible units
Compatible Vision
Cognex In-Sight
System
Compatible CPU
Series
Model
MELSEC-Q Series
MELSEC-L Series
LCPU
Language
Ladder
Explanation of
With FB_EN (execution command) ON, puts the In-Sight Vision System online.
Function
FB Compile Method
Macro type
FB Operation
Item
Description
[Execution
Command]
[Execution
Command]
[Execution
Status]
[Execution
Status]
[Normal
Completion]
[Normal
Completion]
[Abnormal
Completion]
[Abnormal
Completion]
[Error Code]
Constraints
(Cautions)
[Error Code]
1. This FB does not include error processing. Error processing can be created separately to
match your system and operation requirements.
2. In order to use this FB, it is necessary to use P+Cognex-In-Sight_LogOn and log onto
In-Sight beforehand.
3. Do not implement multiple FBs simultaneously for the same camera; if necessary, execute
multiple FBs sequentially.
Related manuals
Error Codes
Description
Action
-2
-5
-6
-105
-106
Labels
Input Labels
Name
Variable name
Data type
Valid range
Description
Execution command
FB_EN
Bit
---
i_Start_IO_No
Word
in the
corresponding
CPU unit.
X10.)
the corresponding
selected.
CPU.
Connection No.
i_Connection_No
Word
1 to 16 (decimal
number)
Timeout value
i_TimeOut
Word
1 to 32767
(decimal number)
Output labels
Name
Variable name
Data type
Default
Description
Execution status
FB_ENO
Bit
OFF
End flag
FB_OK
Bit
OFF
FB_ERROR
Bit
OFF
Error Code
ERROR_ID
Word
Version
Date
Description
1.00A
2009/02/20
Newly created
1.01B
2009/06/01
Important
This chapter describes the function of the function block.
It does not describe the constraints of using the unit or sequencer CPU nor the constraints generated by their combination,
etc.
Be sure to read the corresponding Users Manual before using each product.
Name
P+Cognex-In-Sight_SetOffline
Description of Function
Item
Description
Summary of Function
Symbol
Compatible Devices
Compatible units
Compatible Vision
Cognex In-Sight
System
Compatible CPU
Series
Model
MELSEC-Q Series
MELSEC-L Series
LCPU
Language
Ladder
Explanation of
With FB_EN (execution command) ON, takes the In-Sight Vision System offline.
Function
FB Compile Method
Macro type
FB Operation
Item
Description
[Execution
Command]
[Execution
Command]
[Execution
Status]
[Execution
Status]
[Normal
Completion]
[Normal
Completion]
[Abnormal
Completion]
[Abnormal
Completion]
[Error Code]
Constraints
(Cautions)
Related manuals
[Error Code]
1. This FB does not include error processing. Error processing can be created separately to
match your system and operation requirements.
2. In order to use this FB, it is necessary to use P+Cognex-In-Sight_LogOn and log onto
In-Sight beforehand.
3. Do not implement multiple FBs simultaneously for the same camera; if necessary, execute
multiple FBs sequentially.
MELSEC-L CPU Unit Users Manual (Built-in Ethernet Function Edition)
QnUCPU Users Manual (Built-in Ethernet Port Communication Edition)
Q-compatible Ethernet Interface Unit Users Manual (Basic Edition)
In-Sight EasyBuilder Help
Error Codes
Description
Action
-2
-6
-105
-106
Labels
Input Labels
Name
Variable name
Data type
Valid range
Description
Execution command
FB_EN
Bit
---
i_Start_IO_No
Word
Connection No.
i_Connection_No
Word
1 to 16 (decimal
number)
Timeout value
i_TimeOut
Word
1 to 32767
(decimal number)
Name
Variable name
Data type
Default
Description
Execution status
FB_ENO
Bit
OFF
End flag
FB_OK
Bit
OFF
FB_ERROR
Bit
OFF
Error Code
ERROR_ID
Word
Output labels
Version
Date
Description
1.00A
2009/02/20
Newly created
1.01B
2009/06/01
Important
This chapter describes the function of the function block.
It does not describe the constraints of using the unit or sequencer CPU nor the constraints generated by their combination,
etc.
Be sure to read the corresponding Users Manual before using each product.
Name
P+Cognex-In-Sight_SaveJob
Description of Function
Item
Description
Summary of Function
Saves the current job to the In-Sight Vision Systems flash memory.
Symbol
Compatible Devices
Compatible units
Compatible Vision
Cognex In-Sight
System
Compatible CPU
Series
Model
MELSEC-Q Series
MELSEC-L Series
LCPU
Language
Ladder
Explanation of
With FB_EN (execution command) ON, saves the current job to the In-Sight Vision Systems
Function
flash memory.
FB Compile Method
Macro type
FB Operation
Item
Description
[Execution
Command]
[Execution
Command]
[Execution
Status]
[Execution
Status]
[Normal
Completion]
[Normal
Completion]
[Abnormal
Completion]
[Abnormal
Completion]
[Error Code]
Constraints
(Cautions)
[Error Code]
1. This FB does not include error processing. Error processing can be created separately to
match your system and operation requirements.
2. In order to use this FB, it is necessary to use P+Cognex-In-Sight_LogOn and log onto
In-Sight beforehand.
3. In this FB, there is processing for going offline and online before and after save processing.
It is, therefore, not necessary to separately use FBs that execute offline and online
commands.
4. Do not implement multiple FBs simultaneously for the same camera; if necessary, execute
multiple FBs sequentially.
Related manuals
Error Codes
-2
Description
Action
-5
-6
-105
-106
-303
Labels
Input Labels
Name
Variable name
Data type
Valid range
Description
Execution command
FB_EN
Bit
---
i_Start_IO_No
Word
in the
corresponding
CPU unit.
X10.)
the corresponding
selected.
CPU.
Connection No.
i_Connection_No
Word
1 to 16 (decimal
number)
Timeout value
i_TimeOut
Word
1 to 32767
(decimal number)
i_JobFileName
Text
[0 to 9]
string
[A to Z]
[a to z]
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
End flag
FB_OK
Bit
OFF
FB_ERROR
Bit
OFF
Error Code
ERROR_ID
Word
Version
Date
Description
1.00A
2009/02/20
Newly created
1.01B
2009/06/01
Important
This chapter describes the function of the function block.
It does not describe the constraints of using the unit or sequencer CPU nor the constraints generated by their combination,
etc.
Be sure to read the corresponding Users Manual before using each product.
Name
P+Cognex-In-Sight_SendCmd
Description of Function
Item
Description
Summary of Function
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
Cognex In-Sight
Compatible CPU
Series
Model
MELSEC-Q Series
MELSEC-L Series
LCPU
Language
Ladder
Explanation of
With FB_EN (execution command) ON, sends and receives a random native command.
Function
FB Compile Method
Macro type
FB Operation
Item
Description
[Execution
Command]
[Execution
Command]
[Execution
Status]
[Execution
Status]
[Normal
Completion]
[Normal
Completion]
[Abnormal
Completion]
[Abnormal
Completion]
[Error Code]
Constraints
(Cautions)
[Error Code]
1. This FB does not include error processing. Error processing can be created separately to
match your system and operation requirements.
2. In order to use this FB, it is necessary to use P+Cognex-In-Sight_LogOn and log onto
In-Sight beforehand.
3. Do not implement multiple FBs simultaneously for the same camera; if necessary, execute
multiple FBs sequentially.
Related manuals
Error Codes
Description
Action
-1
-2
-4
-5
-6
sufficient memory.
The system is not online.
-105
-106
-304
199 characters.
Labels
Input Labels
Name
Variable name
Data
Valid range
Description
type
Execution command
FB_EN
Bit
---
i_Start_IO_No
Word
Connection No.
i_Connection_No
Word
1 to 16 (decimal
number)
Timeout value
i_TimeOut
Word
1 to 32767
(decimal number)
Native command1
i_Native_Command
Text
string
[0 to 9] [a to z]
[A to Z]
1: Use ASCII or Shift-JIS characters for the Native command input variable.
Output labels
Name
Variable name
Data type
Default
Execution status
FB_ENO
Bit
OFF
Description
ON: The FB is running.
OFF: The FB is not running.
Execution result
o_Result
Text
string
End flag
FB_OK
Bit
OFF
FB_ERROR
Bit
OFF
Error Code
ERROR_ID
Word
Version
Date
Description
1.00A
2009/02/20
Newly created
1.01B
2009/06/01
Important
This chapter describes the function of the function block.
It does not describe the constraints of using the unit or sequencer CPU nor the constraints generated by their combination,
etc.
Be sure to read the corresponding Users Manual before using each product.
Appendix
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.
(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.
P+Cognex-In-Sight_GetData converts and outputs the value received from In-Sight in accordance with the specified
received value data type (i_Result_Type).
Whether or not settings are possible for the received value data type and the value received from In-Sight is shown below
along with the operation for the set values.
Type of Tag
Data Type of
Received Value
Data Type of the Received Value
Not Entered
Text String (Enter KO)
16 bit integer [0 or 1](Enter K1)
16 bit integer (Enter K2)
32 bit integer (Enter K3)
Single-precision Real Number
[32 bit](Enter K4)
: Setting Possible
X: Setting not possible
Numerical Value
Range
"0" or "1"
Text String
Operation 1
Error 1*1.
Error 1*1.
Error 1*1.
Numerical Value
Numerical Value Range
Numerical Value Range
-3276832767
2.147e+0092.147e+009
Numerical Value
Range
Other Ranges
Operation 2
Operation 2
Operation 2
Operation 2
Operation 1
Operation 1
Error 1*1.
Operation 1
Error 1*1.
Error 1*1.
Operation 3
Operation 4
Operation 5
Operation 4
Operation 5
Operation 5
* For details of the conversion processing operation, refer to QCPU Programming Manual: Common Commands Edition.
P+Cognex-In-Sight_SetData converts the set value (i_tag_Value) to text string based on set value data type
(i_tag_Data_Type) and sends the set value to In-Sight.
Whether or not settings corresponding to the set value data type and the set value are possible and operation for the set
values are shown below.
Setting Value
Data Type of
Received Value
Data Type of the Received Value
Not Entered
Text String (Enter KO)
Text String
Direct
Input
Indirect
Input
: Setting Possible
X: Setting Not Possible
-: Item where direct value input
in FB is not possible
Error 2/3/6
Operation
Operation 1 Operation 1
1
Error 3*1.
Error
Error
Error
Error 1/3*1. Error 1/3*1.
1/3*1.
1/3*1.
1/3*1.
Single-precision Real
Number
Direct
Indirect
Input
Input
Direct
Input
Indirect
Input
Error 2/3/6
Error 2/3/6
Error 7*1.
Error 7*1.
Error 4*1.
Error 1*1.
Error 4*1.
Error 5*1.
* For details of the conversion processing operation, refer to QCPU Programming Manual: Common Commands Edition.
Native commands that can be sent by this program are shown below.
No.
1
2
3
4
5
6
7
8
9
10
11
12
13
TJ
RJ
WJ
DJ
GJ
RB
14
RI
15
16
17
18
19
WB
WI
GV
SI
SF
20
21
22
23
24
25
26
27
28
29
30
SS
GI
RS
WS
TS
SL
GL
SO
GO
SE
SW
31
32
33
34
RT
SM
Get Connections
Get Expr
35
36
37
38
Get Filelist
Put Live
Put Portnum
Put Timeout
39
40
41
Put Update
Put Watch
Put XML
Description
Loads the specified job from In-Sights flash memory and makes it the active job.
Saves the current job into In-Sights flash memory.
Reads the job from the specified In-Sight flash memory.
Sends the job to In-Sights flash memory.
Deletes the specified job or cell data (.CXD) file from In-Sights flash memory.
Returns the file name of the job currently active in In-Sight.
Loads the job from one of the job slots within In-Sights flash memory and makes it
the active job.
Saves the current job in the job slot specified within In-Sights flash memory.
Reads the job from the specified In-Sight job slot.
Sends the job to the In-Sight job slot specified within In-Sights flash memory.
Deletes the job from the slot specified within In-Sights flash memory.
Returns the ID of the job currently active in In-Sight.
Sends the current image from In-Sight to a remote device in ASCII hexadecimal
format (80 characters/line).
Sends the current image from In-Sight to a remote device in ASCII hexadecimal
format (80 characters/line).
Sends image data from a remote device to In-Sight.
Sends image data from a remote device to In-Sight.
Returns the value included in the specified cell.
Sets the control included in the cell to the specified integer value.
Sets the edit box control included in the cell to the specified floating point number
value.
Sets the edit box control included in the cell to the specified text string.
Returns In-Sight sensor information.
Reads In-Sight system setting data.
Sends system setting data from a remote device to In-Sight.
Saves In-Sights settings to the proc.set file.
Prevents unauthorized changes to In-Sights IP address.
Returns the security status of In-Sights IP address.
Sets In-Sight to the online or offline mode.
Returns In-Sight online.
Triggers the specified event.
Triggers the specified event and returns the response after completion of the
command.
Resets In-Sight. This command is the same as physically turning on the power again.
Sends the text string to In-Sights spreadsheet via the native mode connection.
Returns the current connection information for In-Sight.
Returns the parameter or value included in the cell specified by the row and line
address, as well as the state of that cell.
Returns the number of files and each file name stored in In-Sights memory.
Turns the live load mode ON or OFF.
Specifies the port In-Sight uses for data or image forwarding via the network.
Specifies the amount of time (milliseconds) to maintain the port connection from the
client when sending or receiving is not being carried out.
Refreshes the GUI (spreadsheet, image display, and cell graphics).
Returns the value included in the specified cell when the cell is refreshed.
Specifies whether or not to format the output result of the native mode command with
XML.
The native commands that can be sent by this program following the native command Put XML are shown below.
No.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
EV GetNetwork
EV GetSerialPort
EV GetStartup
EV GetUserList
EV
SetDeEnergizeOutputs
EV EditRegion
EV SetEIPSingleAttribute
EV SetFavorHostTable
17
18
EV SetFTPSettings
EV SetSerialPort
Description
Reads the settings of the Customize dialog box from the GUI of In-Sight 3000/3400.
Returns the Turn off the output power when offline setting specified by the Discrete
output setting dialog box.
Returns the information set in the Discrete input setting dialog box.
Returns the information set in the Discrete output setting dialog box.
Returns the class and the instance attributes of In-Sight EtherNet/IP.
Returns the information set in the FTP settings dialog box.
Returns the information included in the In-Sight host table dialog box.
Returns the machine status data stored in one of the buffers (begins with 0) attached
to the 8 indices within the machine status stack.
Returns the information set in the Network settings dialog box.
Returns the information set in the Serial port settings dialog box.
Returns the information set in the Startup dialog box.
Returns the information set in the User list dialog box.
Changes the Turn off output power when offline setting of the Discrete output
setting dialog box.
Changes the cell settings that include the EditRegion function.
Sets the class and the instance attributes of In-SightEtherNet/IP.
Activates or deactivates the Give higher priority to the host table than DNS option of
the In-Sight host table.
Changes the FTP settings dialog box settings.
Changes the Serial port settings dialog box settings.
The following is an example of operating In-Sight using a CPU with built-in Ethernet.
Select and use jobs stored in In-Sight.
FB Name
M100
P+Cognex-In-Sight_LogOn
M110
P+Cognex-In-Sight_LoadJob
M120
P+Cognex-In-Sight_TriggerAcq
M130
P+Cognex-In-Sight_GetData
M140
P+Cognex-In-Sight_SetData
M150
P+Cognex-In-Sight_GetStatus
M160
P+Cognex-In-Sight_Online
M170
P+Cognex-In-Sight_Offline
M180
P+Cognex-In-Sight_SaveJob
M190
P+Cognex-In-Sight_SendCmd
FB Name
D10
P+Cognex-In-Sight_LogOn
D11
P+Cognex-In-Sight_LoadJob
Outputs the error code generated when the job file is changed.
D12
P+Cognex-In-Sight_TriggerAcq
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
D16
P+Cognex-In-Sight_Online
D17
P+Cognex-In-Sight_Offline
D18
P+Cognex-In-Sight_SaveJob
Outputs the error code generated when the job file is saved in
In-Sights flash memory.
D19
P+Cognex-In-Sight_SendCmd
Outputs the error code generated during native command sending and
receiving.
D100
P+Cognex-In-Sight_TriggerAcq
D200
P+Cognex-In-Sight_GetData
D400
P+Cognex-In-Sight_SetData
D500
P+Cognex-In-Sight_GetStatus
D600
P+Cognex-In-Sight_SendCmd
Data register
Device
FB Name
Application
D300
P+Cognex-In-Sight_SetData
D301
P+Cognex-In-Sight_SetData
Job Name
Job Description
P+Cognex-In-Sight_LoadJob
xy-ja.job
Positioning
inspection
P+Cognex-In-Sight_LoadJob
inspect-ja.job
Inspection
P+Cognex-In-Sight_LoadJob
IDCode-ja.job
QR code reading
Common settings
Input output items
Value
Description
HFFFF
Connection No.
K1
K0
Logon user
FB Name
User Name
Password
P+Cognex-In-Sight_LogOn
operator
FB Name
Job Name
Job Description
P+Cognex-In-Sight_LoadJob
xy-ja.job
Determines positioning.
P+Cognex-In-Sight_SaveJob
xy-ja.job
Determines positioning.
FB Name
Tag Name
Description
P+Cognex-In-Sight_GetData
P+Cognex-In-Sight_SetData
(NULL password)
7XUQV21ZKHQWKHMRE
LVFKDQJHG
,QSXWVWKHMREILOHQDPH
WREHFKDQJHG
7XUQV2QZKHQWKH
LPDJHLVGHWHUPLQHG
6DYHVWKHLPDJH
GHWHUPLQDWLRQUHVXOWVWR
WKHILOHUHJLVWHU
$IWHUWKHLPDJHLV
GHWHUPLQHGWKH
SRVLWLRQLQJH[DPLQDWLRQ
UHVXOWLVVWRUHGLQWKHILOH
UHJLVWHU
$FTXLUHVWKHYDOXHDQG
LQSXWVWKHWDJQDPH
7XUQV21ZKHQWKH
V\PEROLFWDJYDOXHLV
FKDQJHG
,QSXWVWKHWDJQDPHIRU
ZKLFKWKHYDOXHZLOOEH
FKDQJHG
7XUQV21ZKHQVDYLQJ
WKH MRE WR ,Q6LJKWp
V
IODVKPHPRU\
7XUQV21ZKHQVDYLQJ
WKH MRE WR ,Q6LJKWp
V
IODVKPHPRU\
(k) Processing example when an image is assessed in the sensors hardware trigger input port
Cautions
When image assessment is conducted in the sensors hardware trigger input port, the settings for the job description must
be changed.
P+Cognex-In-Sight_TriggerAcq cannot be used in conjunction with the hardware trigger input port to conduct image
assessment.
6DYHVWKHLPDJH
GHWHUPLQDWLRQUHVXOWVWRWKH
ILOHUHJLVWHU
5HVHWVWRZKHQWKH
XSSHUOLPLWRIWKHILOH
UHJLVWHULVH[FHHGHG
The method for setting the file register is described on the next page.
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.