You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

Reply
 
Thread Tools Display Modes
Old January 13th, 2021, 09:16 AM   #1
Tjkeets90
Member
United Kingdom

Tjkeets90 is offline
 
Join Date: Mar 2018
Location: England
Posts: 21
Z register in Q series Mitsubishi

I am upgrading an A series PLC to a Q series.
I understand how the Z register works, but in the original program I have the program just has the Z on it's own without anything after it. (see attachment)

When I try to write the new program in GX works 2 I can not just put Z, I need to put something after Z.(see attachment)
My question is can I use Z0 and will it work the same way?

Also on a side note can somebody tell me what the A registers are used for; I can't select A0 in GX Works 2 so having to use a D register instead.

Thanks,

Tom
Attached Images
File Type: png A series Z example.png (4.3 KB, 13 views)
File Type: png Q series Z example.png (2.5 KB, 10 views)
  Reply With Quote
Old January 13th, 2021, 11:03 AM   #2
parky
Member
United Kingdom

parky is offline
 
parky's Avatar
 
Join Date: Oct 2004
Location: Midlands
Posts: 2,740
That is because the Z registers are Z0 to Zxx (can't remember how many but there are quite a number), also I believe you can use ZZx for 32 bit indirect addressing this uses two Z registers i.e. ZZ0 is Z0 & Z1
The "A" accumulator is a data register which stores the
operation results of basic instructions and application
instructions. Basic instructions and application instructions, of which operation results are stored,
  Reply With Quote
Old January 13th, 2021, 03:46 PM   #3
Tjkeets90
Member
United Kingdom

Tjkeets90 is offline
 
Join Date: Mar 2018
Location: England
Posts: 21
Thanks a lot for the reply Parky much appreciated.

So I would be okay using Z0?
And would D1001 be okay to use instead of A0 or can you tell me the alternative for A0 in the Q series program?

Thanks
  Reply With Quote
Old Yesterday, 02:37 AM   #4
parky
Member
United Kingdom

parky is offline
 
parky's Avatar
 
Join Date: Oct 2004
Location: Midlands
Posts: 2,740
Did you use the conversion utility to convert the program this is a free download from Mitsubishi, If not then there could be many errors.
Z0, Z1, Z2 etc. are valid for index pointing for example if you move K10 to Z0 then any instruction using the Z index like M10Z0 will point to M20 (M10 + index 10 in Z0 = M20. same goes for D registers etc.
The accumulator normally is only used internally as a result from certain computations in some functions, however, it does look like it may be being used in a different way, Apparently the A>Q conversion changes the A0 register to SD718 and A1 to SD719, I do know the conversion utility does show conversions that cannot be done and in one instance I received a file where a Mxxx was written too many times think it was something like M1525 or something like that, no idea what the original code was as this was converted by others and was working, it appeared that what ever the code was had either been changed after conversion and for some reason the converted code that did not make sense was inadvertently left in.
Here is the link to the A to Q conversion pdf
https://www.koningenhartman.nl/UserF...damentals).pdf

EDIT: I have just created a simple program in GXDeveloper moving a constant into "A", however, in the later version (8.91) it would not allow just the "A" so changed it to A0, then converted it into a "Q" and it changed the A0 into SD718 so use SD718 for the register.

Last edited by parky; Yesterday at 02:51 AM.
  Reply With Quote
Old Yesterday, 02:45 AM   #5
parky
Member
United Kingdom

parky is offline
 
parky's Avatar
 
Join Date: Oct 2004
Location: Midlands
Posts: 2,740
As some possible interest, it is possible to convert a GXDeveloper project into a GXWorks2 structured project, I did this for someone, however, what it does is create the original program block as ladder but then allows you to create other program blocks in FBD or ST and the creation of FB's. It is a little complicated and if you had the time it would be possible to convert the ladder manually into FBD rather than ladder. The one problem is the symbols (labels) in this mode there seems to be two symbol tables one for the older ladder and one for the FBD (variables) these are local device comment (for each program block) and Global variables used in FBD programming.
  Reply With Quote
Old Yesterday, 03:08 AM   #6
parky
Member
United Kingdom

parky is offline
 
parky's Avatar
 
Join Date: Oct 2004
Location: Midlands
Posts: 2,740
If you did not use the utility and converting manually the special relays/registers are different depending on the models, so check for example the special bits may differ.
M9036 is the Normally on bit in an A but SM400 is the equivalent in a Q series.

Last edited by parky; Yesterday at 03:31 AM.
  Reply With Quote
Old Yesterday, 05:31 AM   #7
Tjkeets90
Member
United Kingdom

Tjkeets90 is offline
 
Join Date: Mar 2018
Location: England
Posts: 21
Hi Parky thanks again!

I have just used the conversion tool which has changed to A0 to the SD718.

My issue now that it has changed the Z registers so they're all the same register (see attachment)

Could I just use D registers instead of the R registers? This part of the program is for an encoder that is wired back to a QX40 so the value will always be an integer.

Luckily I'm only needing to use one Z register so I shouldn't have any issues with this.

Thanks.
Attached Images
File Type: png A series R registers.png (5.2 KB, 3 views)
File Type: png Q series R registers.png (7.6 KB, 3 views)
  Reply With Quote
Old Yesterday, 06:54 AM   #8
parky
Member
United Kingdom

parky is offline
 
parky's Avatar
 
Join Date: Oct 2004
Location: Midlands
Posts: 2,740
It looks like it is moving the count into an array of R registers i.e. R1000 to R1359 perhaps for some type of history, yes if you gave enough spare D registers.
The only time you may need different Z registers is where there is not a move value directly before in is used, for example if the Z register is incremented after a move i.e.
MOV Dxx D100Z0
INC Z0
Then if the Z register is used again it's value will have changed next scan
so it must be set before
i.e INC Z0
MOV D100 D200Z0
It looks like this code will not work anyway M9036 (SM400 in Q) is the always true bit so as it is a NOT this logic will not work, perhaps it's been disabled by the programmer but not removed, are those R registers used elswhere?
  Reply With Quote
Old Yesterday, 07:18 AM   #9
parky
Member
United Kingdom

parky is offline
 
parky's Avatar
 
Join Date: Oct 2004
Location: Midlands
Posts: 2,740
You can use R registers but you have to set the file in Parameters like in the pic.
You call it what you want and in standard ram but you reference it as "R" so R0 etc.
Attached Images
File Type: png Registers.png (104.1 KB, 25 views)
  Reply With Quote
Old Yesterday, 07:50 AM   #10
Tjkeets90
Member
United Kingdom

Tjkeets90 is offline
 
Join Date: Mar 2018
Location: England
Posts: 21
That was a bad example I shown you.
Further down in the code the SM400 contact is a normally open.


Is there a difference between a D register and an SD register?
I know D can only go up to D1023 and SD up to SD2047 but do they act differently?

I've just updated the PLC file to match and changed all the SD999 to the same R registers that were in the previous program.
Lets hope it works!
  Reply With Quote
Old Yesterday, 11:29 AM   #11
parky
Member
United Kingdom

parky is offline
 
parky's Avatar
 
Join Date: Oct 2004
Location: Midlands
Posts: 2,740
SD Registers are special and most are only used as read only, some are write but in general you would not use them as storage just like the SM bits notice you have SM400 always on you cannot write to this. Also make sure if you use the "D" registers, if the data needs to be retentive (retain values on shut down) you set the range that holds the data in the parameter file so on the Parameter setting page and the tab Device put in the latch2 the range you want retentive for example Set the D to 500 to 1000 you can have up to 12k of retentive D registers.
As I said you can use R registers by enabling them in the parameter file and for example create a file of 2k so this would be R0-R2047
Post the parameter file you have on the Q series for devices.
Attached Images
File Type: png Latch range.png (77.1 KB, 19 views)
  Reply With Quote
Old Today, 03:36 AM   #12
Tjkeets90
Member
United Kingdom

Tjkeets90 is offline
 
Join Date: Mar 2018
Location: England
Posts: 21
Thanks for the explanation Parky it really is appreciated!

The D registers wouldn't need to be retentive as there is an option to rezero.

I've attached my params I'm using.
Attached Images
File Type: png Q series params.png (33.0 KB, 3 views)
File Type: png Q series params2.png (31.6 KB, 1 views)
  Reply With Quote
Old Today, 05:07 AM   #13
parky
Member
United Kingdom

parky is offline
 
parky's Avatar
 
Join Date: Oct 2004
Location: Midlands
Posts: 2,740
Ok, if you use the "R" registers (see you have a file configured) then these are retentive by nature, my only reservation on configuring a File register ("R") is that if in the standard ram keep it to minimum size plus a little spare as this reduces the program memory size, not a problem on most systems as there is plenty but it will depend on the processor & size of your program. There will probably be plenty of D registers spare, if you do use R registers as the file always starts at R0, instead of configuring the file to use the R1000 range consider using R0 > upwards then you can reduce the size of the file.
  Reply With Quote
Old Today, 10:49 AM   #14
Tjkeets90
Member
United Kingdom

Tjkeets90 is offline
 
Join Date: Mar 2018
Location: England
Posts: 21
The program is small. It's just blocking moving data from to and from a scada system that does all the control. But this encoder has to be done in the PLC because of speed.
Also using a Q03UDVCPU.
Thanks again for your help. I'm installing it tomorrow so fingers crossed!
  Reply With Quote
Old Today, 11:26 AM   #15
parky
Member
United Kingdom

parky is offline
 
parky's Avatar
 
Join Date: Oct 2004
Location: Midlands
Posts: 2,740
Just watch for possible conversions that do not work for example there could be ones that cannot be done the same way in Q compared to A, an example is the SD ones already mentioned or SM1255 I think it is if you have multiple coils of this bit then for some reason it cannot convert to Q code (you will have to manually convert it to do the same job). I have seen code that uses them to drive multiple SM1255 as outputs I think they do this to let you know that this code is not translatable directly. This is a conversion that shows exactly that, if you have something like this then you would need to look at the original code to see what it is doing.
Attached Images
File Type: png Conversion.png (41.6 KB, 8 views)
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Mitsubishi -Nexgenie series PLC-INDIA abhay ghule LIVE PLC Questions And Answers 0 November 13th, 2013 09:22 AM
Mitsubishi Q series PLC error sonutomy LIVE PLC Questions And Answers 5 May 30th, 2013 03:50 PM
Read Data Register of Mitsubishi PLC A and Q Series winstonlorenzo LIVE PLC Questions And Answers 1 June 1st, 2012 12:26 AM
mitsubishi FX series compatibility milroyc LIVE PLC Questions And Answers 1 February 7th, 2011 01:57 AM
Mitsubishi Q series steadly LIVE PLC Questions And Answers 2 February 24th, 2009 09:13 AM


All times are GMT -5. The time now is 06:27 PM.


.