Jump to content

Recommended Posts

Posted
Is it possible to do an Input inversion like you can the output inversion? What I am doing is Moving 4 bits of X300 into D100 [MOV K1X300 D100] I need to reverse the value of either X300-X303 or D100. I have tried the NEG and CML instructions but did not work either. We use a series of photoeyes as a bit pattern for material selection, the issue is the photoeyes are normally open untill photoeye is broken. These photoeye dont have the option of being wired N.O. or N.C. Thanks in advance.

Posted
With what PLC do you work? Because for FX2N and FX3U the CML instruction is applicable according to your purpose. FX1S and FX1N does not support this functions.
Posted (edited)
Q02H. I tried the CML instruction but I get a Negative number. EX: [CML K1X300 D100] K1X300= K14 D100= -15 I need D100 to = 1 Edited by RTRBURN
Posted (edited)
Try a Logical exlusive OR(WXOR) with HFFFF. WXOR D100 HFFFF D100 Then 0 - 1 = 1 1 - 1 = 0 1 - 0 = 1 0 - 0 = 0 Edited by Gambit
Posted (edited)
Q02H. I tried the CML instruction but I get a Negative number. EX: [CML K1X300 D100] K1X300= K14 D100= -15 That's because the signbit(b15) changes as well. Do the WXOR then only on the four bits WXOR D100 HF D100 Edited by Gambit

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...