RTRBURN Posted February 15, 2010 Report Posted February 15, 2010 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.
Inntele Posted February 15, 2010 Report Posted February 15, 2010 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.
RTRBURN Posted February 15, 2010 Author Report Posted February 15, 2010 (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 February 15, 2010 by RTRBURN
Gambit Posted February 15, 2010 Report Posted February 15, 2010 (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 February 15, 2010 by Gambit
Gambit Posted February 15, 2010 Report Posted February 15, 2010 (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 February 15, 2010 by Gambit
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now