Need Mitsubishi Melsec memory help

JIMCON

Member
Join Date
Sep 2005
Location
SWEDEN
Posts
124
Hello all..

I have a problem with writing data to the Melsec PLC memory.

Heres the situation: I have one servo thats connected to the plc and I also have a few measureing probes thats connected to the plc aswell.

This is what happens: The servo writes to the memory dynamicly (it writes its data where free memory space is aviable) But the measuring probes writes its data to a designated memory area.
This is the problem. Sometimes the servo writes its data value into the measure probe memory area and when the measure probe wants to write to its designated area it is already take by the servo. This causes buggs in my program.
In other words, the probes wont place any value in their designated memory area when its take by the servo unit.

Theres 2 sulotion´s to this problem either i´ll make the measuring probes write its data dynamicly or eiter i´ll restrict the servo to a designated mamory area to. Then there would´nt be any conflicts.
But i dont have a clue what program block or code that makes memory writing dynamic.

I know this may sound a bit £$*^#"%$€[ but I just wonder if some here have challenged this memory writing problem before.


//Jim
 
Last edited:
Mitsubishi Memory

Hi Jim,
Can you post your program, as I don't really understand the issue.

If you have designated a specific memory address, then I can't see how something else is also writing data to that address unless you have specified it in the code.

Is the servo also a Mitsubishi and hence you are using To and From instructions?

Please elaborate and we will try to assist.

Which PLC are you using, and is there a 1PG Module being used with the servo?

Regards, Gene.
 
Mitsubishi FX PLC

Hi Jim,
I've zipped an old Medoc Program which uses an AD Card and also has some memory uses.

Do you have Medoc or are you using GX?

Regards, Gene.
 
Im using the FROM TO instruction and the Servo is also mitsubishi
And im using GX IEC Developer

Here´s the code in "IL" that´s telling where to write the data from the measure probe.. I dont understand anything of this code :) heh

LD SM400
BMOV D4012 K4M2000 K3
DMOV K2M2008 Value
D* K2M2016 H100 D1500
D+ D1500 Value
D* K2M2024 H10000 D1500
D+ D1500 Value
D* K2M2032 H1000000 D1500
D+ D1500 Value
D/ Value K20 D1500
DMOV D1500 rsCalc


Im sorry if i cant explain so good. im very new to this. It wasnt me who did this program from the beginning. But im sitting here at the office and trying to understand this program :)
 
Last edited:
JIMCON said:
LD SM400
BMOV D4012 K4M2000 K3 NOTE 1
DMOV K2M2008 Value
D* K2M2016 H100 D1500
D+ D1500 Value
D* K2M2024 H10000 D1500
D+ D1500 Value
D* K2M2032 H1000000 D1500 NOTE 2
D+ D1500 Value
D/ Value K20 D1500
DMOV D1500 rsCalc

NOTE 1 This statement moves three 16 bit words as follows;
D4012 -> M2000 (LSB M2000, MSB M2015)
D4013 -> M2016 (LSB M2016, MSB M2031)
D4014 -> M2032 (LSB M2032, MSB M2047)

NOTE 2 This statement multiplies two 32 bit words and stores the result in two 32 bit words.

BUT according to NOTE 1 data was only copied upto M2047 and according to NOTE 2 data between M2048 and M2063 is referenced. Check that M2048 and M2063 are not used anywhere else in the program.
 
First of all thank u for this info..

So what u mean is that the data referenced between M2048 and M2063 should be changed ?

I have now checked if anything else in the progam uses data between M2048 and M2063 and i didnt fin anything that uses that area.
 
ushidayo said:
NOTE 1 This statement moves three 16 bit words as follows;
D4012 -> M2000 (LSB M2000, MSB M2015)
D4013 -> M2016 (LSB M2016, MSB M2031)
D4014 -> M2032 (LSB M2032, MSB M2047)

NOTE 2 This statement multiplies two 32 bit words and stores the result in two 32 bit words.

BUT according to NOTE 1 data was only copied upto M2047 and according to NOTE 2 data between M2048 and M2063 is referenced. Check that M2048 and M2063 are not used anywhere else in the program.

I now nuderstad this.. But is there anyway to make this memory area restricted for other devices. What i mean is that I only want the measure probe data to write to this memory area.
No other device shall have the permission to write data into this area.
 
I think i have solved the problem. If i let the code execute first in my POU then there would be no other device who can take over the memory area.
 
With GX IEC Developer you can assign a memory area explicitly to a tag variable (e.g. a global tag variable "value" could be of datatype double-integer assigned to address D1000 and D1001). Or, a tag variable can have a memory area assigned when the program is compiled. The tag variables that have memory assigned when the program is compiled, tend to be local variables for a POU.

In the settings of GX IEC Developer you can reserve areas of memory that will be used for assigning to tag variables at compile time. It is very important that you do not use this reserved memory, either when assigning memory explicitly to tag variables or referencing memory addresses directly in a POU.

With these Q series PLCs, I/O modules do not "take over" a memory area. Access to memory areas is decided by the programmer. You mentioned a servo in your system, is there a motion CPU together with the main CPU on your PLC? If there is, make sure you know which memory areas in the main CPU the motion CPU has access to (this will be defined in the PLC parameters setting page).

If you need further help, I would advise you to post your program on this forum or consult a specialist. Of course you could keep asking questions but it often easier to see the program when trying to diagnose a problem.
 
Thanx for the help Ushidayo it has been very helpful.. Im gonna continue to search for the problem. Now i atleast know how this works.

The thing left now is to find which memories that are in conflict with eachother. The problem appears only when I start up the program.
i can get around this problem if i restart the whole system.
If I have 6 probes in the task i have to restart 6 times and if I have 3 probes in the task have to restar 3 times :) And after restart everything runs perfect. Therefor i think it has got to do with some memory that is in conflict..
 

Similar Topics

I have a Mitsubishi FX2N-64MR-UA1 processor. The 1st analog output card is an FX2N-4DA. It requires 24VDC power. That card is obsolete. The card...
Replies
1
Views
1,575
Hi, Complete novice on PLCs and need your help (again). On GT Designer3 what sort of button/switch do I need to add to Start/Stop a water pump...
Replies
7
Views
1,965
Hi, Can someone help me out? Please excuse my terminology because I'm a complete newcomer to PLCs. The PLC at work is modular/expandable and...
Replies
18
Views
4,060
Hello I am new in Mitsubishi PLC's so I have a request to convert a program which is running in a Q06H CPU to the same machine but running a...
Replies
6
Views
1,984
Hello, I have an old machine I'm trying to get reloaded for a customer, and it has a FX2N PLC in it. I have a copy of GX Works FX, but the...
Replies
5
Views
1,753
Back
Top Bottom