Hello PLC gurus,
i would like to ask you for your help.
I have a little problem with indirect addressing, also with ST language.
My problem.
I have two DBs, where i have to take pointer from these and add this pointer to function like input.
and in next step i have to jump to another row in DB and add to input again after all rows in DB will be done.
Thank you for your help
i would like to ask you for your help.
I have a little problem with indirect addressing, also with ST language.
My problem.
I have two DBs, where i have to take pointer from these and add this pointer to function like input.
and in next step i have to jump to another row in DB and add to input again after all rows in DB will be done.
L DW#16#A // NUMBER of DB
T #NUMBER_DB1 // z ACC1 do #NUMBER_DB1
L DW#16#2 // ACC110tka se presune do čísla
T #NUMBER_DB2
L 0
T #INDEX
CALL "TEST_DB"
DB_NUMBER :=#NUMBER_DB1
RET_VAL :=#Ret_Value
DB_LENGTH :=#LENGHT //lenght of DB #NUMBER_DB1 in word
WRITE_PROT:=#WRITE_PROT
OPN "IDB CM DD Valves" // i think can be OPN DB[#NUMBER_DB1]
LAR1
TAR1 #BaseAdrPointer_DB1
OPN "MT"
LAR1
TAR1 #BaseAdrPointer_DB2
Next: L #INDEX
INC 1
T #INDEX
//DB1
L #INDEX
L 20 //how many bites are for on row in DB
*I
SLD 3
LAR1 #BaseAdrPointer_DB1
+AR1
// TO temp_pointer_DB1 I dont know how can i transfer AR1 to Temp_pointer_DB1 (ANY) this was first idea
L D [AR1,P#0.0]
T LD 0
L D [AR1,P#4.0]
T LD 4
L W [AR1,P#8.0]
T LW 8
//DB2
L #INDEX
L 30
*I
SLD 3
LAR1 #BaseAdrPointer_DB2
+AR1
//TO Temp_pointer_DB2
L D [AR1,P#0.0]
T LD 10
L D [AR1,P#4.0]
T LD 14
L W [AR1,P#8.0]
T LW 18
CALL "CM DD MT"
CM :=#Temp_pointer_DB1 //input is type ANY
NHT_MT:=2.000000e+003
CM_MT :=#Temp_pointer_DB2 //input is type ANY
L #INDEX
L 20
*I
L #LENGHT
==I
JC Next
Thank you for your help
Last edited: