GX developer:Created new Data registers-what am I doing wrong?

Mas01

Member
Join Date
Oct 2020
Location
Leicester, England
Posts
1,109
I created default values for some new alarm setpoints.
They are D361,D327,D329,D331 (see pic).
When I put them into monitor mode, I was expecting to see the correct values in blue, but I'm seeing zeros in most cases and a strange number for D329 (which is flickering around 7543/7544/7545), so maybe that one's already used for something else (?).
Why aren't the correct values being seen?

IMG_20201125_173822.jpg
 
What are the sizes of the data that are being MOVed from and two i.e. what is the byte offset, in memory, between e.g. D327 and D329?


What is the data type (and size) of K2000? of D329?
 
What are the sizes of the data that are being MOVed from and two i.e. what is the byte offset, in memory, between e.g. D327 and D329?


What is the data type (and size) of K2000? of D329?

I have no idea what you mean. I only chose those D's because they looked unused - ie I looked at the device COMMENTS screen and they looked unused. I thought that I could choose any free D register and MOV a value into it. Sort of like a traditional high-level program where you can define your own variables (ie as long as they are all uniquely named).
I did warn you I was a complete novice. :(
 
Basically, trying to create some new D parameters, so I can use them as setpoint values.
I guess I'm asking 'how do I define the D parameters?'.
I found the list of Setpoints were all defined in the Program|DEFAULTS in GX developer, so I just added my own at the end of the list.
 
Last edited:
Just because they aren't commented, doesn't mean they are not being used elswhere.
You need to go to 'find used device's
Check those d numbers only have 1 use.
 
Just because they aren't commented, doesn't mean they are not being used elswhere.
You need to go to 'find used device's
Check those d numbers only have 1 use.

Thanks Ronnie, I'll have a look tomorrow. Appreciate the help. Is this on the main menus across the top? Anyway I'll take a look. Thanks.
 
I have no idea what you mean. I only chose those D's because they looked unused - ie I looked at the device COMMENTS screen and they looked unused. I thought that I could choose any free D register and MOV a value into it. Sort of like a traditional high-level program where you can define your own variables (ie as long as they are all uniquely named).
I did warn you I was a complete novice. :(




When I see a location reference like D329, I wonder what I means. Is it the start of four bytes of data or one? And if it is one, and I copy a 4-byte value to it, does that mean I am also overwriting data in locations D330, D331 and D332? And if that is yes, what about the other parts of the code that act as if some other data should be in D330, D331 and D332, that I just wrote over?
 
When I see a location reference like D329, I wonder what I means. Is it the start of four bytes of data or one? And if it is one, and I copy a 4-byte value to it, does that mean I am also overwriting data in locations D330, D331 and D332? And if that is yes, what about the other parts of the code that act as if some other data should be in D330, D331 and D332, that I just wrote over?
Thanks dbb, I never thought of it like that before.
I just added my rungs to follow the same sort of 'pattern' as the MOV commands that are directly above the ones I added, thinking that would be sufficient to give them a value.
 
There are many reasons for why the values are/are not changing.
some have been posted.
1. first of all it looks like M72 is off so it will only move data when true (although this could be a pulse so may not be seen).
2. The data is being moved but those new addresses are being written to elsewhere.
3. There could be other transfers to some of the memories like a block move, double words (32 bit) or floats remember Dint or floats take two (or 4 words for double precision floats).
Indirect addressing where the "Z" registers are used as an offset pointer so any reference to a "D" register say D100Z0 would be a register D100 + the value in Z0 example is Z = 200 so D100Z0 is actually pointing to D300.
What is obvious that you have data in one of the new registers that does not match the value you are trying to move so it is being written to somewhere else.
First thing to do is do a cross reference of the D registers to see if any of the new ones are being used elsewhere (also do that for the originals as well it may be that M72 is not on but those that are changing are written to elsewhere.
Failing that, look for registers before the new ones just in case they are used as 32 or 64 bit or even the possibility they have block moves or indirect addressing.
Some example:
Assume D345 is one of your new ones
Then it is possible that D344 is a Double word or float.
Another thing is if there was a move instruction that did a block move D300 K10 D340 then D344 would be overwritten.
I would definitely look at M72 and see where it is turned on the data in one of your new registers could be something that was written before and is no longer used and if retentive would hold that data until written to.
 
As a general rule - if you are adding anything to a program, always check 'list of used devices' first.
When I am doing it, I have a note book and write down the next free bits.
Like this: M162 --> meaning all M bits above M161 are free
D235 ---> etc
You can get in trouble if you are overwriting something else.

In those images, even though there are no comments and it shows error. I know that there are zone reset instructions in the program up to those numbers.

bittts-free1.png bittts-free2.png
 
Last edited:
Looking at it more closely it could be this is some form of set some default parameters and is it possible that M72 is a "DEFAULT" button on the HMI ?
I have seen similar code before and changing values could just be a function of some dynamic adjustment. One example I came across was water addition to a vessel where after each addition any error was adjusted by a factor to predict the nominal in-flight time for closing the valve, this did not work very well as on an overdose the in-flight would be adjusted by a factor to increase the in-flight value, however, due to pressure changes the next batch may be below the set-point and would then overdose, I removed it, fitted a trickle valve and improved the dosing process to within the acceptable limits, may be worth finding out what turns M72 on.
 
Looking at it more closely it could be this is some form of set some default parameters and is it possible that M72 is a "DEFAULT" button on the HMI ?
I have seen similar code before and changing values could just be a function of some dynamic adjustment. One example I came across was water addition to a vessel where after each addition any error was adjusted by a factor to predict the nominal in-flight time for closing the valve, this did not work very well as on an overdose the in-flight would be adjusted by a factor to increase the in-flight value, however, due to pressure changes the next batch may be below the set-point and would then overdose, I removed it, fitted a trickle valve and improved the dosing process to within the acceptable limits, may be worth finding out what turns M72 on.

Yes, M72 is a button on the Setpoints page. The text on it says 'Reset to default', the idea is I think to set to these default values when the button is pressed. However, there's other D values where the value is as expected, which is confusing me.

As for the List of Used Devices well that's completely blank for some reason. Just my luck! LOL.

IMG_20201126_113817.jpg
 
Last edited:
You need to type in D or M in the box or select from the dropdown list.
If you type in D345 for example it will find where it is used.
Just a note: I assume that when you monitored your code you did press the set defaults key on the HMI, as otherwise it will not move the default values into the registers, Also you may need to hold it for a second or two just in case the coms are a bit slow. or if you are simulating this then force M72 on then off again to see it it transfers the values.
 

Similar Topics

Hi everyone, I'm looking for a sample program that has some UDTs defined in it for the MicroLogix platform. To create them, you need to have the...
Replies
6
Views
2,209
I'm trying to verify a project with a PLC. The Transfer Setup menu item is grayed out and every time I click Verify with PLC, I get an error...
Replies
1
Views
46
Well, I've decided to start a new project, and like all projects, it has already gone horribly wrong. I purchased a PLC device (supposedly a...
Replies
2
Views
111
Does anybody have any samples of how to "Create and Use" UDT's in CCW Developer Edition? (I am using v22) I can't find any information from...
Replies
3
Views
312
I'm trying to manually convert a Beijer E200 HMI project onto to a new Mitsubishi GOT gs2107-wtbd. The PLC is a very old A-series AS1CPU and is...
Replies
1
Views
381
Back
Top Bottom