"Indirect" problem

martin3885

Member
Join Date
Aug 2005
Location
Saarland
Posts
144
Can somebody look at my program and tell me why in FB1 I cannot set bit "DB Objekten".ReiheLaeuft? In matter of fact it is set, but as soon as FB2000 is done it is reset and then I cannot set it once again. And if I want to set thi sbit from FB1000 and FB2000, FB2000
takes over a control of the Objekt[1] in DB10?
In the program Ojekt[1] starts FB1000, Objekt[2] starts FB2000.
I assume that something is wrong with indirect addressing with AR2, but I am not sure if I am right.
 
I'm not answering your direct question, but I think I can see the problem.
You are calling FB1000 and FB2000 from FB1. This means that both FB1000 and FB2000 are operating on the same object data. Is this your intention?
 
So... it is so, that both use DB10, but they should use other objects(FB1000 object[1] and FB2000 object[2]). FB1000 uses DB1000 and FB2000 uses DB2000. I add there a lenght of one UDT after calling FB1000 so I should operate on object[2]. But from the other hand both FBs should also change the state of some bits in DB2 that are not included in UDTs. I think everything should work, but it doesn't.
 

Similar Topics

Hi all, I need to move in the same DB 32 bytes from DBB00-DBB31 to DBB32-DBB64, so I have tried to write a simple code using the indirect...
Replies
3
Views
2,186
Hello I wrote this piece of code to do indirect adressing for a DB using both AR1 and AR2. When I run this code in a FB for situation #Drive_No =...
Replies
5
Views
4,258
Hello, im new using s7-300 and i want to do an indirect adressing: program in AWL that reads its DB1 content through indirect adressing. This...
Replies
4
Views
2,235
i want to have an FB that reads three integer values as input x ,y and z for example then set the bit DBx.DBXy.z 📓
Replies
4
Views
2,202
Hi guys, Disappeared few weeks for writing code, I'm back with a problem. There is a repeating work for different group of signals, so I decide...
Replies
18
Views
15,100
Back
Top Bottom