4-297
Detailed explanation of Robot Status Variable
4MELFA-BASIC IV
M_Uar32
[Function]
Returns whether contained in the user-defined area.
Bits 0 to 31 correspond to areas 1 to 32, with the respective bits displaying the information below.
1: Within user-defined area
2: Outside user-defined area
[Format]
[Terminology]
<Numeric Variable>
Specifies the numerical variable to assign.
<Mechanism Number>
Enter the mechanism number from 1 to 3. If the argument is omitted, 1 is set
as the default value.
[Reference Program]
1 Def Long M1
2 M1& = M_Uar32(1) AND &H00080000
'The result for area 20 only is assigned to M1.
3 If M1&<>0 Then M_Out(10)=1
'Output signal 10 turns ON if contained in area 20.
[Explanation]
(1) Refer to
,
Page 367, "5.8 About user-defined area"
for details on how to use a user-defined area.
(2) An error will occur if a 16-bit integer type is used for the <Numeric Variable> and the value is over. If so, use
a 32-bit integer type.
(3) The area in which 1 (signal output) is specified for parameter AREAnAT (n is the area no. (n = 1 to 32)) is
applicable.
(4) When performing a comparison operation or logic operation, a negative value results in decimal notation if bit
31 is 1, and therefore it is recommended that hexadecimal notation be used.
(5) This variable only reads the data.
[Related System Variables]
[M_Uar32 and User-defined Area Compatibility]
Example) If contained in user-defined area 5 and 10, this will be the combined value of &H00000010, the value
indicating area 5, and H00000400, the value indicating area 10, however, this will be returned as an
M_Uar32 value.
Example) <Numeric Variable>
= M_Uar32 [(<Mechanism Number>)]
Bit
Area
Decimal
Value
Hexadecimal Value
Bit
Area
Decimal Value
Hexadecimal
Value
0
1
1
&H00000001
16
17
65536
&H00010000
1
2
2
&H00000002
17
18
131072
&H00020000
2
3
4
&H00000004
18
19
262144
&H00040000
3
4
8
&H00000008
19
20
524288
&H00080000
4
5
16
&H00000010
20
21
1048576
&H00100000
5
6
32
&H00000020
21
22
2097152
&H00200000
6
7
64
&H00000040
22
23
4194304
&H00400000
7
8
128
&H00000080
23
24
8388608
&H00800000
8
9
256
&H00000100
24
25
16777216
&H01000000
9
10
512
&H00000200
25
26
33554432
&H02000000
10
11
1024
&H00000400
26
27
67108864
&H04000000
11
12
2048
&H00000800
27
28
134217728
&H08000000
12
13
4096
&H00001000
28
29
268435456
&H10000000
13
14
8192
&H00002000
29
30
536870912
&H20000000
14
15
16384
&H00004000
30
31
1073741824
&H40000000
15
16
32768
&H00008000
31
32
-2147483648
&H80000000