![Mitsubishi MELFA 4D-2CG5100-PKG-E Скачать руководство пользователя страница 116](http://html1.mh-extra.com/html/mitsubishi/melfa-4d-2cg5100-pkg-e/melfa-4d-2cg5100-pkg-e_instruction-manual_1808016116.webp)
9
Detailed Explanation of Functions
9-105 Vision Sensor Dedicated Commands and Status Variables
(2) M_NVNUM
[Function]
Indicates the number of pieces of work detected by the vision sensor.
[Array meaning]
Array elements (1 - 8): Vision sensor numbers
[Explanation of values returned]
Work detection count (0-255)
[Explanation]
1) Indicates the number of pieces of work detected by the vision sensor with the NVPST command or
NVIN command.
2) The stored recognition count is held until the next NVPST command or NVIN command is executed.
When an NVPST command or NVIN command is executed, the data is cleared to "0".
3) When the <Recognition count cell> specified with the NVPST command or NVIN command is a blank
cell in the vision program or a vision program command is specified, this becomes "0".
[Sample sentence]
100 IF M_NVOPEN(1)<>1 THEN ' When logon has not been completed for vision sensor number 1
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 NVPST #1,”TEST”,”E76”,”J81”,”L84”,1,10
'Starts the "Test" program, receives the recognition count from the E76 cell and the recognition results
from cells J81 through L84, and stores this in M_NVS1().
150 'Processes referencing the acquired data.
160 MVCNT=M_NVNUM(1)
'Acquires the number of pieces of work recognized by the vision sensor.
170
・・・・・
300 NVCLOSE #1
'Cuts the line with the vision sensor connected to COM2.
[Errors]
1) If the type of data specified as an array element is incorrect, a
"syntax error in input command
statement"
error occurs.
2) If there is an abnormal number of array elements (too many or too few), an
"incorrect argument type"
error occurs.
3) If an array element other than "1" through "8" is specified, an
"array element mistake"
error occurs.