Andrei Blagaila

Z13Z19

13 posts in this topic

Hey guys. I have some registers in my program that store the values for the recipes. (ex Z13, Z14...). Somewhere though I have the command:

MOV D921 Z13Z19

Can some explain Z13Z19?

Share this post


Link to post
Share on other sites

An indexed index? Didn't know that was possible. Which PLC?

Share this post


Link to post
Share on other sites

Z is an index register device. It's used as a pointer to modify the address of the device in front of it. For example, D100 is a data register. D100Z0 is an indexed data register that points to D[100 + Z0]. So if Z0 = 3, then D100Z0 is D103.

I guess the Q lets you index an index register. So Z13Z19 is pointing to Z[13+Z19]. That's a level of crazy I've never tried.

Share this post


Link to post
Share on other sites

I''m trying to understand why they did it like this. No idea yet :| I'll do some more digging tomorrow

Share this post


Link to post
Share on other sites

You said that Z13, Z14, etc. are recipe values? They must point to a lookup table. Try to find where Z19 is calculated, that will give you some clues.

Share this post


Link to post
Share on other sites

It was your syntax that threw us. :)

It actually looks like this  MOV   D921Z13  Z19  which makes it a little clearer

Where the value in indexed register D921 + Z13 is moved into the index register Z19

 

Edited by Ron_S

Share this post


Link to post
Share on other sites

Right.  

The ZR11 part is a file register indexed by the value in Z19

ie Z19 = 2

Then the value of D911 is moved into ZR13

 

Share this post


Link to post
Share on other sites

Now I understand. So the value in Z19 is added to the register number and then in that number D911 is moved.

It's seems like over complicating things. Why is this used?

Share this post


Link to post
Share on other sites

As I said in a post on here only a week or two ago

I have never used file registers but I have come across them in programs.

Only the original programmer can answer your question - or we can all guess :)

Share this post


Link to post
Share on other sites
On ‎14‎-‎02‎-‎2017 at 2:39 PM, Andrei Blagaila said:

It's seems like over complicating things. Why is this used?

I usually use the fileregister [R] or entended fileregister [ZR] when I have to make som sort og recipehandling, datalogging, datatraceing or need of lots of registers for calculating. Also in my opinion a good way of storing data for example program/machine setup.

The [R] registers can be created at the expense of the standard RAM of your CPU (build-in memory) or by using a SRAM-Card for creating up to 1mill. [ZR] extended registers.

Also the registers are latched by default.

Best regards.

Dariusch

Share this post


Link to post
Share on other sites

Thank you. I understand now. I think it may have to do something with Recipe logging. You all have been a huge help.

Thank you,

Andrei

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now