Help with reverse engineering code...

geniusintraining

Lifetime Supporting Member + Moderator
Join Date
Jun 2005
Location
SC
Posts
8,276
OK, I know its not much but I just can't get it...

Take a look at this and help me decipher what they are doing. I see the outputs but can see how they are doing it.

The first rung is a reset
The second rung if M8000 is true then timer t0 will timeout for .5sec then reset itself.
Next when t0 is true it will add a K of 1 to do every time it goes true.
At the same time it will compare k16 to D0 then M0 is set to true??

Also move D0 to K2Y000 ?? is this the output?

also if M1 is true then move K0 to D0??

I just got back from vacation and must of took to many stupid pills when I was in the mountains :) I just can't see how they are making the outputs sequence the way they are and this is the complete program

I am not very good with Mitsubishi but I don't think you need to be with this..

Can someone help, many thanks



MitsubishiCode.JPG
 
M8002 is the first scan bit, so the first rung resets D0 to zero at powerup. M8000 is the "always on" bit, so the second rung is always processed. You are correct that the timer resets itself every 1/2 second. Each time that the timer expires, it increments D0 by one. Since M0 is specified in the comparison instruction, M0 is the = bit, M1 is the > bit, and M2 is the < bit (the result of the comparison of D0 to K16). Therefore, when D0 exceeds 16, it gets reset to zero. The current value of K16 gets moved to the outputs Y0 thru Y8 with the MOV instruction (K2 means 8 bits), so you should be seeing the value represented on the outputs.

But I may be completely wrong... ;)

🍻

-Eric
 
geniusintraining said:
...the K2Y000 had me stumped
Mitsubishi actually explains it quite well in the Programming Manual... đź““

"Bit devices can be grouped together to form bigger representations of data, for example 8 consecutive bit devices are some-times referred to as a byte. Further more, 16 consecutive bit devices are referred to as a word and 32 consecutive bit devices are a double word. The PLC identifies groups of bit devices which should be regarded as a single entity by looking for a range marker followed by a head address. This is of the form KnP where P represents the head address of the bit devices to be used. The Kn portion of the statement identifies the range of devices enclosed. “n” can be a number from the range 0 to 8. Each “n” digit actual represents 4 bit devices, i.e K1 = 4 bit devices and K8 = 32 bit devices. Hence all groups of bit
devices are divisible by 4.
"

🍻

-Eric
 
Its a nice Mitsi trick to learn.

But my 'Mr fussy head' always looks at code like this and says, why would you need the M8000 (always on bit) The second T0 can go on the next line without it. :)

And another tip 'GIT' - all those greyed out box's are using valuable screen area where you could display more code per page.
Grab each panel of greyed out box's and move them to the middle of the screen. They will then display a 'X' to close them. Move the other panels to the top of the screen andyou can display more screen.

Each timeyou open this project the layout will be remembered.
 

Similar Topics

Hello everyone, I have a AB Stepper Motor connected to an AB Ultra series 200 drive. The drive is connected to an AB Micrologix 1500 PLC. The...
Replies
18
Views
9,507
Hi all, hope you are having a great day, I am in need of your help to create a AOI or program that does this kind of job: I have a IO Link...
Replies
0
Views
46
please help me . I have to make this ladder diagram and I can’t figure it out :(
Replies
12
Views
305
Hi Everyone, i was hoping for a little help with this module. i have data that needs to be read from a different plc through the Modbus plus...
Replies
11
Views
203
Hello, I am trying to replicate a piece of logic on the PLC5 onto an SEL RTAC. I am using ladder on SEL and FBD. I am having issue on the ladder...
Replies
13
Views
219
Back
Top Bottom