S7 dynamic addressing issue

skysparky

Member
Join Date
Feb 2022
Location
Michigan
Posts
13
Hey,
I'm having trouble with moving data within a DB and I think the problem is rooted in my lack of understanding of programming 'pointers' so please use small words when responding.

I have 200 bytes of data that is sitting in DB8001.DBW0 (all INT) and I need to move it to DB8001.DBB(#part_num) based on what part number (1to100*200 bytes) the operator is running.

The process deems that the part may be ran up to 3 different times in the machine so when the operator loads part '3' I will need to load data from DB8001.DBB600 into DB8001.DBB0, work on the part, then when unclamping move the data back into DB80001.DBB600 (or whichever part the operator has determined they are running eg. 17*200=DBB3400...).

So choosing where in the DB the data is depends on which part is being ran.

thanks!
 
Last edited:
Hey,
I'm having trouble with moving data within a DB and I think the problem is rooted in my lack of understanding of programming 'pointers' so please use small words when responding.

I have 200 bytes of data that is sitting in DB8001.DBW0 (all INT) and I need to move it to DB8001.DBB(#part_num) based on what part number (1to100*200 bytes) the operator is running.

The process deems that the part may be ran up to 3 different times in the machine so when the operator loads part '3' I will need to load data from DB8001.DBB600 into DB8001.DBB0, work on the part, then when unclamping move the data back into DB80001.DBB600 (or whichever part the operator has determined they are running eg. 17*200=DBB3400...).

So choosing where in the DB the data is depends on which part is being ran.

thanks!


Is this in 300/400 or 1200/1500?
 
Here's an example implementation that moves the part data to be be worked on:
 
Last edited:
Just for my understanding, is the data in DB8001 fixed, i.e. like a recipe ?
Or is the data like a job task buffer, each entry is an individual job task that is only run once, and there is some other mechanism to fill the buffer with the data ?
Since you are reading data back into DB8001 after the job is finished, I think it is the latter.

Anyway this is easy if you have SCL.
Create a UDT for the data to be send to the machine, i.e UDT "job_parameters".
Create a UDT for the data to returned after the job is finihed, i.e UDT "job_status".
Create a UDT that is made up of both, i.e. UDT "job_data".
Create the a list of jobs in DB8001 as an ARRAY[1..100] of job_data.

In SCL you can then comfortable do this.

When starting a job:
Machine_job_parameters := "job_list".job.parameters[#part_num] ;

When the job is finished:
"job_list".job.status[#part_num] := Machine_job_status ;

This is fully symbolically, and if you need to change the data you just change the relevant UDT and compile the blocks.
 
I did make the data in DB8001 from UDT's

1-UDT8001
part name
part Ser. No.
Misc. data
UDT8002
Forces for journal_1
....
...
Forces for journal_13
2-UDT8001
...
...



100

It is for rolling a crankshaft in a single arm roller. We may roll the post end on all parts and then come back and roll main 1 on all parts and come back again and roll the rest of the mains and then roll the pin journals so the machine could see the part up to 4 different times.

When the next time the part goes in, I was going to load the 200 byte part data into the 'active' part of the DB-DB8001.DBW0 through DBW200. Then each 200 bytes of data should be the next part (part 3 * 200, 4 * 200 etc...).

I've seen several examples that get me close but because I don't completely understand STL or the 'pointer' process it is hard for me to transpose what needs to happen to move my 200 bytes.
 
No, I don't thing we have that option installed on this machine.

We have a script editor in the HMI that I think could possibly do what you are saying but I was hoping to do it in the PLC.
 
Last edited:
L D,
First, thank you!!

I was able to load and try the program, for my purpose I changed name to FC302 and then called the block on a pulse of the 'unclamp' button.

It loaded information in but it didn't make sense, am I supposed to block off the first network if it works?

The part clamped in the chuck and being worked on is in array DB8001[0](198 bytes) with the intent to move that into DB8001[up to a possible of 100 different parts](198 bytes) when the 'unclamp chuck' button is pressed. Part 1 actually starts at address 200.

Is there any way you could explain what is going on so I could try to debug and then also change to when I am clamping and want to load the data from the part being ran into DB8001.DBW0 (198 byte)?

Also, not sure if it matters but from my first post the make-up of the data in the DB has changed to be a variety of CHAR,INT,REAL,BOOL data (I can dump the REAL data if need be).

Thanks for the help!
 
Create a library, insert a program into it and then copy your relevant blocks/udts to it, archive it and post it.

From your first post I assumed you had something coded but not working correctly and that reviewing my code would clarify what you were doing wrong.
 
Sorry, snow day yesterday.

The logic is a work in progress, it comes from another machine and I am trying to adapt it to work here. There is some stuff in it that isn't used and I haven't removed yet and there is some stuff that I tried doing using a different DB (8999) that you will see in there.

Basically I get an average of the high force that is rolled on a crank (FC284), put it in DB8001.DBW76 for journal 1 (net 27) DBW86 for journal 2... using the first 198 bytes of DB8001 (DB8001[0]) for the part that is clamped up in the chuck and the work that is done on it.

At net 33 I want to move any data changes that I have done to the clamped part into its arrayed area that would be coincide with the number of part being processed (part 7 goes to DB8001[7]). This isn't a production run of cranks but rather a small test run of prototype cranks that we may only run 50 to 100 parts.

Thanks.

Scott
 
Currently net 33 copies the data for a given part number to the clamped part area (array index 0), the opposite of what you require. What net would you need to do that in?


Maybe net 2?
 
Last edited:
The selected part number is going to be overwritten when you copy the selected part number to the running part number - are you going to manually fill in all the part numbers in the array[1..100] to correspond to the running part?


Maybe change the DB so the zero'th part is running part or clamped part followed by 100 parts?
 
Last edited:

Similar Topics

Hey Guys! Wondering if anyone here knows if it's possible to address area blocks in a PLC via pointers in WinCC Flexible. I need to...
Replies
6
Views
4,512
What I need to do is be able via code suitable for S70-315DP ( STL, LAD etc) to store a base address eg PIW 216 and then read the next 8 addresses...
Replies
9
Views
13,057
Hello, I have a requirement to manage the text alignment dynamically. So, for example: 1. English Texts should be displayed from Left in...
Replies
0
Views
90
Rockwell Tech Support seemed to have hit a wall with this question. Already updated the version to 5.00.13 per their suggestio but am still...
Replies
2
Views
230
Maybe this is just not possible, or maybe I am doing something wrong. Background; I have a data array of over 1500 products. For sorting I...
Replies
6
Views
760
Back
Top Bottom