Siemens s7-300 declaration problem

DeepThought

Member
Join Date
Mar 2008
Location
Norwich
Posts
52
Hi Guys,

I have a problem with a third party piece of software, the declarations from a called FB within my ladder update but wont save and then they give me an error.

The FB100 called is a timer but its been password protected by the author (not sure if this makes a difference) the FB is being called locally but errors on compilation.
I have attached a screenshot with the error shown at the bottom, thanks for your help in advance.

o_O

fb3.jpg
 
Create a library, insert an S7 progam into the library and then copy the blocks from your project to the library blocks folder. Archive the library and then post it here.
 
Hi DeepThought

Think you need to re-generate the instance data block for FB3 (DB9).

If you open OB1 and go to network 3 DB9 is in red. If you click on DB9 it should as you generate the instance data block, click yes. Then reload the blocks to the PLC.


Jon
 
This still does not remove the problem. By the way instance block for FB3 is DB3. After compiling program again the problem remains. There has to be something inside FB100 that prevents it from being used as multiple instance!?
 
If you cut STAT16 from FB3's STAT declaration table and paste it back in, you can save FB3 with no errors and then open OB1 and regenerate DB3

However, if you open FB3 again, the error re-appears....

Open/Save FB100 resolves the problem.
 
LD is right. Tha same problem occured to me in the past. This should be a bug of SIMATIC. Just try not to change FB3 much. :)
 
educated guess as follows:

FB100 in the original (faulty) project does not have the names of the interface variables stored in the project - this is because it has been uploaded from a plc and FB100 did not exist in the offline project.

The interface variable types are stored though. When you open and save a block with the editor, the editor examines the interface variable types and assigns them names (IN0 etc.) if they do not exist.

As FB100 was a locked block, the editor could not be used to assign names to the interface variables.

When FB3 is opened, then when the editor encounters the first occurrence of FB100 it cannot find any names to associate with the interface variables and the error is reported.

Subsequent references to FB100 use the interface variable types for FB100 stored in FB3

Solution: Third party to provide FB100 from the original project
 
Last edited:
Hi Guys
Thanks for your help I thought it could be the FB100 but with it being locked i could not prove it or explain it your help is always appreciated. Have a good weekend one and all.
 
Should anyone need to fix this type of problem in the future, one method is as follows:

You will need access to a plc or PLCSIM. Ensure FB100 has been loaded into the plc.

Create a library with a S7 program in it and copy FB100 to the blocks folder of the library.

Delete FB100 from the offline folder of the project.

The interface of FB100 is stored in SUBBLK.DBT, and consists of a pair of bytes for each interface variable detailing the data type (01=Bool, 02=Byte 03=char etc) and the interface type (01=IN, 02=OUT 03=INOUT 04=STAT 05=TEMP). If there is a SFB/FB declared in the STAT area, the interface contains the block number and then show the interface of the relevant SFB/FB. With reference to the coding scheme you can search the DBT file to find the relevant hex codes show below:

xx.JPG
 
..continued

Here is the interface de-coded
Code:
01 01 Bool IN
01 01 Bool In
0B 01 Time In
01 02 Bool Out
0B 02 Time Out
01 04 Bool STAT
01 04 Bool STAT
01 04 Bool STAT
01 04 Bool STAT
01 04 Bool STAT
01 04 Bool STAT
0B 04 Time STAT
0B 04 Time STAT
1B 04 SFB  STAT
00 11 
04 07 SFB4, 7 parameters
      01 01  Bool IN
      0B 01  Time IN
      01 02  Bool OUT
      0B 02  Time OUT
      02 04  Byte STAT
      0B 04  Time STAT
      0B 04  Time STAT (end of SFB4 interface)
0B 05 Time TEMP
42 00 End

Once you know the interface, create a new FB100 in the original project (the one you have deleted FB100 from) with an interface as determined above. No code is required in this FB100.

Finally, copy FB100 from the online folder (the plc or PLCSIM) to the offline folder. FB100 will now have a named interface and the original locked processing logic.
 

Similar Topics

Hello all. I have an ESA HMI that is connected to a Simatic S7-300 (CPU312). I have uploaded the program from the PLC which is written with Step7...
Replies
6
Views
1,444
Hello. There is a problem with Siemens S7 300. We got a replacement PLC but it does not run the program from the MMC. The new PLC is dated 2011...
Replies
3
Views
687
Hi to all, Our company does not usually use Siemens PLCs, but have a press with one in it. We are trying to change the IP address in our Simatic...
Replies
2
Views
1,066
G'day guys, I am setting up a s7-300 as a test rig for the workshop and when I downloaded the PLC is not going into run mode, I keep getting a...
Replies
35
Views
5,216
I am trying to write just MSEC to S7 300 Controller date/time using OI.SIDIRECT Aveva communication driver? The old HMI (WINCC) tag is assigned...
Replies
1
Views
1,059
Back
Top Bottom