DATA TYPES
PICC standard

Type Size Range Example
VOID 0 bits None  

SHORT
INT1

1 bit 0,1  
CHAR
INT
INT8
1 byte 0 to 255
0 to (28 -1)
 
LONG
INT16
2 bytes 0 to 65535
0 to (216 -1)
 
INT32 4 bytes 0 to 4294967295
0 to (232 -1)
 
FLOAT 4 bytes    
STRUCT
These follow the same rules for placement in and out of function blocks as the other variable types.
Variable As built //this defines the structure
STRUCT
box {
    char length;
    char width;
    char height;
};

//this defines the structure and creates variable box3
STRUCT
boxx {
    char length;
    char width;
    char height;
} box3;

//this defines the structure and creates/initializes box4
STRUCT
boxxx {
    char length;
    char width;
    char height;
} box4 = {1,2,3};

//this creates variable box1 as a "box" structure
STRUCT box box1;

//this creates and initializes box2
STRUCT box box2 = {1,2,3};

//this uses the variable
box1.length = 1;
box1.width = 2;
box1.height = 3;

Any questions or comments?
 This page last updated on August 28, 2011