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

Also if you highlight the instruction i.e. [MOV K250 D361] then right click then select find device it will allow you to search and display one by one where the register/bit is used in the program

CrossRef.png
 
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.

My code is not downloaded to the PLC, however, it seems to be still able to read the live value (?).
I tried to force M72 ON, but it has no effect on the D values...
Also, 'start ladder logic test' is greyed out.

IMG_20201126_133241.jpg
 
Last edited:
Edit...I changed D329 (the one with a Nonzero) to D376 which I checked was unused first using the 'list of used devices'. Now it shows zero like the rest, but Still don't know why they are zero, even when I force M72 on.

IMG_20201126_152009_BURST001_COVER.jpg
 
If you have not downloaded it to the PLC then it will not update, although the registers and bits will show the state, the logic is not being called so your values will not be transferred to the registers.
you really need to get a handle on how it all works it's a bit like a pile of earth a bucket something to transfer the earth to the bucket the bucket is there (D Register)but the earth (your constant value) and the spade (your Move instruction) is not in the PLC only in your file so monitoring the code will only show the variables in the PLC.
Yes M72 will turn on and off & the D register will show the current value as these are memory areas in the PLC, however, the logic tying them together is not.
 
If you have not downloaded it to the PLC then it will not update, although the registers and bits will show the state, the logic is not being called so your values will not be transferred to the registers.
you really need to get a handle on how it all works it's a bit like a pile of earth a bucket something to transfer the earth to the bucket the bucket is there (D Register)but the earth (your constant value) and the spade (your Move instruction) is not in the PLC only in your file so monitoring the code will only show the variables in the PLC.
Yes M72 will turn on and off & the D register will show the current value as these are memory areas in the PLC, however, the logic tying them together is not.
That's a useful analogy thanks.
How is it I am able to see the D values of other devices e.g. D317 and D346? Is it because they already exist as devices in the PLC's memory?
 
Yes you can see the states of all variables for example D0-D799 because they are physical locations in the PLC it's your code that is not in the PLC that manipulates them.
 
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.

Ronnie, I've now used the "Find used devices" to make sure I'm using previously unused devices.

Question: If I choose addresses such that there's at least a one register gap between them, will that ensure that there's no "overlapping" of data going from one address to the next one, and effectively screwing up the contents of the adjoining D.?
 
In general any double word of a D integer 32 bit word or a float (these all use two registers so a float in D100 actually uses D100 & D101 but the cross reference knows from the code that there is two registers for a float so the cross reference will show D100 & D101, however, if some indirect processing has been used (use of Z pointers) then these will not show up in a cross ref.
Really you do not need to use every other register, just ensure that any doubles, floats etc. that use two registers generally in a separate area this makes it clearer for example group single words i.e. integers words (16 bit) in one area like D100-D200, then use say D300 to D500 for any double type words. Note: it makes sense to always start a double word on an even register it just makes it a bit clearer so for example D300, D302, D304 etc.
 

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,194
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
109
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
307
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
378
Hi One of the PLC's that I maintain/update is a Mitsubishi Q-Series, probably installed about 10 years ago. At the moment, ALL the wires from...
Replies
13
Views
1,165
Back
Top Bottom