S7 cyclus time

Ok you opn the db from the fb in this case DB153 then you load the value of diw[ar2,P#0.0] lets say AR2=0.0 then it would be db153.DBW0.0
If ar2 would be 4.0 the it would be DB153.DBW4.0
That i think to understand for all the other things i first have to read and test to see what happens

Still don't understand why at the end of network 4 you do this
LAR2 #dwAr2Store;
OPN DI [#iInstanceDBNo];

Or is it something like a loop it is just it is just like that :)

L int
nex1: t loop
..

..
L loop
loop nex1
 
..because in Network 5 you access a STAT variable and hence AR2 and the instance DB must be restored to their correct value for the FB to operate correctly.

Code:
	  T	 #Totaal_gewicht_visueel
 
Ok so it something you just have to do but maybe i overlook something i'm testing this with plc sim but the onlything i see changing is the db nr when i make the code from l dbno to l dino.

whatever is programmed after the loop in network 4 i don't see any value so i added it in a new network to monitor it
 
I did not make it clear, but

Code:
CDB
L DBNO 
T #iInstanceDBNo

Can be replaced with

Code:
L DINO
T #iInstanceDBNo

it just saves one instruction
 
Do you maybe have some manual on this kind of indirect adressing i have been looking on the internet but can't really find something
 
I know the book from hans berger but is the indirect adressing really explained to the level you are using it or is it like some basic siemens manual where
A i0.0
fp M0.0
=Q0.0
is explained

thanks alot

Just to know what do you think in general of my programming is it a good start or is it better to stop learning s7 direct :)
 
Yes, Berger covers all aspects of indirect addressing.

As you have realised, relying on hard-coded offsets will cause you major headaches if you change the layout of UDT's. You need to refer to UDT's symbolically - if you use the right approach Step 7 will update all the necessary blocks if you change the UDT.

So, yes a good start, but be prepared to throw it away and start again rather than modifying it into a knotted mess :)
 
throw away is no problem i allready did that 4 times :)
Before i tried it once with sfc 21 and any pointers could have been sfc 20
it was more to learn handeling anypointers in a variable way but i noticed that for a very short code you have a big FB so now instead of moving a string around i callculated the offset as int and show it on the screen works perfect and isn't so big

I will order the book i readed alot about it but never wanted to buy it because haven't ever seen what is in it (good or bad, alot of explanation or no explanation, basic stuff or advanced). And in the end it is expensief 120€
 
Here's an example page:


bert.JPG
 
Back
Top Bottom