Siemens scan sequence

My understanding is that the standard for PLC programming, IEC 61131-3, says that you technically aren't supposed to read a tag marked as an output. If you are using an FC, it won't remember the value of the output from last scan, so it might return as an error.

Because you are using FB's, it does recall the value of the output from last scan. This means that it will allow you to do it, but warns you to make sure it is actually what you want to do.

I think the settings have a checkbox for "IEC check" that you can turn off, but I don't recommend that. The method I typically use is the same thing Joltron said, to use STATs as all the internal tags, and then set the outputs at the end of the block. If I want to read the value of an output, I'll typically create the output as #tagname and then make the STAT value #tagname_internal or #tagname_stat. Then at the end of the block, I set #tagname to the value of #tagname_internal.
 
Thanks all, that clears up a lot! Marcius, yes, what I refer to as "faceplate" is where you call the AOI (or in this case, FB) in the ladder logic. So you see a block showing the inputs and outputs and their status. I'm not sure if "faceplate" is the correct term, but it makes sense to me :)

Thanks for the link Brian, one of the posts above linked to that document and you're right, it's very helpful in teaching you how to Think Like A German ;)

Can anyone shed any light on this one?

1. I've declared all of my things like "overload" and "open feedback" as [function block] inputs, and all of my "contactor" and "solenoid" and "alarm" as [function block] outputs. When I try to use a contact to read the status of an output (e.g. as a hold in circuit), it shows up orange and I get a warning. The FB will still compile and work fine, but I just get 40 warnings. Is there a different way I should be doing this?

You have declared it as an output and you try to use it as an input, this is why it gets orange I think.

Declare it as a in/output instead to make it work. However I don't like this solution, because the input/output will be on the left side of the FB (input side). Instead use a static memory to make the output true, and then use the static memory in your programming to make hold in circuits and so on.
 
Thanks guys. I was hoping I wouldn't have to do that, because it's a fair bit of messing about, but I think eventually my OCD will win out over my If It Ain't Broke Don't Fix It and I'll go through and tidy it all up :)
 
My understanding is that the standard for PLC programming, IEC 61131-3, says that you technically aren't supposed to read a tag marked as an output. If you are using an FC, it won't remember the value of the output from last scan, so it might return as an error.

As with TEMP vars it does remember them from the last FC call, which in the case when the FC is used only once, is the last scan.
So don't read them before you write them
 

Similar Topics

Hi, I want to initialise some tags on first scan only. As they are related to wall-clock time, I want to do the initialisation when the PLC first...
Replies
4
Views
1,176
I am working with a Siemens 1500 in portal, and I want to know if my Profinet inputs can change during the scan of the PLC code. When do local...
Replies
8
Views
2,780
Dear all plz want to check my application from Virus and searching for agood too to do this plz help (program - tool - ...etc)
Replies
0
Views
1,989
Hi, I wanted to know the scan time of a Siemens S5-115U 943 PLC. I couldn't find a way to measure through the PLC so I have wrote a little bit...
Replies
2
Views
6,030
Hi! Is there any "system bits" in siemens PLC's? I whould like to find a bit that is "1" only in the first scan cycle. Or at the start up of...
Replies
6
Views
20,944
Back
Top Bottom