Sign in to follow this  
Followers 0
plchomer

tracking down bit locations in step 7

8 posts in this topic

Greetings

I have a nice new s7-400 program to modify and troubleshoot using step 7.

Now my problem is this code if full of bits being used globally which do not show up in the cross reference as having been written anywhere.

For instance DB77.DBX1.3  has no point where cross reference can find it is set.

So I find the Function block where db77 is an instance.  Lets say FB35

In FB35  where DB77 is an instance I find that 1.3 is in the input section,  .. awesome eh?

This code is full of this type of usage.  In the past I have found that the solution is

where FB35 is called a logic input value at the call site is fed into a FB35 input and my mystery

bit is being set that way.

My two questions

1    I apparently need to be able to find every instance of a call to FB35 to track down the status of this bit.

      and how can I do this in step 7.

 

2   Is this programming method considered as bad policy as the many four letter words floating about my cube.

 

Thanks

 

 

 

 

 

 

 

Share this post


Link to post
Share on other sites

Hi,

Did you use cross reference?

It was not enough? Then use cross reference create with PG2000. It is more deep...

dekor.

Share this post


Link to post
Share on other sites

If the Data Bit used in the program is in an Instance DB, which is linked to an Input point of the FB call, the way to find where its set is to search for the Input tag. i.e if the tag connected to the input of FB35, where DB77 is the instance, is M100.6 then search for M100.6.

Is it good practice, without seeing the program I don't know why they did this. Its fairly common to use Instance DB bits in the program elsewhere, but unsure why they would use a bit/byte/word attached to an actual I/O point to the FB, it seems to me to be easier to use the actual I/O point. It could be its a common program where they change the actual I/O points but the main program is standard and the same, this way using the I/O Instance DB point sort of makes sense.

Why do you need to find every instance of call to FB35??, DB77 is only the instance DB for one single call, any other call would use a different DB.

 

 

Share this post


Link to post
Share on other sites

Well at this point I don't know how to find the one call to FB35 that has DB77 as an instance so yes I only need to find the right call.

I assumed I would have to look at all of them to find the right one.  I am a noob at this stuff, having to learn on the job..

It seems that any modification should be done in an output section of the instance block making finding the call point unnecessary.

Thanks

 

 

Share this post


Link to post
Share on other sites

How many times is FB35 called? You can cross ref FB35 or even DB77 to find it.

An Instance DB is the instantaneous memory for a single FB call, unless they are doing something odd, there should only be one FB35 call with DB77 as its instance DB. This DB stores the I/O to the FB and all the internal memory STAT flags for that one call.  Every call to FB35 should declare a unique DB and that DB cannot then be attached to any other FB (although it could be attached to second FB35 but that would overwrite any status from the previous call).

 

An instance DB also cannot have its format modified, its automatically set up to the I/O and STAT's of the FB its assigned to.

 

 

 

 

Share this post


Link to post
Share on other sites

Groo

Thanks for your patience. You have helped me clear my thinking on this issue. My only question remaining is

how can I find where FB35 is called so I can inspect the logic that feeds the input to the function.

So you say i can cross reference FB35 to find it's call locations.  This I don't know yet how to do with my step 7.

If you can give some guidance I would greatly appreciate it.

 

Thanks

Share this post


Link to post
Share on other sites

I've worked a lot with Siemens, my favourite PLC, but haven't touched one for 4 years now so a bit rusty.

 

You can cross reference or look at the program structure, which is like a block tree showing the block calls starting from OB1.

 

This manual section 14 can help https://cache.industry.siemens.com/dl/files/056/18652056/att_70829/v1/S7prv54_e.pdf

 

If I had the program I'd give you the buttons to press but unfortunately I don't have it, sorry.

Share this post


Link to post
Share on other sites

right click on your blocks folder, Reference Data / Display / Cross References

Filter the display as shown.  it will find where the block call is referencing DB77.

 

crossref.JPG

1 person likes this

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0