Function Block

Annie

Member
Join Date
Sep 2005
Location
madras
Posts
22
Hi,
I have created a FB in my program.Had declared an i/p for eg i/p1 in the declaring section.I have called this FB twice in a function using different DB(DB1 & DB2). I have used different i/p addresses(eg I0.0 and I0.1) for this i/p in the function while calling this FB.
I noticed that if I0.0 is switched on in DB1.It shows i/p1 on even in the FB of DB2.
Can someone post me an eg of defining a FB and also calling the FB twice in a function.
Can we define fixed timers in a FB and give its preset value as a variable to change it depending on the FB call?

Regards
Annie
 
Are you looking at the status of DB2 directly, or are you looking at the status of the FB?

The FB will be inconsistant unless you tell the editor that you want to status the FB only whilst DB2 is the instance DB.
 
Where are you calling the DB i.e

C DB1
JU FB1
dec = d0.0
C DB2
JU FB1
Dec = D 0.1
or are you calling the DB within the function block?
JU FB1
DB= DB1
Dec = D0.0
JU FB1
DB = DB2
etc.
and in the FB
DO= DB
== Dec
sorry my S5 is a bit rusty but I think you get the idea.
 

Similar Topics

Hi, I have attached herewith one image which our programmer has been used in S7 1500 PLC. Now we need to use the same instructions in S7 1200 PLC...
Replies
4
Views
146
Please see attached file. I need this program in Function Block form but I am totally lost on this. Any help would be appreciated. Thanks!
Replies
8
Views
335
Hi! I am using a TM200CE40T PLC from Schneider to write data over Modbus. I have used Memory words (%MW) before using the Write variable...
Replies
1
Views
553
Hi folks. New to the forum, but been working with PLCs for several years now. Would like some advice on whether you would keep this logic, or...
Replies
9
Views
1,091
Hi Yes, I'm stuck again. Trying to define a Function Block. What I've put in there so far has been a straight copy/paste from the code (and that...
Replies
22
Views
3,028
Back
Top Bottom