2 HIGH-SPEED COUNTER MODULE FB
2.6 M+FX5-2HC_DegreeToCountVal (Angle Conversion)
33
2
2.6 M+FX5-2HC_DegreeToCountVal (Angle
Conversion)
Overview
This FB calculates count values from angles.
Labels
Input label
Output label
No. Label Label name Data type Import Range Description
(1) i_bEN Execution
command
Bit Always On or off On: The FB is activated.
Off: The FB is not activated.
(2) i_uAngle Angle Word [Unsigned]/Bit
String [16-bit]
Always 0 to 3599 Specify the angle. (Unit: 0.1 degree)
(3) i_udResolution Resolution Double word
[unsigned]/Bit string
[32-bit]
Always 10 to 32768 Specify the resolution of the encoder.
(4) i_uZeroValue Zero degree
setting value
Word [Unsigned]/Bit
String [16-bit]
Always 0 to (i_udResolution-
1)
Specify a value to set as 0 degree.
No. Label Label name Data type Default
value
Description
(5) o_bENO Execution status Bit Off On: The execution command is on.
Off: The execution command is off.
(6) o_bOK Normal completion Bit Off When this label is on, it indicates that a count
value is being calculated.
(7) o_bErr Error completion Bit Off When this label is on, it indicates that an error
has occurred in the FB.
(8) o_uErrId Error code Word [Unsigned]/Bit String
[16-bit]
0 Stores the error code that occurred in the FB.
(9) o_dCountVal Count value Double word [signed] 0 Stores the count value calculated from the
angle.
o_bErr:B
o_uErrId:UW
o_bOK:B
o_bENO:B
UW:i_uAngle
B:i_bEN
(1) (5)
(6)
(7)
(8)
(2)
M+FX5-2HC_DegreeToCountVal
UD:i_udResolution
(3)
UW:
i_uZeroValue
(4)
o_dCountVal:D
(9)