 |
plc.myforum.ro PLCs users www.plc.myforum.ro!
|
| View previous topic :: View next topic |
| Author |
Message |
mascalzone Junior

Joined: 20 Nov 2016 Posts: 11
|
Posted: 14/01/2017 19:07 Post subject: Siemens Count value save to DB |
|
|
Count value save to DB
| Code: |
FUNCTION "Count_value_save_to_DB" : VOID
TITLE =
VERSION : 0.1
BEGIN
NETWORK
TITLE =Reset M 30.5 "Reset_complete"
A( ;
L "Data time".Time_hour_int;
L 8;
<>I ;
) ;
A( ;
L "Data time".Time_hour_int;
L 20;
<>I ;
) ;
O ;
A T 89;
R "Reset_complete";
NETWORK
TITLE =Aux for reset memory bit of bottling record
AN "Button_OP_panel";
L S5T#500MS;
SD T 89;
A T 89;
R "M_reset";
NETWORK
TITLE =Transfer data from DBs to DB of shift information
CALL "BLKMOV" (
SRCBLK := P#DB1.DBX0.0 BYTE 36,
RET_VAL := MW 160,
DSTBLK := P#DB3.DBX10.0 BYTE 36);
CALL "BLKMOV" (
SRCBLK := P#DB2.DBX6.0 BYTE 10,
RET_VAL := MW 160,
DSTBLK := P#DB3.DBX0.0 BYTE 10);
NETWORK
TITLE =Transfer data from DBs to DB of bottling cycle information
CALL "BLKMOV" (
SRCBLK := P#DB1.DBX36.0 BYTE 36,
RET_VAL := MW 160,
DSTBLK := P#DB5.DBX10.0 BYTE 36);
CALL "BLKMOV" (
SRCBLK := P#DB2.DBX6.0 BYTE 10,
RET_VAL := MW 160,
DSTBLK := P#DB5.DBX0.0 BYTE 10);
NETWORK
TITLE =Exploiting of push to button of OP-17
A "Button_OP_panel";
L S5T#2S;
SD "Timer_button";
A "Timer_button";
= "M_Button_Reset";
NETWORK
TITLE =Set mem.bit after writing of shift data to DBs
//to watch the time. When there is 08.00 or 20.00 exploit of Shift record, when
//I
//will push button exploit shift record and exploit end of bottling cycle and
//record bottling cycle.
A( ;
A( ;
L "Data time".Time_hour_int;
L 8;
==I ;
) ;
A( ;
L "Data time".Time_minute_int;
L 1;
==I ;
) ;
A( ;
L "Data time".Time_second_int;
L 0;
==I ;
) ;
O ;
A( ;
L "Data time".Time_hour_int;
L 20;
==I ;
) ;
A( ;
L "Data time".Time_minute_int;
L 1;
==I ;
) ;
A( ;
L "Data time".Time_second_int;
L 0;
==I ;
) ;
) ;
AN "Reset_complete";
O ;
A "M_Button_Reset";
AN "M_reset";
JC rst;
BEU ;
rst: CALL "FIFO DBs" ;
L 0;
T "Data of count".Data_Fotocell_1;
T "Data of count".Data_Fotocell_2;
T "Data of count".Data_Fotocell_3;
T "Data of count".Data_Fotocell_4;
T "Data of count".Data_Fotocell_5;
T "Data of count".Data_Fotocell_6;
T "Data of count".Data_Fotocell_7;
T "Data of count".Data_Fotocell_8;
T "Data of count".Data_Palletazer_fcell;
SET ;
= "Reset_complete";
A "M_Button_Reset";
AN "M_reset";
JC Cycl;
BEU ;
Cycl: UC "FIFO bottle sycle";
L 0;
T "Data of count".Count_depal_enter;
T "Data of count".Count_depal_exit;
T "Data of count".Count_bloc_exit;
T "Data of count".Count_bloc_aft_trash;
T "Data of count".Count_labell_enter;
T "Data of count".Count_labell_exit;
T "Data of count".Count_labell_exit_trash;
T "Data of count".Count_termoupac_exit;
T "Data of count".Count_palletazer_enter;
SET ;
= "M_reset";
END_FUNCTION
FUNCTION "FIFO DBs" : VOID
TITLE =FIFO at once BLCMOVE
VERSION : 0.1
BEGIN
NETWORK
TITLE =Transfer data to intermidiate DB
CALL "BLKMOV" (
SRCBLK := P#DB3.DBX0.0 BYTE 2928,
RET_VAL := MW 60,
DSTBLK := P#DB4.DBX0.0 BYTE 2928);
NETWORK
TITLE =Move to step
CALL "BLKMOV" (
SRCBLK := P#DB4.DBX0.0 BYTE 2928,
RET_VAL := MW 60,
DSTBLK := P#DB3.DBX48.0 BYTE 2928);
END_FUNCTION
FUNCTION "FIFO bottle sycle" : VOID
TITLE =
VERSION : 0.1
BEGIN
NETWORK
TITLE =
CALL "BLKMOV" (
SRCBLK := P#DB5.DBX0.0 BYTE 2928,
RET_VAL := MW 60,
DSTBLK := P#DB6.DBX0.0 BYTE 2928);
NETWORK
TITLE =
CALL "BLKMOV" (
SRCBLK := P#DB6.DBX0.0 BYTE 2928,
RET_VAL := MW 60,
DSTBLK := P#DB5.DBX48.0 BYTE 2928);
END_FUNCTION |
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group Fa-ti si tu propriul forum GRATUIT, pe www.myforum.ro
|