You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old February 9th, 2008, 05:50 PM   #1
prasathhome
Member
United Kingdom

prasathhome is offline
 
Join Date: Feb 2008
Location: Leeds
Posts: 3
RSlogix 5000, reading real word bit?

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
  Reply With Quote
Old February 9th, 2008, 06:14 PM   #2
Ken Roach
Lifetime Supporting Member + Moderator
United States

Ken Roach is online now
 
Ken Roach's Avatar
 
Join Date: Apr 2002
Location: Seattle, WA
Posts: 14,258
??

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.




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 ?
__________________
- "Simpler is better, except when complicated looks really cool."
  Reply With Quote
Old February 9th, 2008, 06:23 PM   #3
prasathhome
Member
United Kingdom

prasathhome is offline
 
Join Date: Feb 2008
Location: Leeds
Posts: 3
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.
  Reply With Quote
Old February 9th, 2008, 06:37 PM   #4
CroCop
Member
United States

CroCop is offline
 
Join Date: Aug 2005
Location: Utah
Posts: 1,050
Quote:
Originally Posted by prasathhome
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.
  Reply With Quote
Old February 9th, 2008, 06:41 PM   #5
prasathhome
Member
United Kingdom

prasathhome is offline
 
Join Date: Feb 2008
Location: Leeds
Posts: 3
Brilliant, thanks for your replies, its working now
  Reply With Quote
Old February 9th, 2008, 06:47 PM   #6
Ken Roach
Lifetime Supporting Member + Moderator
United States

Ken Roach is online now
 
Ken Roach's Avatar
 
Join Date: Apr 2002
Location: Seattle, WA
Posts: 14,258
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:

  Reply With Quote
Old February 9th, 2008, 09:44 PM   #7
gmferg
Lifetime Supporting Member + Moderator
United States

gmferg is offline
 
gmferg's Avatar
 
Join Date: Feb 2008
Location: Modesto, CA
Posts: 334
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?

  Reply With Quote
Old February 9th, 2008, 10:20 PM   #8
Ken Roach
Lifetime Supporting Member + Moderator
United States

Ken Roach is online now
 
Ken Roach's Avatar
 
Join Date: Apr 2002
Location: Seattle, WA
Posts: 14,258
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.
  Reply With Quote
Old February 9th, 2008, 10:29 PM   #9
gmferg
Lifetime Supporting Member + Moderator
United States

gmferg is offline
 
gmferg's Avatar
 
Join Date: Feb 2008
Location: Modesto, CA
Posts: 334
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.
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
How To Enter Rslogix 5000???? sundar_scada LIVE PLC Questions And Answers 14 April 2nd, 2016 04:50 PM
Sequencers randy LIVE PLC Questions And Answers 43 December 20th, 2014 03:10 PM
Rslogix 5000 Control72 LIVE PLC Questions And Answers 0 June 22nd, 2006 10:04 AM
Serial pulse train. Pierre LIVE PLC Questions And Answers 15 January 8th, 2006 03:57 PM
RSLogix 5000 eastkodakguy LIVE PLC Questions And Answers 2 July 3rd, 2002 12:28 PM


All times are GMT -5. The time now is 12:09 AM.


.