Step7. Calculating of quantity of bottles (trays)

No, it isn't necessary to use an instance data block at all. You can use local variables instead. The minimum you would need to do to see the function work is create Return and Date_Time variables in OB1, and then then call SFC1 directly from OB1. Then, you can monitor the individual local bytes and see the values change to verify that it is working.
 
I have found samle in Help system of Step7. There was FC10 for control and read system time. Then I copy this cource into my project and then compile it. Now I must tune it under my requests
 
Convert

All OK. FC10 work. Now I must whrite to OP-17 current quantities of productions (machine 1, macnine 2, machine3, machine 4) along with data and time. This must be one string like:
12; 22; 33; 234. 2004-3-8 08.00
21; 18; 25; 200. 2004-3-8 20.00
11; 43; 34; 222. 2004-3-9 08.00
etc history is one last month

I have data format 16#143c or 5180, I know it is 2004-3-8. How can I convert 5180 to 2004-3-8 for write and store for displaying on OP-17?
 
The date and time can be broken into individual components and can be displayed any way you want (remember, they are in BCD format, so you may have to convert them depending on the data type of your tags).

I'm not sure what 5180 is. Which byte are you looking at? Is the PLC clock correct? If you look at the eight bytes all at once, you will see the live values, and the individual components will be easily recognizable. Refer to my first post above to see which bytes are which.
 
About view of "5180 to 2004-3-8" it was becouse I send Data format to DBX.DBW, then I saw one in this appearance. I change DBX.DBW to DBX.DBB and all OK.

Just I have done this task (I mean editing program for supply count and write history and so on).
But (I am study) I did FIFO like this

CALL "BLKMOV" (
SRCBLK := "History Production".Shift[61],
RET_VAL := MW 60,
DSTBLK := "History Production".Shift[62]);

CALL "BLKMOV" (
SRCBLK := "History Production".Shift[60],
RET_VAL := MW 60,
DSTBLK := "History Production".Shift[61]);

and so on. I know there is LOOP, maybe there is way do it more smartly.
 
Ok, it looks like you are moving 61 to 62, 60 to 61, 59 to 60, etc, which would require a Block_Move for each shift. If I was doing it, I would just copy the entire production history to a "scratch block", and then copy it back to the original with a byte offset equal to one Product History array.

For instance, let's assume that "History Production".Shift[1] is ten bytes long, and resides in DB100. And, let's say that you are storing 100 shifts. If you create another data block (i.e. DB101) for temporary storage, you could so something like this:

Copy DB100.DBX 0.0 Byte 1000 to DB101.DBX0.0 Byte 1000
Copy DB101.DBX 0.0 Byte 1000 to DB100.DBX10.0 Byte 1000


More or less, you would be shifting all the data at once, and since the Block Move SFC doesn't care if the block isn't big enough, the old data will automatically be shifted out.
 
I created UDT1
TYPE "Shift information"


STRUCT
Year : BYTE ; //maybe for display on OP I must do type of
Month : BYTE ; //integer. Becouse BTI for view by people
Day : BYTE ;
Hour : BYTE ;
Minute : BYTE ;
Depal_enter : DINT ;
Depal_exit : DINT ;
----
----
Spare : DINT ;
END_STRUCT ;
END_TYPE

then I created DB with array
DATA_BLOCK "History Production"
TITLE =
VERSION : 0.1


STRUCT
Shift : ARRAY [1 .. 62 ] OF //History shifts
"Shift information";
END_STRUCT ;
BEGIN
Shift[1].Year := B#16#0;
Shift[1].Month := B#16#0;
----
----
Shift[62].Pallerazer_enter := L#0;
Shift[62].Spare_6 := W#16#0;
END_DATA_BLOCK
 
If I (with "BLCMOV") copy DB1.DBB.0 of 2928(length of DB's without one element of array) byte to DB1.DBB48 then I will get the same result as I copy [61] to [62] [60] to [61] and so on?
 
No, that won't work. The Block Move function will not tolerate the overlapping of data areas. That is why you have to move it to a "scratch" area and then back again.
 
Yes, you've got it exactly right.

Also, remember that even though the SFC is called "Block Move", it's actually a "Block Copy" function, so the data that was in your first array will still be there. This isn't important if the original data is going to be overwritten immediately, but if the first array is being used to display on a GUI the current production and isn't updated dynamically, then you may want to wipe out the data after performing the data shift.
 
Must be as: shift is recorded 08.00, 20.00 and when cycle of bottling is recorded. Cycle of bottling is recorded when I push (in OP-17) button.
There is troubl in my programm. When chains is executed (in comment I used exploit without execute, it was incorrect)
chain:
Cycl: UC "FIFO bottle sycle";
L 0;
T "Data of count".Count_depal_enter;
executed incorrect, 0 is loaded and erase record number 1, but there is not executed
"FIFO bottle sycle" ( first was CALL, then I try UC, try try and nothing)and there is not record for cycle number 2.
"FIFO DBs" is equal to "FIFO bottle sycle" and "FIFO DBs" is executed.
 

Similar Topics

This is the first time I am working with Simatic Manager Step7 as I started my siemens journey with TIA which is pretty easy and do a lot of stuff...
Replies
3
Views
146
When you download a DB, the values get overwritten by what is in the "actual" column in offline DB. Does this happen at the start of the PLC...
Replies
6
Views
143
Hello Inside a FB, I´m trying to transfer a string from a DB to a IN_OUT var that was define as a UDT. The problem is that i can´t determine the...
Replies
4
Views
138
Hi all, I am trying to convert RSLogix 5000 program to Step7. I need to bit shift left my array of double integers for tracking the product on...
Replies
2
Views
525
I have a word in some DB which I want to load to AR1 and use as a pointer. In order to do this I need to write L DBxy.DBW xy SLD 3 LAR1 I...
Replies
3
Views
543
Back
Top Bottom