Problem starting S7-GRAPH FB

RMA

Member
Join Date
Sep 2004
Location
North of Hamburg, Germany
Posts
2,052
I had this problem a few months ago when I first started playing around with S7-GRAPH, but I eventually got rid of, without really knowing how.

Now it's back again - I've got two S7-GRAPH FBs which are called cyclically in OB1. The actual run-control is done using the "OFF_SQ" and "INIT_SQ" signals using M-Bits. The first FB is launched by a Button in ProTool and it launches the second one by resetting the OFF_SQ Bit and setting the INIT_SQ Bit in the program (originally this should have been all one FB, but it got too big and had to be split).

On occasion, (and I haven't yet been able to determine why), the lauch of the second FB will work correctly, but usually it doesn't start, although in OB1 Online and in the VAT the Bits are set correctly. In that case, if I go Online in S7-GRAPH and use the "Test" facilities to re-initialise it, then the program always runs normally.

Unfortunately, I can't go back to the system and test further, because the hall's been shut down for the night.

The only thing I can think of, is that the control Bits, "OFF_SQ" and "INIT_SQ" are Bits in the same Byte. I thought the problem might be that the time between the OFF Bit going OFF and the INIT Bit switching ON, so I moved them so that clearing OFF is the first action and setting INIT, the third action, but that didn't have any effect.

According to the S7-GRAPH description, the actions are executed in sequence, but now I'm wondering, could it be that S7-GRAPH is a little too clever for its own (and my!) good and if it notices that actions in one Step are accessing the same Byte (or Word, etc.), that it bundles these operations and outputs the Byte, Word, whatever, all in one go.

Anybody any ideas?
 
Last edited:
Am I getting cynical in my old age

or is it only in my imagination that I get the impression that Siemens intentionally leaves information about simple, yet absolutely fundamental functions out of the manuals in order to force you to do one of their (VERY expensive) training courses to find this information?

The electrical guys are still doing one step forward, two steps back, trying to find out why we have no power on the charger, so I still can't access the system to go looking for my S7-GRAPH problem.

HOWEVER, I have now discovered, that for the 1st SFC, which starts and runs fine, nowhere in the program am I actively switching the "OFF_SQ" input OFF (at least I can't find anywhere, neither in Cross-Reference, nor in ProTool), but when I look in the VAT, sure enough, it's been turned off! Is it being turned OFF by S7-GRAPH itself, when the program receives the "TRUE" on "INIT-SQ" to start it!

All the SFCs have their "OFF-SQ" inputs set TRUE by a RESET program which runs at start-up and various other defined times and that is definitely working OK.

I'm trying to control the SFCs purely with these two signals - in Siemens own simple examples, they actually only use "INIT-SQ". At the moment, in the 1st Action in SFC1 I'm resetting the "INIT-SQ" signals for both SFC1 and SFC2 so as to be sure to get an edge when I next call them - well, perhaps I should say, next time I want them to run, because they're actually being "called" in OB1 every cycle. Then at a later stage in SFC1, when I want SFC2 to run, I set SFC2's "OFF-SQ" FALSE (probably unneccesary because of the edge-triggering) and "INIT-SQ" TRUE and wait for the M-Flag to come to tell me that SFC2 has succesfully completed. In SFC2, in the 1st Action, SFC2s "INIT-SQ" is set FALSE.

Can somebody please tell me which signals I should best use to control the SFCs and how exactly I should use them. At the moment, not having a system to test on, I feel like I'm going round in circles and just wasting time!

EDIT: It's just occurred to me that since all the control signals are edge triggered, it shouldn't matter whether or not I switch, "OFF-SQ" off or not, but I think that's just confused me even more!!
 
Last edited:
Just a quick post to point out that I added the bit in italics after the initial post, i.e. after the edit where it occurred to me that the control signals were all edge-triggered.
 
We finally got the system sorted out and back up and running and I'm glad to say that using the sequence described above, my SFCs are now behaving themselves.

I suspect that under some circumstances the "INIT-SQ" signal for SFC2 was not getting reset, so that there was no edge to restart the program.

Funny how often trying to explain a problem to somebody else helps you understand it better yourself!

Thanks to anybody who took the time to try and figure out what the problem might be.
 
Last edited:
Roy

I didn't see this thread at all until this point, but it's always fascinating listening to someone arguing with themselves while they fix a problem!!

Well done, and I hope you gave yourself a pat on the back for resolving your issue.

Ken
 

Similar Topics

I am working on a project and I have CP6706-0001-0050 where I need to make PLC + simple VISU. It has all licenses and PLC is running fine. But...
Replies
9
Views
7,124
I am using a ML1400 for a project, the problem arising is that the PLC is not powering up completely. The POWER LED and the Fault LED, both are...
Replies
13
Views
10,129
I have started using the crimson 3.0 software and I have run into problems right away when it comes to how I use my program. I try to use the...
Replies
2
Views
2,621
Hi All, What would be the cause of heavy jerking of our crane during long travel operation? Here is the scenario; The time I issued a command...
Replies
31
Views
11,830
we have a plc s7 300 and we faced problem the computer cannot open the program directly by clicking on icon. the program doesnot runing exept it...
Replies
1
Views
1,449
Back
Top Bottom