This function provides information about the AM alarm mask, depending on the alarm number and axis number, if any.
|
i32 al2am (i32 nAl , i32 nAx, i32 whichInfo)
|
|
Number of the alarm
|
|
Number of the axis (1-:-32) or 0 if the alarm is non-axis
|
|
Type of information about the desired alarm mask(AM):
|
|
0
|
Status of the AM bit related to the alarm
|
1
|
Index of the AM bit related to the alarm
|
2
|
Index bit of the AM relative to the alarm
|
3
|
Index bits of the AM related to the alarm, in the form of a mask
|
|
|
Returns:
|
|
|
Error
|
-1
|
Illegal alarm number
|
-2
|
Illegal axis number
|
-3
|
Type of information requested illegal
|
-4
|
The specified alarm is not an axis alarm
|
-5
|
The specified alarm is an axis alarm, or no AM is associated
|
-6
|
The association to the AM bit is not defined
|
whichInfo = 0
|
0
|
Status of the AM bit related to the low alarm (i.e., alarm not present)
|
1
|
State of the AM bit related to the high alarm (i.e., alarm present)
|
whichInfo = 1
|
>= 0
|
Index of the AM bit corresponding to the selected alarm
|
whichInfo = 2
|
>= 0
|
Bit of the index of the AM corresponding to the chosen alarm
|
whichInfo = 3
|
>= 0
|
Bits of the index of the AM corresponding to the chosen alarm, in the form of a mask
|
|
|
Rule, Task
|
|
|
Example usage:
result = al2am(9900, 0, whichInfo)
•whichInfo = 0 -> result = 1 if alarm 9900 is present, otherwise result = 0
•whichInfo = 1 -> result = 49
•whichInfo = 2 -> result = 27
•whichInfo = 3 -> result = 134217728 (0x8000000) |
Example usage:
u32 SUM_MAC_DIAGNO, appo, mB
i32 nAX, iB
appo = 0
iB = al2am(10, 1, 2)
for(nAX = 1 , nAX <= 6 , nAX)
if(AM(nAX).(iB))
appo.(10) = true
break
endif
endfor
iB = al2am(11, 1, 2)
for(nAX = 1 , nAX <= 6 , nAX)
if(AM(nAX).(iB))
appo.(11) = true
break
endif
endfor
mB = al2am(1500, 1, 3)
for(nAX = 1 , nAX <= 6 , nAX)
if(AM(nAX) r_and mB)
appo.(12) = true
break
endif
endfor
|
|