Mitsubishi Still Sucks...

Eric Nelson

Lifetime Supporting Member + Moderator
Join Date
Apr 2002
Location
Randolph, NJ
Posts
4,346
Sorry to say, I'm back at the Mitsubishi stuff again... :oops:

Originally, our customer had opted for no operator interface on the machines to save money, so I did the "cheapo" blinking fault lamp to indicate the fault. It blinks a 2-digit code, which they lookup in the manual to determine the fault (similar to a GM automobile's "Check Engine" lamp). Well, they got tired of having to lookup the faults, so now they want to add an operator interface.

My "standard" method of fault handling for use with an operator interface doesn't seem to translate well to Mitsubishi-ish, so I'm just making sure I'm taking the right approach...

I'm using bits M200-M296 to store my individual "fault" latches. They get latched when a specific fault in the sequence occurs, and are used to display the fault description on the operator terminal.

My questions are...
1.) How to know when one (or more) of these bits is set, and
2.) How to reset the entire range...
This is quite a simple task in the other PLCs that I normally use, but seems like a PITA with the FX1S processor. I understand how to group bits together (in 4 bit units) using KnM. IOW, K4M200 gives me the word equivalent of bits M200-M216.

Regarding my first question...

Mitsubishi's compare (CMP) instruction can only be used as an output instruction, so it doesn't lend itself to easily comparing multiple words. In other brands, it's simple...

| WORD 1 > 0
|-----] [-------+-----(FAULT DETECTED)
| |
| WORD 2 > 0 |
|-----] [-------+
| |
| WORD 3 > 0 |
|-----] [-------+
| |
...


.
etc., for as many words as needed (sooooo easy!)

With the Mitsubishi, each time the compare instruction executes, it creates a set of 3 consecutive bits (>, =, <) as the result of the comparison. Like this...

| ALW_ON
|-----] [-------------(CMP K0 K4M200 M500]
|
| M500 <--{Word K4M200 (Bits M200-M215) > 0}
|-----] [-------------(FAULT DETECTED)


.
.
That's all well and good, but I want to look at MORE than 16 bits. Yes, I can look at a double-word group by using K8M200 (M200-M232), but that only gets me a total of 32 bits... :rolleyes:

If I execute the compare instruction a second time, it will (of course) overwrite my comparison bits (M500-M503) with the new result. I'm guessing that I'll have to specify different result bits in the additional comparisons? IOW, to check if at least one bit is ON in 3 consecutive words, I'll have to do something like this?...

| ALW_ON
|-----] [-------+-----(CMP K0 K4M200 M500]
| |
| |
| +-----(CMP K0 K4M216 M503]
| |
| |
| +-----(CMP K0 K4M232 M506]
|
| M500
|-----] [-------+-----(FAULT DETECTED)
| |
| M503 |
|-----] [-------+
| |
| M506 |
|-----] [-------+


.
It just seems like a rather half-assed way to accomplish this... Eating up 9 bits just to do a simple comparison? Is this the only solution?

On to my second question... Resetting bits M200-M296.

Normally, I'd just RESET the range, or FILL the range with zeros, but that's not a valid method in the FX-1S. The only way I can think of accomplishing it is to MOVE zeros into each word. As far as I can tell, I can't zero a double word. So my logic would be like this...

| RST_FLTS
|-----] [-------+-----(MOV K0 K4M200]
| |
| |
| +-----(MOV K0 K4M217]
| |
| |
| +-----(MOV K0 K4M233]
| |
...


.
etc., up to M296

Is this really the simplest method for resetting a range of bits?... :confused:

beerchug

-Eric

Note to self: Add Mitsubishi to my list of PLCs I dislike... :p
 
Can't just just..

WOR or DWOR the the M bits to a temporary register and then add 0 to temporary register to set or reset the zero flag M8020.

Use the ZRST instruction to clear the bits.

I agree, there is no excuse for the Mitsubishi compare instruction.
The inline comparisons are easy to use on the FX2N.
 
I'm not quite sure I understand your example using the WOR instruction, but it got me thinking of another method that might work...

I can probably just add all my words together and compare the final result to zero. If the result is > zero, I'll know that at least one bit in the range is ON. That's the only data I'm looking for.

The ZRST is E-X-A-C-T-L-Y what I was looking for. Somehow I overlooked that one in the manual... :unsure:

Thanks a LOT for pointing it out!... :D

beerchug

-Eric

Oh alright, maybe I'll just add the FX1 series to my "list"... :p
 
Well, they got tired of having to lookup the faults, so now they want to add an operator interface.
What kind of operator interface we talking about?

I'm using bits M200-M296 to store my individual "fault" latches. They get latched when a specific fault in the sequence occurs, and are used to display the fault description on the operator terminal.
What kind of intructions are you using to accomplish this?


Mitsubishi's compare (CMP) instruction can only be used as an output instruction, so it doesn't lend itself to easily comparing multiple words. In other brands, it's simple...
Not true...using the FX1S yes, but as far as an ACPU a compare intruction can be used as an input.

That's all well and good, but I want to look at MORE than 16 bits. Yes, I can look at a double-word group by using K8M200 (M200-M232), but that only gets me a total of 32 bits...
Hence, the name....32 bit processing đź““

On to my second question... Resetting bits M200-M296
As Peter said, ---[ZRST M200 M296]----

Tim
 
Tim said:
What kind of operator interface we talking about? and What kind of intructions are you using to accomplish this?

I'd be glad to answer if you're just curious, but does it matter? (in regards to my original questions)

Not true...using the FX1S yes
Sorry, I thought I made it clear that I was using an FX1S. But yes, I DID use a blanket statement there...

Hence, the name....32 bit processing

I only mentioned it so nobody would jump on the fact that I could compare a double word.
16-bit... 32-bit... Still doesn't get me the 96 bits I'm looking for...

Note to Phil... Any idea why the BOLD formatting didn't work on my second quote... :confused:

beerchug

-Eric
 
I'd be glad to answer if you're just curious, but does it matter? (in regards to my original questions)

Just curious to why your using up 97 M relays for faults. I only asked the question to try and see the whole picture, nothing else.


Tim
 
I'm not using ALL 96 for faults... The total on this machine is less than 50, but I've set aside M200-M295 (actually 200-299) so I can group my faults by the sequence they are monitoring.

Normally, I stick with octal numbering (or 16-bit), but since Mitsubishi numbers bits sequentially, I just ignore bits n8 or n9 so it makes sense in my head. Since this is a small machine, there are only a few possible faults for each sequence. Therefore, the groups would look something like this...

M200-M207 - Faults that occur during the initial startup (cylinder not home, etc.)
M210-M217 - Additional startup faults
M220-M227 - Faults requiring machine shutdown (low air pressure, clutch out, etc.)
M230-M237 - Faults in Sequence 1
M240-M247 - Faults in Sequence 2
M250-M257 - Faults in sequence 3
M260-M267 - Faults in Sequence 4
M270-M277 - Faults in sequence 5
M280-M287 - Faults in Sequence 6
M290-M297 - Faults in sequence 7

The individual fault bits are only needed to display the corresponding screen at the operator terminal. Within the PLC program, I don't care which specific fault ocurred, just which group it's in. If I need to know theres a problem in Sequence 3, I just check if any bits are ON in that group by COMPAREing that group to zero. If it's not zero, I know that there's a fault in Sequence 3.

That's why I needed a way to monitor ALL those bits. When ANY of those bits are ON, I can call my fault display subroutine to display the message associated with that fault.

As far as triggering the faults goes...

When a fault occurs, I use the SET instruction (sorry Tom) to turn the bit ON. This way, even if the fault goes away, the bit remains set until the operator acknowledges it. The operator uses a "FAULT RESET" button to attempt to reset the fault (or faults). This triggers a 1-shot to clear all fault bits (hence my need for that ZRST instruction). If the fault condition no longer exists, that fault bit is now OFF. If the fault condition still exists, it's immediately turned ON again by the original SET instruction.

Here's an over-simplified example...

| RST_FLTS
|----]^[----------------[ZRST M200-M299] ;1-Shot attempt to clear all faults
|
| FAULT CONDITIONS
|----] [---] [---] [----[SET M230] ;Seq. 1 Fault A Occurred
|
| FAULT CONDITIONS
|----] [---] [---] [----[SET M231] ;Seq. 1 Fault B Occurred
|
| FAULT CONDITIONS
|----] [---] [---] [----[SET M240] ;Seq. 2 Fault A Occurred
|
| FAULT CONDITIONS
|----] [---] [---] [----[SET M241] ;Seq. 2 Fault B Occurred


.

Note that the ZRST is placed BEFORE the fault latches. đź““
This causes them to be re-SET if the fault condition still exists.


beerchug

-Eric
 
The individual fault bits are only needed to display the corresponding screen at the operator terminal.

Ahhh, a screen...were getting somwhere.:D so, is this operator face maybe a HMI? I have to say I've never had to use your example that way to get a screen to come up with an assotiated fault. The HMI's I've used with Mitsubishi PLC's have user and allocated memory addresses. I can assign a message group to a D register and call up any particuliar screen or message using the ---[BSET D1 K0]---- command.
Anyways, Good luck

Tim
 
Oh BTW,
The FX1S doesn't have the BSET fuction! Damn why did they do this. You'll have to use something like ---[MOV H1 D1]--- to get a certain bit to come on in the D register. I'm sure there are probably other ways.

Good Luck!
Tim
 
Eric Nelson said:
I'm not quite sure I understand your example using the WOR instruction, but it got me thinking of another method that might work...

I can probably just add all my words together and compare the final result to zero. If the result is > zero, I'll know that at least one bit in the range is ON. That's the only data I'm looking for.
My WOR idea is similar to your adding the bits idea.

The WOR or DWOR instruction 'ORs' the bits together 16 or 32 bits at a time which is better than adding because some combination of bits may add up to zero with a carry. However, you must add 0 to set or reset the zero bit. The word or instructions not set any status bits.

Check out WAND(FNC27), WOR (FNC28)and WXOR(FNC29) instructions. The 32 bit versions are handy for processing lots of bits at once instead of on at a time.
 
bolding

Eric Nelson said:
Note to Phil... Any idea why the BOLD formatting didn't work on my second quote... :confused:

Hi Eric,
In this quote line: ---What kind of intructions are you using to accomplish this--- you started a bold tag but never ended/closed it. Therefore the end of the tag was assumed in quote 2. (hence it skipped the start bold tag there)
Make sense?
Enjoy,
 
Try this..

My example assume that all your bits a aligned on 32 bit boundaries so the fault bits should start on a multiple of 32 such as M224 or M240. It also assumes that you have only 64 bits of faults.

Code:
   LD     always_on
   DWOR   K8M224,K8M256,temp  ; check buts M224-M287 temp is a 32 garbage register in D
   DADD   0,temp,temp         ; sets or reset the zero flag
   LD m8020                   ; Now use the zero flag for conditional testing

If you need to expand expand to 96 bits of faults...

Code:
   LD     always_on
   DWOR   K8M224,K8M256,temp  ; temp is a 32 garbage register in D
   DWOR   K8M288,temp,temp    ; now check bits M288-M319
   DADD   0,temp,temp         ; sets or reset the zero flag
   LD M8020                   ; Now use the zero flag for conditional testing

Note there is no need to clear anything first. Simple and very efficient.
 
Eric, just for slicing pickles...

but what happens with your compare Word_n > zero if bit +15 (MSB bit) is high?

(I guess you use unlike zero instead?)
 
Peter...

Thanks! I like your method much better than mine.

Phil...

Your explanation makes sense. I originally had added the formatting manually which didn't display right in preview. Then I tried highlighting and using the BOLD button. Still no good.

Viewing the source showed a [bracketed] B rather than the converted <B>, so I thought it might be a bug.

I just tried to duplicate it and couldn't, so it looks like I probably just had something screwed up in the first quote. Thanks!

Kalle...

I'm not sure I understand your question...

Let's say I used CMP K4M200 K0 M500
If one or more bits in M200-M215 are ON, wouldn't the value always be > zero?... :confused:

beerchug

-Eric
 
What value do you have when you turn on M215? I'm not absolutly sure on the compare instruction but most of the time its regarded as a negative value. This is probably what Kalle is referring to. I guess thats how you would get the S2 less then S1. Again I don't have any manuals with me so I may be wrong.

Tim
 

Similar Topics

Hey guys, I am starting to sort of understand what is going on in the mitsubishi world of programming, but i am still at a loss when it comes to...
Replies
3
Views
1,699
I'm looking to get some spare keys for this PLC. Does anyone know a source or have a part number? My searches are turning up nothing at the moment.
Replies
1
Views
64
I'm struggling to get an FR-E800SCE to work on CC-Link IE TSN. I'm sure the issue is with the drive, when I plug in the network cable I get no...
Replies
1
Views
89
Hi , Where i can find Mitsubishi PLC Card end of line & replacement model details. i am looking for Q02CPU replacement model. Please advice. thanks
Replies
2
Views
126
Hi guys, Im trying to set the real time clock in my Mitsubishi FX1N, but it shows this error ES: 01800001 I have good communication with...
Replies
3
Views
141
Back
Top Bottom