Z register in Q series Mitsubishi

Tjkeets90

Member
Join Date
Mar 2018
Location
England
Posts
39
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

A series Z example.png Q series Z example.png
 
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,
 
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
 
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/User...eries to Q Series Handbook (Fundamentals).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:
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.
 
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:
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.

A series R registers.png Q series R registers.png
 
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?
 
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.

Registers.png
 
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!
 
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.

Latch range.png
 
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.

Q series params.png Q series params2.png
 
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.
 
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!
 
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.

Conversion.png
 

Similar Topics

Hi everyone, I have a problem which I need to read the Data Register (DM) of a Mitsubishi PLC (Q and A Series) via UDP. I need to make a code in...
Replies
1
Views
3,516
Hi, Can anyone help me convert the bit shift from FX2N to Q series X0 --||------------[SFTL X002 M100 K55 K1] Can somebody convert this...
Replies
0
Views
2,233
Hello everybody! I am experiencing something that seems very weird to me: in one of our automatic napkin machines there is a register in which I...
Replies
2
Views
3,118
I am attempting to reject a bottle If the label fails. The rejection works fine at normal line speed but at low speed the rejector fires (air...
Replies
35
Views
1,121
Hi everyone, I am working on a project that needs to expose the SV (Set Value) of a temperature controller to a SCADA system. SCADA <-...
Replies
4
Views
152
Back
Top Bottom