shared data-block

Greet

Member
Join Date
Aug 2003
Location
Mol
Posts
58
Is it possible to put a shared data-block in the Variable declaration table of a FB ?

I have a FB where I use the data of a shared DB, so I use the OPN DB instruction in my FB.

I have to do this four times for a different DB, but the instructions in the FB stays the same --> can I use one FB and four DB's? I use the DB's also in other FB's (that's why I've made a shared DB)
 
Hi Greet,

If I understand, you are using S5-program.

Indirect DB opening working like this (German):


L KF 10 ; LIKE OPEN DB10
T MW 50 ; (FW 50 in english)
B MW 50 ; NEXT COMMAND OPERATION PART USES MW 50 CONTENTS (DO in english)
A DB 0 ; MUST BE '0', SO PROGRAM OPENS DB 10 (C in english)



You can use formal parameters as well.

br.Seppo
 
Last edited:
Thanks, but it is in S7 that I want to do that. So then I have to make a variabele table wher I want to put my DB in.
 

FC ??

1s't split: Declarations

Address Declaration Name Type
0.0 in DB-Number INT
2.0 in DB-Word INT
etc...

2n'd split: program

AUF DB[#DB-Number]
L DBW[#DB-Word]
etc.


in FC ?? Call could be :

CALL FC ??
DB-Number :=50 -- selected DB-Number
DB-Word :=10 -- selected DB-Word
etc..

 
Question: Are you using an FB (Function BLOCK) or FC (Function CALL)?

If a function block, you can add a DB number as an input parameter, then just open it in the block to reference 4 different DB's.

If a function call, you can do the same thing, or you can pass actual structures in and out of the call.
 
it is in a Function Block that I want to call these DB's.

I tried it out, but it doesn't work: faultmessage: "no indirect operations for FB parameter DB-num". (DB-num is the name of my INT-variabele)
 
Greet said:
it is in a Function Block that I want to call these DB's.

I tried it out, but it doesn't work: faultmessage: "no indirect operations for FB parameter DB-num". (DB-num is the name of my INT-variabele)

Try like attached.
 
Greet said:
it is in a Function Block that I want to call these DB's.

I tried it out, but it doesn't work: faultmessage: "no indirect operations for FB parameter DB-num". (DB-num is the name of my INT-variabele)

Try like attached.

step7.jpg
 
I guess I'm just now sure of what you want to do.

If you want to use a function block, and only one block, to control several different devices (ie. motor starter block), you can make it multi-instanced.

The example Seppo gave is for a function call, I'm not sure right now if that is applicable.
 
Thanks rdrast.

Personally I don't use FB-programs if it is not necessary. It needs own DB-block(s). In this case, I think FC-block is enough, where flexible indirect DB-Number can be one input-parameter in FC-CALL.
 

Similar Topics

Hello all. Is it possible to create a shared folder between my laptop and my PV+ 7- standard......2711P-T10C21D8S Series D? What I would like to...
Replies
4
Views
435
Hi All, i'm upgrading a [3x] GE 30-90 system that extensively uses %G Global Genius Tags via Genius bus. This is changing to RX3i (CPE310)...
Replies
3
Views
567
Hello, is it possible to create a data block, something like shared datablock in Siemens STEP 7, in the RS Logix5000 PLC project? I would like...
Replies
3
Views
1,065
Hello CODESYS experts, once again I need help. Trying to setup a PROFINET device which supports shared device function, has four (4) IO modules (2...
Replies
1
Views
882
I'm working on a project using a few kinetix 5500 drives, and I can't seem to get a straight answer from co-workers on power setup. I know you...
Replies
4
Views
1,717
Back
Top Bottom