![Mitsubishi MELFA 4D-2CG5100-PKG-E Instruction Manual Download Page 112](http://html1.mh-extra.com/html/mitsubishi/melfa-4d-2cg5100-pkg-e/melfa-4d-2cg5100-pkg-e_instruction-manual_1808016112.webp)
9
Detailed Explanation of Functions
9-101 Vision Sensor Dedicated Commands and Status Variables
(6) NVIN (network vision sensor input)
[Function]
Receives the results of the recognition by the vision sensor.
The data received from the vision sensor is stored in the robot controller robot status variables.
[Format]
NVIN
□
#<Vision sensor number>,[<Vision program (job) name]
, <Recognition count cell>,<Start cell>,<End cell>,<Type> [,<Timeout>]
[Term]
<Vision sensor number>
(Can not be omitted)
This specifies the number of the vision sensor to control.
Setting range:1 - 8
<Vision program (job) name>
(Can not be omitted)
Specifies the name of the vision program to obtain the recognition results of.
If this parameter is omitted, the results are obtained from the currently active vision program.
The vision program extension (.job) can be omitted.
The only characters that can be used are "0" - "9", "A" - "Z", "a" - "z", "-", and "_".
<Recognition count>
(Can not be omitted)
Specifies the cell in which the count of work recognized by the vision sensor is stored.
Setting range: Row: 0-399 Column: "A" - "Z" Example: "A5"
* When a vision program is created with MELFA-Vision, input the value specified by MELFA-Vision is
input.
<Start cell>/<End cell>
(Can not be omitted)
Specifies the cell range in which the results recognized by the vision sensor are stored.
The contents of the specified cell are stored in any of the status variables
P_NVS*()EM_NVS*()EC_NVS*().
(*=1 – 8)
Setting range: Row: 0-399 Column: "A" - "Z" Example: "A5", "C10", etc.
* When a vision program is created with MELFA-Vision, input the value specified by MELFA-Vision.
<Type>
(Can not be omitted)
Specifies the status variable cell in which the results recognized by the vision sensor are stored.
Setting range: 0 - 7 (
Set value 4-7 can be used since software version K7.)
Refer to the explanation of NVPST for the content of the processing of a specified value.
<Time out>
(If omitted, 10)
Specifies the time-out time (in seconds).
Specification range: Integer 1-32767
[Sample sentence]
100 IF M_NVOPEN(1)<>1 THEN 'If vision sensor number 1 log on is not complete
110 NVOPEN “COM2:” AS #1 'Connects with the vision sensor connected to COM2.
120 ENDIF
130 WAIT M_NVOPEN(1)=1 ' Connects with vision sensor number 1 and waits for logon to be
completed.
140 NVRUN #1,”TEST” 'Starts the "Test" program.
150 NVIN #1, ”TEST”,”E76”,”J81”,”L84”,0,10
'Receives the recognition count recognized with the "Test" program from the E76 cell and the
recognition results from cells J81 through L84, and stores this in P_NVS1 (30).
160
・・・・・
300 NVCLOSE #1 'Cuts the line with the vision sensor connected to COM2.