Motion Control... and More.
RMCTools Online Help
Data Types

Data Types

Data Types

The RMC data have the following internal types:

 

Data Type

Description

REAL

32-bit floating point number.

When typing a REAL number, it must include a decimal point, or RMCTools will assume it is a DINT.

DINT

32-bit integer number.
When typing a DINT number, it must not include a decimal point.

DWORD

32-bit string of bits.

Each bit in a DWORD data type is a boolean and can be individually addressed by adding "." and then the bit number.
Example:
MyDWordVariable.12 is a boolean.

Note:
The DWORD and DINT data types are not interchangeable. A function that requires a DINT will not accept a DWORD. Use a conversion function to convert a DWORD to a DINT or a DINT to a REAL.

BOOL

Boolean, 1 bit, either True or False.

For discrete I/O, On = True, Off = False.

As a bit in a DWORD, 1 = True, 0 = False.

 

Each bit in a DWORD data type is a boolean and can be individually addressed by adding "." and then the bit number.
Example:
MyDWordVariable.12 is a boolean.

 

To find the data type of a register, use the Address Selection Tool, or the Register Maps.

Arrays

An array is a numerically indexed sequence of elements of the same data type. The RMC supports arrays of each 32-bit data type: REAL, DINT, and DWORD. See the Arrays topic for details.

Internal versus External Data Types

Some registers have different data types depending on whether they are accessed from user programs or externally, such as from a PLC. The RMC150 Register Map and RMC70 Register Map topics list the external and internal data types of the registers. When reading from and writing to registers in the RMC via one of the communication protocols, use the external data type.

The different external and internal data types are intended to make it easier to communicate with the RMC. Some registers that are DINT or DWORD internally are a REAL externally, so that the PLC does not have to deal with may different data types.

Converting Data Types

When used in expressions, data types can not be mixed without explicitly converting them. The following functions convert data to different data types:

  • REAL_TO_DINT(a)

  • DINT_TO_REAL(a)

  • DWORD_TO_DINT(a)

  • DINT_TO_DWORD(a)

 

See the functions topic for usage details.

 

See Also

Data Type REAL | Data Type DINT | Data Type DWORD | Data Type BOOL


Copyright (c) 2005-2012 by Delta Computer Systems, Inc.