S7 DB Hex Values

cjd1965

Lifetime Supporting Member
Join Date
Apr 2007
Location
UK
Posts
1,659
Hi
I have a DB with 512 config bits that i wish to get the inverse of into another DB (ie if bit 1=1 in DB14 then i wish bit 1=0 in DB13)

I am thinking of clearing DB2 then XORing DB1 with 7FFF.

L 0;
T DB13.DBW 0;
L DB14.DBW 0;
L W#16#7FFF;
OW ;
T DB13.DBW 0;

obviously i would need a list of 32 of these.

Is 1FFF the same as all 16 bits in S7?

Is there an easier way? I need to review the use of pointers next

Cheers
 
Is 1FFF the same as all 16 bits in S7?
Even allowing for a mis-type (should it have been 7FFF?) I don't know any system where this is the same as referring to all 16 bits. Well, OK, you are referring to all 16 bits but you are assigning a state of '0' for the most signifcant bit and a state of '1' for all 15 others. And I don't think that's what you wanted.

Anyway, problem solved another way.

Ken
 
Note that exclusive or is XOW, and that you can specify the word as part of the instruction as follows:

L DB14.DBW 0;
XOW W#16#FFFF;
T DB13.DBW 0;
 
You are correct Ken.

7FFF is 32767 which is all except the most significant (signed bit). As usuual I was in a rush and calculated 32767 to be 7FFF. In GE logicmaster you cannot enter a hex constant of FFFF so I asked here.
I looked at the built in word functions but did not see the INVI function under conversions. Pity they did not call it NOT Word

My problem is solved by the built in function INVI
 

Similar Topics

Good day if anyone can help I am trying to display my data in hex values, but only find that decimal works in ccw12. is there any way to display...
Replies
3
Views
1,676
Hi Everyone, Just wondering if anyone could help me with an issue I'm having? I'd like to display a fault code that is referenced in Hex on an...
Replies
2
Views
1,593
Hello everyone, I'm working in RSLogix 5000. I have an ASCII string of letters & numbers (call it String_3) which I have used INSERT to add a...
Replies
3
Views
2,322
Gurus, I have a question for rslogix 5000, is there any command that can convert dec to hex value and then swap the bits around? For example...
Replies
4
Views
3,071
Hello, I'm trying to setup a TCP connection from a Compactlogix 5069-L306ER to a TDI checkweigher to receive real-time weight data of the...
Replies
6
Views
332
Back
Top Bottom