Editing of a Block Header

Top  Previous  Next

 

You will only have to edit the block header if you want to provide the block with parameter or if you need static / temporary variables. After each changing of the block header you should check all calls of this block. The fastest way to do so is by the cross-reference list, just double click each entry of the block.

 

Description of the columns

 

 

In the first column the automatically specified address is displayed. A new declaration type always starts on an even address. With function blocks the numbering of the temporary variables starts with zero again, because these variables are not saved together with the other values in the instance-DB but on the stack.

In the second column you recognize the declaration type. Which declaration type a parameter / variable gets is specified by the position in the table (see a little bit further down).

In the third column you enter the name, do not use any special characters except for ‘_’ and no space characters. And the name must not start with a number. In the column type you enter the data type. You only have to enter the letters of the name of the type that are enough to specify the type. The following data types are available:

 

 BOOL, BYTE, INT, WORD, DINT, DWORD, TIMER, COUNTER, S5TIME, TIME, DATE, BLOCK_DB, BLOCK_FB, BLOCK_FC, POINTER, ANY, ARRAY, STRUCT .....

 

In the column default it is best not to enter anything first. Then the system enters a zero value automatically in the correct format which you can adjust to your requirements afterwards.

In the comment line you should enter an as precise as possible description of the variables.

 

Insert new lines

Put the cursor on an already existing line of the desired declaration type. If you want to insert a new line in front of it you will have to press the key ‘Ins’, if you want to insert a new line behind it you will have to press the ‘Return’ (enter) key several times.

 

Delete lines

Put the cursor on the first column or click it. If you press the space bar the whole line will be marked. With the key ‘Del’ you delete the line. If you press the ‘Shift’ key at the same time the line will be saved in the clip board and you can insert it at another position (but not in another block) with ‘Shift’-’Ins’.

 

Change the declaration type

As the declaration type is specified by the position in the block header you will only be able to change the type by marking the line (select field ‘Address’ and press space bar then), cutting out with ‘Shift’-‘Del’ and inserting with ‘Shift’-‘Ins’ in the correct section again.

 

See also:

Edit OBs and FBs

PLC-Editor