Download NJ-series CPU Unit Motion Control User`s Manual

Transcript
6 Motion Control Programming
Data Types Used for System-defined Variables for Motion Control
System-defined variables for motion control use both basic data types and derivative data types.
 Basic Data Types
Category
Data type
Size
Range of values
Notation
Boolean
BOOL
2*
TRUE or FALSE
TRUE or FALSE
Integer
UINT
2
0 to +65,535
UDINT
4
0 to +4,294,967,295
Binary expression: "2#" is added to the
front of the number
Octal expression: "8#" is added to the
front of the number
Decimal expression: "10#" is added to the
front of the number
Hexadecimal expression: "16#" is added
to the front of the number
If you do not add any notation to the
beginning of a number, that number is
treated as a decimal number.
Example:
Binary Notation
2#1111_1111
2#1110_0000
Octal Notation
8#377
8#340
Decimal Notation
12 0 123_456 +986
10#1234
Hexadecimal Notation
16#FF 16#ff
16#E0 16#e0
Floatingpoint
numbers
LREAL
8
1.79769313486231e+308 to
2.22507385850721e308,
0,
2.22507385850721e308 to
1.79769313486231e+308,
positive infinity, or negative
infinity
Written as (sign) + integer_part +
(decimal_point) + (decimal_part) + (exponent). You can omit items in parentheses.
Example:
2
12.0
0.0
0.4560
3.14159_26
1.34E-12
1.34e-12
1.0E+6
1.0e+6
1.234E6
1.234e6
* BOOL data is only 1 bit in size but it takes up 2 bytes of memory.
6-18
NJ-series CPU Unit Motion Control User’s Manual (W507)