Mitsubishi Still Sucks...

Tim said:
What value do you have when you turn on M215?

Good question that I can't answer... I won't have access to the PLC 'til I get to the customer... :(

Sounds like you may have a point though... The manual mentions that bit 15 is used for the sign.

Thanks for bringing it up. That would have driven me nuts!...
confused.gif


I'm going to use Peter's method, but it would be nice to verify this anyway. Anyone here got an FX they can test this on?

By the way Tim, you were asking about the operator panel...

It's just a simple canned message display I've used before. See THIS LINK. I don't like these new EZ-Text units as much as the old Optimates, but the Optimates don't have the Mitsubishi protocol...

These are really simple to use... You specify a D register for each text line, then just stick the message number you want to display in the register. For US$200 (including cable), you can't beat it... :cool:

beerchug

-Eric
 
Inline compares in FX1S

Eric
Please note you can use inline compares in the FX1S. These were not available in the original FX and FX0 family. The are in all FX2n, FX1N and FX1S. Code would be

LD<> K4M200 K0
OR<> K4M216 K0
etc
then
OUT FAULT ALARM

or you can do in 32 bit

LDD<> K8M200 K0
ORD<> K8M232 K0
etc

The original compare function is retained for backwards compatabilty. As others have mentioned the 16 and 32 bit forms of the compare use the most significant bit as a sign bit hence the use of non equality rather than greater than in my example. If you choose to still use the Compare function non equality is nomally closed on the equal bit. In you case for the first compare -I/I- M501.
 
Re: Inline compares in FX1S

Bob Duyckinck said:
Please note you can use inline compares in the FX1S

Well, whadya know... Yes you can! The manual states that it's not available, but the software allows the instruction.

Maybe I can download a firmware upgrade for the manual?... :p

Thanks for the info, Bob!... :D

beerchug

-Eric
 
Thank You Bob,

Don't know how that was overlooked :unsure:
I got the FX manual, but obviously I need the FX1S.

Anyways, Eric just in case you might need the info that I was looking for today. Your instruction---[CMP K4M200 K0 M500]---- will give you a negative value upon turning on the MSB M215. What I did to counter this was put a "D" in front of the CMP example........................
--[DCMP K4 M200 K0 M500]-------
This will keep your 16 bits as positive values and will not affect your next head address on -----[DCMP K4 M216 K0 M503]-----.
Its sort of tricking the plc into thinking your comparing two words by using the "D", but the K4 allows only the first word to be compared.

Good Luck!!
Tim
 
FX Manual

Guys For the FX1S and N you need the FX Programming manual II. Its available online at either MEAU.COM or Mitsubishi-Automation.com (German site). MELFAN.com is the Japanese site but maybe passworded for downloads. Inline compares are in section 5.16. Also need for FX1 imbedded motion commands.
Happy programming
Bob
 
Thanks Bob... :D

I have the II manual, and sure enough, inline comparisons are described in Section 5.16.

I didn't bother looking past the CMP instruction in Section 5.2.1. I figured that was the only comparison instruction available.

It would have been nice if they put a notation on that page saying something like "Also see Section 5.16 for Other Comparison Instructions"... :rolleyes:

beerchug

-Eric
 
2's complement

Hi Eric

Jepp, Tim answered what I was hinting about.

If the MSB is On/High in a word, the number/integer is negative if it is represented with 2's Complement. This should be the same with all brands.


You wrote that: "The manual mentions that bit 15 is used for the sign"

Yes it is true that if bit +15 in a word is zero, the number is positive, and if bit +15 is 1, the number is negative, but bit +15 isn't the only difference between e.g. 2 and -2 if the number is represented with 2's complement. (For those that is interested, search Google after: 2's complement)

"Conversion" between 16 bit and 32 bit values
Mostly I use a PLC that use 32 bit mathematic, and if I read a 16 bit value from an external device through communication, I check bit +15. If it is zero, the upper word is zeroed. If it is "1", the upper word is filled with 1's (FFFF hex).
The other way is simpler (as long as the value is between -32768 and 32767). The 16 bit value uses the lower word only, and there is no need to move any sign bit because the 2's complement take care of the sign.

Another example of use of bit in word/dword
We often moves bit-statuses from the PLC (e.g. inputs, alarms or process-statuses etc) into doublewords and let the SCADA software read only blocks of dwords.

In addition to reducing the numbers of read-telegrams, it will also save I/O-tags in the SCADA packet since 32 bit statuses uses only 1 I/O-tag.

Here is a sample code to extract 32 internal digital tags from the integer/long:
Code:
index = 0
DummyDword = PLCdword[dwordno] & 2147483647
bitno = 1
      while index < 31
           PLCbit[bitbase+index] = DummyDword & bitno
           bitno = bitno * 2
           index = index + 1
           if index = 16 then
              DummyDword = DummyDword/65536; bitno = 1
           endif
      wend
PLCbit[bitbase+31] = PLCdword[dwordno] < 0
 

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,712
Hello! If someone can help me with the following problem. I can't change the phone number. Do I really need the interface (AL-232CAB - Programming...
Replies
0
Views
39
how to communicate FactoryTalk Optix and Mitsubishi Q Series. I want to know the details of that
Replies
0
Views
39
I'm at a new job as the sole control engineer and trying to piece together where my predecessor left off. One machine I'm trying to get online...
Replies
2
Views
101
Back
Top Bottom