Andrei Blagaila Posted February 13, 2017 Report Posted February 13, 2017 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?
JRoss Posted February 13, 2017 Report Posted February 13, 2017 An indexed index? Didn't know that was possible. Which PLC?
Andrei Blagaila Posted February 13, 2017 Author Report Posted February 13, 2017 Q50UDEH. Can you please explain what it's used for?
JRoss Posted February 13, 2017 Report Posted February 13, 2017 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.
Andrei Blagaila Posted February 13, 2017 Author Report Posted February 13, 2017 I''m trying to understand why they did it like this. No idea yet :| I'll do some more digging tomorrow
JRoss Posted February 13, 2017 Report Posted February 13, 2017 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.
Ron_S Posted February 14, 2017 Report Posted February 14, 2017 (edited) 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 February 14, 2017 by Ron_S
Andrei Blagaila Posted February 14, 2017 Author Report Posted February 14, 2017 It actually looks like this.
Ron_S Posted February 14, 2017 Report Posted February 14, 2017 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
Andrei Blagaila Posted February 14, 2017 Author Report Posted February 14, 2017 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?
Ron_S Posted February 14, 2017 Report Posted February 14, 2017 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 :)
Dariusch Posted February 15, 2017 Report Posted February 15, 2017 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
Andrei Blagaila Posted February 16, 2017 Author Report Posted February 16, 2017 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now