S5: FB, PB and FX

Jobbe

Member
Join Date
Jul 2005
Location
Antwerp
Posts
159
Hi,

I know what a PB and FB function is in a Siemens S5 PLC, but what is the difference between a FX and a FB/PB? And what about a DB and a DX, are they the same?

TIA,
Jobbe
 
FX and DX were extended blocks. I saw them in machine tool applications a lot. Thinking back, I think they were functionally the same as FB/DBs, and I assumed that they existed for those cases where the number of normal FB/DBs simply wasn't enough.
 
The earlier PLC's (115u's, 150u's etc) had memory restrictions and addresses were based on bytes (0 to 255).

When they could expand the memory and offer more blocks, to maintain existing instructions based on bytes, they had to create new 'extentended' blocks, FX's DX's. These were addresses with words which allowed larger than 255.

These were only present in the 'newer' PLC's, 135u's and 155u's.

Can't remember if 'newer' and larger 115u's ever had them.
 
there was a newer version of the 115 (945) processor, this was almost the same as a 155 but in a 115 style & size.
the extended blocks could only have 255 segments as with 255 blocks the only reason for the "X" range was so that the software was compatible i.e. everything max 255, however you could create Data blocks larger than 255 words but you needed 20 bit addressing to access words above 255, the easy way was to find the stored location of the block (this was stored in an area like a directory that gave the actual db header start address) then add the offset of the word you wanted + header length for a pointer & load the direct dw, or something like that it's a long time ago now.
In fact you could use this addressing to modify mc5 code held in a db & execute the code using the rs instruction but you would need to know what you are doing.
A good example is I came across some code that looked at the availlable memory left after download of program, generated a DB to fill the rest in the startup ob, but after initial boot you could not modify code as there was no room left?.
 
FX's and DX's exist in S5-115U CPU945, and in all CPU's in S5-135/155U.
They were designed as extension to FB's and DB's (give programmer ability to use more program and data blocks) and are almost the same.
Main differences between FB/DB and FX/DX:
1. Larger code for FX calls (DOU FX, DOC FX are 2 word instructions while JU FB and JC FB are 1 word instructions).
2. Larger code for DX open instruction (CX DX - 2 words while C DB - 1 word).
3. Main difference: FX's and DX's cannot be passed as formal operands to other blocks and their calls cannot be combined with DO FW (DO DW).

And...
Their available numbers are still reduced to the range of 1-255 (in some CPU's 3-255, DX0-DX2 may be used for CPU configuration).
 
Last edited:
Parky...
You don't need 20-bit addressing to access words above 255. There are different methods to access them, especially in some CPU's in S5-135U.
 
Back
Top Bottom