RSlogix 5000, reading real word bit?

prasathhome

Member
Join Date
Feb 2008
Location
Leeds
Posts
3
Hi,

I am new to contrologix's. I want to read few bits of tag type real. Consider 'Out_real' tag declared as real. I want to read 14, 20, 31st bit and move them to integer tag say 'out_int' (declared as int) in 1st , 2nd and 3rd bit.

Can you please help to do this?

Thanks
 
??

It's possible by performing a COP instruction to move the bit pattern of the Real tag to a DINT tag, then performing individual XIC - OTE instruction pairs to move those specific bits from the DINT.x to the INT.x location.

Image:Float_example_frac.PNG



Bit 31 is the sign, but Bit 20 and Bit 14 are elements of the fraction. What would these bits indicate in the least significant bits of an integer tag ?
 
Thanks for replying.

The problem is I cannot move Dint.bit into int.bit using move instruction. I am getting data type mismatch error.

I am using this bit move to read instrument data word and write in to integer value for easy listing of errors.
 
prasathhome said:
Thanks for replying.

The problem is I cannot move Dint.bit into int.bit using move instruction. I am getting data type mismatch error.

I am using this bit move to read instrument data word and write in to integer value for easy listing of errors.

The move function doesn't work on a bit level.

Put an XIC dint.bit OTE int.bit there. Same thing, just bit level.
 
The MOV instruction is for moving data values between tags with datatypes like REAL, DINT, INT, or SINT. You don't use it on bits.

I cannot imagine a bitwise status value encoded into a REAL tag, but stranger things have been asked on this site.

What I was describing was this:

bitwise_from_DINT.GIF
 
I don't have access to a PLC to test this until Monday, but I tried the following with no validation errors. This would eliminate the COP instruction and DINT. I wonder if copying from real to DINT would change the bit pattern?

Real_to_Int_bits.GIF
 
My thinking must have been set in SLC/PLC mode, where you cannot address a bit within a Floating Point element.

Thanks for the education and illustration, gmferg !

I still can't imagine a set of bitwise status indicators packed into a REAL datatype. I'm curious how the OP works it out.
 
I can't imagine that either. You can't even monitor the bits of a real within the tag monitor. The flexibility Rockwell offers can not be denied.
 

Similar Topics

I'm creating an HMI project using Crimson 3.0. I saved my PLC project as a .L5K file and imported that into Crimson. It imported most of the...
Replies
1
Views
1,484
After learning here how to create arrays in RSLogix5000 ver 20.04, I have added some monitoring for a HMI to show 1 of 3 conditions for a bank of...
Replies
2
Views
2,021
Hello everyone, this is my first time asking for help here, so please bear with any problem my english or lack of experience can cause. i have a...
Replies
3
Views
2,633
Hi, if we want to read or set a bit of an integer we can simply do: assume TEST1 is the integer, TEST1.3 := 1; or IF TEST1.4 THEN..... but...
Replies
2
Views
2,459
I am a novice at using Excel to mine data from my PLC. It took me several hours to determine how to access an array in my PLC from Excel, so I...
Replies
1
Views
4,997
Back
Top Bottom