Mitsubishi MELFA 4D-2CG5100-PKG-E Instruction Manual page 108

Network vision sensor
Table of Contents

Advertisement

9 Detailed Explanation of Functions
(4) NVTRG (network vision sensor trigger)
[Function]
Requests the specified vision program to capture an image.
[Format]
NVTRG□#<Vision sensor number>,<delay time>, <encoder 1 value read-out variable>
[Term]
<Vision sensor number> (Can not be omitted)
This specifies the number of the vision sensor to control.
Setting range:
<Delay time> (Can not be omitted)
This specifies the delay time (in ms) from when the image capture request is output to the vision
sensor until the encoder value is obtained.
Setting range:
<Encoder n value read-out variable> (Can be omitted from the second one on)
Specifies the double precision numeric variable into which the read out external encoder n value is
set.
Note: n is 1 - 8.
[Sample sentence]
100 IF M_NVOPEN(1)<>1 THEN 'If vision sensor number 1 logon is not complete
110
NVOPEN "COM2:" AS #1
120 ENDIF
130 WAIT M_NVOPEN(1)=1
completed.
140 NVRUN #1,"TEST"
150 NVTRG #1,15,M1#,M2#
1 and 2 after 15 ms.
160 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 ().
170 ・・・・
300 NVCLOSE #1
[Explanation]
1) Outputs the image capture request to the specified vision sensor and acquires the encoder value after
the specified time. The acquired encoder value is stored in the specified numeric variable.
2) This command moves to the next step at the point in time when the encoder value is acquired the
specified time after the image capture request to the vision sensor.
3) If the program is cancelled while this command is being executed, it stops immediately.
4) For receiving data from the vision sensor, use the NVIN command.
5) When this command is used with multi-tasking, it is necessary to execute the NVOPEN command in the
task using this command. Also, use the <vision sensor number> specified with the NVOPEN command.
6) A program start condition of "Always" and the continue function are not supported.
7) Up to three robots can control the same vision sensor at the same time, but this command can not be
used by more than one robot at the same time. Use this command on any one of the robots.
8) If an interrupt condition is established while this command is being executed, the interrupt processing is
executed immediately.
9-97 Vision Sensor Dedicated Commands and Status Variables
[,[<encoder 2 read-out variable>][,[<encoder 3 value read-out variable>]
[,[<encoder 4 read-out variable>][,[<encoder 5 value read-out variable>]
[,[<encoder 6 read-out variable>][,[<encoder 7 value read-out variable>]
[,[<encoder 8 read-out variable>]
1 - 8
0 - 150 ms
'Connects with the vision sensor connected to COM2.
' Connects with vision sensor number 1 and waits for logon to be
'Starts the "Test" program.
'Requests the vision sensor to capture an image and acquires encoders
'Cuts the line with the vision sensor connected to COM2.

Advertisement

Table of Contents
loading

Table of Contents