Introduction to Data Types and Parameter Types
All the data in a user program must be identified by a data type. The following data types are available:
• Elementary data types provided by STEP 7
• Complex data types that you yourself can create by combining elementary data types
• Parameter types with which you define parameters to be transferred to FBs or FCs
Statement List, Ladder Logic, and Function Block Diagram instructions work with data objects of specific sizes. Bit logic instructions work with bits, for example. Load and transfer instructions (STL) and move instructions (LAD and FBD) work with bytes, words, and double words.
A bit is a binary digit “0” or “1.” A byte is made up of eight bits, a word of 16 bits, and a double word of 32 bits.
Math instructions also work with bytes, words, or double words. In these byte, word, or double word addresses you can code numbers of various formats such as integers and floating-point numbers.
When you use symbolic addressing, you define symbols and specify a data type for these symbols (see table below). Different data types have different format options and number notations.
This chapter describes only some of the ways of writing numbers and constants. The following table lists the formats of numbers and constants that will not be explained in detail.
Size in Bits
8, 16, and 32
B#16#, W#16#, and DW#16#
8, 16, and 32
Time of day