Need to pick your brains, S7 palletiser program

Hi Johnny

I've got an example of how we do inderect adressing these days at PMN, yes it's us who made this old palletizer, for I don't know how long ago.
In my opinion it's a lot of money and time to spend on a 20 - 25 years old machine, but of cource we make our money selling new machines.
Back to the example.

A M 120.7 //OS to shift tabel
JCN JMP2
L MD 130 //Memory for Pointer
LAR1 //to AR1
L MD 130 //Memory for Pointer
L P#4.0 //Increment Pointer with 4 Byte
+D
T MD 130 //New Pointer to Memory
OPN DB1 //Open Datablock
L DBW [AR1,P#0.0] //Load Value from DB
T DB100.DBW0 //Transfer to workarea
L DBW [AR1,P#2.0] //Load Value from DB
T DB100.DBW2 //Transfer to workarea
JMP2: NOP 0

M120.7 is a one/shot to shift the table from your programme sequence and the no. of bytes you increment your Pointer is dependend on how many bytes / words you need.
 
I'm not sure it's a typo, since I can't see the rest of the code, but this part is suspect:

L DBW [AR1,P#0.0] //Load Value from DB
T DB100.DBW0 //Transfer to workarea
L DBW [AR1,P#2.0] //Load Value from DB
T DB100.DBW2 //Transfer to workarea

The second L DBW instruction is actually referencing DB100, not DB1, although maybe that is what you are trying to do. I'm just pointing (no pun intended) it out to Johnny so he's aware of what to be careful about.
 
Hey Jonny

I have done that a coppled of time.

Here is the basic of what I do.

I use "Bit shift left" to keep track of the layer pattern.
Every time a new part arrive I fire the "BSL".

Then I setup som register to hold the actual pattern of the layer like this:

If we say there is a pattern like 3 row with 4 part's in
each it looks like this : 0000100010001000

Then I compare the "BSL" register and the pattern register and if there is a match, 1 row is finish ready to handel. When the pattern for the actual layer is finish Reset the "BSL" and start over again.

If there is some part that has to be turned I setup register for the "Turn" pattern.

I hope You got the idea.

Best regard
Jesper

beerchug
 
Johnny

If all you want to do is move a single word from anywhere in any data block to anywhere in any other data block, here's a source file which might help.

It takes 4 INT inputs : SourceDB, SourceWord, DestDB and DestWord and does what it says on the tin. Sometimes its a great deal easier just pushing integers at an FC and letting it do all the hard work.

Good luck

Regards

Ken.
 
Johnny,

You may or may not have moved on from your 'blank canvas' of a few posts ago, but as someone who has done a few palletizers, albeit with other PLC brands, I can give you some idea of how the overall layer and pallet build algorithm was handled. If you're already down a particular path, disregard this post.

To make a long story short, I didn't try to monitor individual row counts or even layer case counts. I set up a drum sequencer that controlled the infeed conveyor, case turner, pusher and stops and drove the sequencer indexing from an infeed photoeye (depending on your palletizer's particular method for assembling rows, your controlled devices might differ). The sequencer patterning file represented, not a row or layer, but the two-layer interlocking 'brick' you want to build.

As a case entered the palletizer, the sequencer indexes the next command pattern into the current output word(s). I could be more specific, but my example probably wouldn't fit your application and would likely confuse you. Suffice to say that what I did was create a series of control zones that I moved each case's sequencer output into as it moved along its path (shifting the data based on sensors and/or timers as required), actuating any devices called out in the sequencer output as demanded.

Of course, one of those devices was the pusher. So, as the last case of a row progressed into the pusher's control zone, an isolating stop would raise (to keep the next case out) and the pusher would cycle the row into its next location. As the pusher cycle ended, the case stop would drop and the next row would begin forming.

At the end of a layer, a bit in the last case's control word signals the apron to close, compression to cycle and the layer to be dropped onto the pallet.

At the end of the "brick", the same layer completion bit is set and the sequencer is reset to begin the construction of the next "brick."

I hope this helps. Let me know if you need more.
 
Some good info there, thanks to all who've posted.

The machine is now functioning by manual controls and I'm just implementing some automatic stuff tomorrow.

Jeffersonian, your method is, in essence, the way that I've decided to tackle it, it should allow for a pattern to be written as a code and entered into the program via a Data Block.

Ken, thanks for the code mate, but I was really after indirectly addressing as oppose to just moving the word, but that code will go in the store for later use, I'm sure it will come in handy.

Steffen, the old 5TI is gone now.. and its replaced with a nice shiny new S7. Thanks for the help (and the email mate) ;-))

Now.. I've got a bit of a problem with a bit of example code I tried to modify in the program.

The code is as follows:
L DBW 456
T MD 130
L DBW [MD 130]
T DB100.DBW6

What I hoped this code would do is: Take a value from DB1.DBW 456 (DB1 is already OPN'ed in the function) such as 16. Then transfer the contents of DB1.DBW16 to DB100.DBW6.

This isn't working and I'm getting the SF Fault Light on and the Module diagnostics are reporting "Area Length error when reading address 456".

Any ideas what is happening (or not happening as the case may be) ??

I'm back on site first thing tomorrow so any help you can give me will save me having to swear at my laptop again ! :) ...

Cheers

JT
 
Just had a bit of a brainwave (for once!). Is the problem in this code:
L DBW 456
T MD 130
L DBW [MD 130]
T DB100.DBW6

The fact that it is L DBW [MD 130] and not L DBD [MD 130] ??

I'll try it on site tomorrow but was just wondering...

:rolleyes:
 
No, that's not the problem. The problem is that DBW456 doesn't contain a pointer, which is why you get the fault. If you just want to transfer the contents of DBW456 to DBW6, then all you need to do is

L DBW 456
T DB100.DBW6
 
Johnny


An area-length error usually means you're trying to read or write an address beyond the limit of the block. That could be the case here

As S7Guy said, the contents of [....] has to be a simple area pointer i.e. a double word value left-shifted by 3 bits (or multiplied by 8 as he said earlier).

So what you should have is -

L DBW 456 // Puts the value in the the 32-bit ACCUumulator 1
SLD 3 // Shifts the contents of ACCU1 left 3 bits
T MD 130 // Store it in MD130
L DBW[MD130] // Use MD130 as the area pointer
T DB100.DBW6 // and transfer to DBW6

Lets say you had 18 in DBW456. The bit pattern here ends ...00010010. Now, reading from the right-hand end of a double-word, an area pointer treats the right-most 3 bits as a bit address and next 16 bits as the byte address. So what this would be interpreted as is -

byte address - ....00010 = 2
bit address - 010 = 2

In other words you used a Load DBW instruction, but instead of giving a word address starting at byte 18, you would have given a bit address of DBX2.2. Obviously there is a conflict at runtime here when the operating systems tries to resolve this. This is the whole reason you need to shift everything left by 3 bits to keep the numbering in line.

Damned pointers! First take your brain out, soak it in a bucket of good single malt for a lifetime and then everything will be OK. You still won't understand them, but at least you no longer care!

Good luck

Ken.
 
I have developed a relationship with the palletiser over the last 14 hours of being at work. I hate it.. it hates me. Although I do admire its stubborness and I get the impression it respects my tenacity...

S7Guy and Ken, thanks for the posts.

Ken, your suggestion about the single malt is currently being road tested.. cheers !

I have actually sorted it out of a fashion now. Although I didn't do it the same way I was originally intending. After much messing about today (with a print out of this thread next to me for company) I managed to get the thing to work with pointers. I've not bothered transfering to another Data Block now either...

The code I ended up with is this:

OPN DB 1
L P#20.0 // This is the word that the code I want to read starts at
L MW 168 // When the cycle starts, this is set to 0
+D
T MD 150

L DBW[MD 150]
T MW 160

Then MW 160 holds my value that is being indirectly addressed. After the first cycle I just add a value to MW 168 and then BINGO! it reads a new value into MW 160 from somewhere else in the Data Block.

This is working now. It took me four hours of messing about... I nearly cried, but didn't want to give the palletiser the satisfaction or seeing me beaten....

So.. onwards and upwards.. back on site Monday for the final push. Should have the thing cracked off by Tuesday all being well.

A massive thanks for your support through what has been a troubling time :D

If you can see any major problems with the way I've settled on doing it then let me know and I'll change it.
 
Johnny T, I see that obteve success for indirect address.

I lean will be in the structure affirmed needs flexibility and compatibilization.

-Said the part, divid in blocks of action: Control enliven vertical, horizontal, rotate, etc
-Each block of action should receive its variables, group in sequence. Reserve segment of memory of size
equal for all of blocks, this will be OFFSET
-Do routines of search worthy in tables:
Table of facts-said, by the operation, if better have a table for each block of action or table ONLY sequencial
The flexibility, is that I possessed a Table for command to sequence of action and another one of facts. planning correctly, to codification (date) of the Bits (and reserving some) performs many combinations.
Is easy add safe, sometime build interlook in blocks.
Ready, it follows the beginning of the Get-execute of commands- Codec and date.
 

Similar Topics

So i've been at this for a long while, i have Citect Scada 2018, i have full access to everything but i can't seem to find any option or...
Replies
0
Views
54
I've got this 3-phase 575V motor that we're controlling with a VFD (Variable Frequency Drive), which has been quite the learning curve in itself...
Replies
10
Views
291
I'm fairly new to Rockwell software, I've had some basic training in the past but nothing too advanced. My company and I use Reliable products for...
Replies
11
Views
348
Hi all, I am having issues accessing my Cimplicity software - the site code changed after re-install and I am no longer able to attain a new key...
Replies
10
Views
174
Good day all! Can someone help me with the procedure to update Beijers E700 firmware? The Panel I am working on is firmware 2.04v and I would...
Replies
1
Views
76
Back
Top Bottom