Szabycsek
Member
Hy Experts,
I have some problem with this intsructions:
- CREA_DBL
- READ_DBL
- WRIT_DBL
I want to create a recipie management in 314 CPU via TIA Portal V13 SP1 based on MMC card with STL language. I can write the user program by manuals. Only have one same problem for three instruction. Program is working when I write direct andress (not any pointer) to the source or destinatination area like this %DB500 or anything else.
But... I must need the any pointer beacuse the source and the destionation are variables in HMI.
Anybody can help me how to create the any pointer for three instructions?
The working method:
DB 500 is an actual recipie on PLC CPU (working memory).
DB501...DB600 are stored recipies on MMC card (load memory).
User can select for example DB555 recipe and load it. If DB555 not exist CREA_DBL creat it and after READ_DBL read it to DB500. If exist only READ_DBL read it to DB500.
Save method is the same... DB500 save to DB555 for example. If DB555 not exist CREA_DBL create it and after WRIT_DBL write DB500 to DB555. If exist only WRIT_DBL write DB500 to DB555.
The DB exist scan i used TEST_DB instruction and it"s working fine. Only the any pointers not working...
Thanks for a help
Here is a section of code with WRIT_DBL instruction:
I have some problem with this intsructions:
- CREA_DBL
- READ_DBL
- WRIT_DBL
I want to create a recipie management in 314 CPU via TIA Portal V13 SP1 based on MMC card with STL language. I can write the user program by manuals. Only have one same problem for three instruction. Program is working when I write direct andress (not any pointer) to the source or destinatination area like this %DB500 or anything else.
But... I must need the any pointer beacuse the source and the destionation are variables in HMI.
Anybody can help me how to create the any pointer for three instructions?
The working method:
DB 500 is an actual recipie on PLC CPU (working memory).
DB501...DB600 are stored recipies on MMC card (load memory).
User can select for example DB555 recipe and load it. If DB555 not exist CREA_DBL creat it and after READ_DBL read it to DB500. If exist only READ_DBL read it to DB500.
Save method is the same... DB500 save to DB555 for example. If DB555 not exist CREA_DBL create it and after WRIT_DBL write DB500 to DB555. If exist only WRIT_DBL write DB500 to DB555.
The DB exist scan i used TEST_DB instruction and it"s working fine. Only the any pointers not working...
Thanks for a help
Here is a section of code with WRIT_DBL instruction:
Code:
//Create source any pointer
LAR1 P##FOR_ANY
L B#16#10
T LB [ AR1 , P#0.0 ]
L B#16#19
T LB [ AR1 , P#1.0 ]
L 1
T LW [ AR1 , P#2.0 ]
L 0
T LW [ AR1 , P#4.0 ]
L W#16#1900
T LW [ AR1 , P#6.0 ]
L #DB_FOR
T LW [ AR1 , P#8.0 ]
//Destination any pointer
LAR1 P##CEL_ANY
L B#16#10
T LB [ AR1 , P#0.0 ]
L B#16#19
T LB [ AR1 , P#1.0 ]
L 1
T LW [ AR1 , P#2.0 ]
L 0
T LW [ AR1 , P#4.0 ]
L W#16#1900
T LW [ AR1 , P#6.0 ]
L #DB_CEL_W
T LW [ AR1 , P#8.0 ]
CALL WRIT_DBL
src_type:=Any
REQ :=#REQ
SRCBLK :=#FOR_ANY
RET_VAL :=#DB_STATUS
BUSY :=#DB_BUSY
DSTBLK :=#CEL_ANY