A little help guys

Matchu04

Lifetime Supporting Member
Join Date
Mar 2013
Location
Northampton
Posts
287
I have been trying to get a better understanding of interface parameters. What I understand is;

- In;
A Input from a calling block

- Out;
A Output from the calling block

- In_Out;
A Parameter that is from the calling block which is processed by the called block and then returned to the calling FB.

- Temp;
A local stack that is used as temperary storage while a the block is being processed. This is then cleared once the block call has finished.

-Stat;
A perminate place to store data that can be asscess globally.

Could someone see if my understanding is correct, or has a better was to explain it, maybe some examples. Im really strugging with the in_out parameter.

I have attached a doc from a seimens manual showing and example project. The motor has been defined as a in_out when I would thought it would be an out.

pic2.jpg
 
I was just about to say this could be the same about the start, and stop. But then I just reread the example and there is multiple motors, but only one start/stop.

If there was multiple start stops these would these have to be in_outs, aswell? I kinka get it but not 100% though
 
No, not necessarily. For that matter the In_Out could have also been an out.

All of this is up to the programmer and how he's implementing the device interfaces (hmi, real i/o, etc) and sometimes just his/her pet peeves. Whatever you decide, make it easy to understand for the next guy.
 
In_out used typically where SET/RESET used - this allows the motor Q to be reset elsewhere, on plc start up for example when all Q's are zero.
 
Last edited:
Im sorry guys but im still not getting it. I understand the princple of a set/reset LD, but could you not do the same if you declared them as in's. Could you explain in more detai?
 
Are you suggesting you could set an in parameter inside the FB and then next time the FB was called the in parameter would be set?
 
No that wouldn't work because the next time the fb was called would it not reset the parameters unless it was a stat?

So if it was declared as a in_out is it saved in the db?
 
All FB parameters/stat are saved in the instance DB.

For inputs and inouts, the values of the parameters passed are copied into the instance DB before before the FB runs.

The FB runs acting only on the data in the instance DB

For outputs and inouts, the values in the instance DB are copied to the parameters after the FB has finished.
 
I think I understand in now. I didn't realise that how it works, i think my problem is i keep thinking that when u have a input high its always high but I forget about the scan time.
 
Note that when you parameterise the simulation FB and call it from with the roller door FB (you will have to call it first, before the roller door code), the simulation FB will now be modifying the contents of the instance DB after the inputs have been copied, but before the roller door code is executed. The actual Inputs will of course not be modifed.
 
I have managed to place the simulator db within the roller door but not parameterised the simulator FB. I will post what I have done shortly.
 
at FB call in params take values from input vars, and out params default to their inital values. if you need to read some values and then change them in FB, or if, for instance, you want to leave some output value as it was then you use in_out var.
 
Been doing alot more reading and I think I have finally got it. LD's comment (quoted below) confirmed this as well, along with an example program that I have been studying.

Basically a fb, fc has a interface with different parameters. These parameters are represenation of actual inputs, outputs data... what ever the programmer decides.

Like LD said all parameters are saved to a IDB when the block is first called. When the FB is then run a in_out parameter might be changed due to the block code but then its stored, with the out parameters in the updated IDB when the call has finsihed. A in parameter wont/cant change due to the block call.

Apologies if I requoted LD but I just wanted to make it easier to for you guys, hope this is correct!


All FB parameters/stat are saved in the instance DB.

For inputs and inouts, the values of the parameters passed are copied into the instance DB before before the FB runs.

The FB runs acting only on the data in the instance DB

For outputs and inouts, the values in the instance DB are copied to the parameters after the FB has finished.
 
The plot thickens......

FC parameters are a whole new ball game. As there is no instance DB associated with an FC, where are the parameters stored and how are they accessed? I'll let you do some more reading before peeling this onion.
 

Similar Topics

Hello, I am trying to replicate a piece of logic on the PLC5 onto an SEL RTAC. I am using ladder on SEL and FBD. I am having issue on the ladder...
Replies
13
Views
226
I am trying to use pylogix to write to a string array ID_Data_Table_Name. In the array there are 200 possible entries. For...
Replies
13
Views
4,028
Hey guys, I have a client that has a v-notch chlorinator that doesn't run off a 4-20mA loop, it instead has two discrete inputs that drive the...
Replies
6
Views
1,872
Hey all. I need some guidance here. This is something I came across today when a Ref guy noticed that the HMI isn't displaying the correct time...
Replies
2
Views
1,457
i am a beginner plc programmer and have some confusion, a little help would be appreciated . why do we use a normally close contact when we are...
Replies
11
Views
3,087
Back
Top Bottom