buhnen
Member
Hi all!
I'm testing a routine that I've just written under STL and I would appreciate some help from someone else more experienced than me with this, as I've just come recently from LAD language.
Either I like it or not, indirect adressing,looping, pointers...are to be implemented under STL in Siemens..And here it comes my sweet honeymoon with STL ...
The case is as it follows: I've 8 DBs, instances of a same UDT, this is, with the same structure for them all. DBs are numbered like this DB100, DB101, DB 102 .... DB108
1) My first testing attempt is very simple and it works out fair enough: By means of the LOOP instruction I call an FC several times (the well known FC105 for scaling an analog input) and asign the right parametres from each of the DB's.
This is the code, which I've succesfully tested:
2) Now I want to bypass the scaling operation for two of the DBs included within the range from DB100 to DB108. Let's say I want to bypass DB104 and DB105.
So I've modified the code posted above to turn it into what follows:
...but here it comes the problem. When I try to test it I can't update the simulation values on my VAT ...It doesn't work...and as far as my fair knowledge on STL allows me to see, this routine makes sense to me
Any hint please?what am I missing out here?
Thanks in advance
I'm testing a routine that I've just written under STL and I would appreciate some help from someone else more experienced than me with this, as I've just come recently from LAD language.
Either I like it or not, indirect adressing,looping, pointers...are to be implemented under STL in Siemens..And here it comes my sweet honeymoon with STL ...
The case is as it follows: I've 8 DBs, instances of a same UDT, this is, with the same structure for them all. DBs are numbered like this DB100, DB101, DB 102 .... DB108
1) My first testing attempt is very simple and it works out fair enough: By means of the LOOP instruction I call an FC several times (the well known FC105 for scaling an analog input) and asign the right parametres from each of the DB's.
This is the code, which I've succesfully tested:
L 100
T #DBINDEX
L 8
META: T #COUNT
OPN DB [#DBINDEX]
CALL "SCALE"
IN :=DBW16
HI_LIM :=1.000000e+002
LO_LIM :=0.000000e+000
BIPOLAR:=FALSE
RET_VAL:=DBW20
OUT :=DBD8
L #DBINDEX
L 1
+I
T #DBINDEX
L #COUNT
LOOP META
2) Now I want to bypass the scaling operation for two of the DBs included within the range from DB100 to DB108. Let's say I want to bypass DB104 and DB105.
So I've modified the code posted above to turn it into what follows:
L 100
T #DBINDEX
L 8
META: T #COUNT
L #DBINDEX
L 103
<=I
OPN DB [#DBINDEX]
JC A
L #DBINDEX
L 106
>=I
L #DBINDEX
L 108
<=I
OPN DB [#DBINDEX]
JC A
JCN B
A: CALL "SCALE"
IN :=DBW16
HI_LIM :=1.000000e+002
LO_LIM :=0.000000e+000
BIPOLAR:=FALSE
RET_VAL:=DBW20
OUT :=DBD8
B: L #DBINDEX
L 1
+I
T #DBINDEX
L #COUNT
LOOP META
...but here it comes the problem. When I try to test it I can't update the simulation values on my VAT ...It doesn't work...and as far as my fair knowledge on STL allows me to see, this routine makes sense to me
Any hint please?what am I missing out here?
Thanks in advance
Last edited: