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 14th, 2018, 02:26 PM   #1
NetNathan
Lifetime Supporting Member
United States

NetNathan is offline
 
Join Date: Nov 2011
Location: Corona, CA
Posts: 1,441
RX3i GE write a decimal to input to set bits in binary

Using GE RX3i PLC with Machine Edition SW...
I have a decimal %R number (value is "1150") that I want to write to a set of 16 %I bits to set 1 and 0 according to the binary equivalent of "1150".

Is this clear enough?
__________________
****Control Freak****
Net is where I be and Nathan is me.

Last edited by NetNathan; February 14th, 2018 at 02:28 PM.
  Reply With Quote
Old February 14th, 2018, 02:46 PM   #2
Bit_Bucket_07
Member
United States

Bit_Bucket_07 is offline
 
Bit_Bucket_07's Avatar
 
Join Date: Feb 2013
Location: Southeast US
Posts: 1,403
Quote:
Originally Posted by NetNathan View Post
Is this clear enough?
Sure. Is there a question, or are you simply letting us know that you plan to do this?

I haven't worked with an RX3i PLC, but in a Series 90 PLC, I'd just do a MOVE with data type WORD.

Of course, the data would be overwritten by the IO image table at the end of the program sweep.
__________________
  Reply With Quote
Old February 14th, 2018, 02:47 PM   #3
Steve Bailey
Lifetime Supporting Member + Moderator
United States

Steve Bailey is online now
 
Steve Bailey's Avatar
 
Join Date: Apr 2002
Location: The boondocks of Western Massachusetts USA
Posts: 6,533
I think you want to copy the bit pattern from %Rxxx to the 16 bits starting at %Iyyy. Is that correct?
Assuming the variable addressed to %Rxxx is an INT, create an INT variable addressed to %Iyyy and use a MOVE_INT instruction. %Ixxx will nee to be on a byte boundary.
  Reply With Quote
Old February 14th, 2018, 03:18 PM   #4
NetNathan
Lifetime Supporting Member
United States

NetNathan is offline
 
Join Date: Nov 2011
Location: Corona, CA
Posts: 1,441
Yes the %R is a 16 bit value.
so if it is %R0413 that stores my 1150 number...and my %I starts at %I0601.
I use a Move_INT (with a length of 16) and move %R0413 to %I0601?
__________________
****Control Freak****
Net is where I be and Nathan is me.

Last edited by NetNathan; February 14th, 2018 at 03:20 PM.
  Reply With Quote
Old February 14th, 2018, 03:52 PM   #5
Steve Bailey
Lifetime Supporting Member + Moderator
United States

Steve Bailey is online now
 
Steve Bailey's Avatar
 
Join Date: Apr 2002
Location: The boondocks of Western Massachusetts USA
Posts: 6,533
Not quite. You'll first need to create an INT variable addressed to %I601. Then use a MOVE_INT instruction with a length of one to copy the data from %R413 to the INT variable addressed to %I601. Don't try to copy to a BOOL variable addressed to %I401. Proficy Machine Edition is strict about typecasting.
Bit bucket's concern is valid also. You need to make sure that %I601 is not addressed to an I/O module anywhere.
  Reply With Quote
Old February 14th, 2018, 04:59 PM   #6
NetNathan
Lifetime Supporting Member
United States

NetNathan is offline
 
Join Date: Nov 2011
Location: Corona, CA
Posts: 1,441
Done that I have verified that nothing is looking at %I601 thru %I616.

Next challenge.....I want to convert %Q601 thru %Q616 to be read into %R414
Same procedure...Make %Q601 an INT and use Move_INT to %R414... or not so simple?


why...
This involves writing and reading a Control word and Status word to/from Profinet on ABB VFD.
__________________
****Control Freak****
Net is where I be and Nathan is me.
  Reply With Quote
Old February 14th, 2018, 08:42 PM   #7
Steve Bailey
Lifetime Supporting Member + Moderator
United States

Steve Bailey is online now
 
Steve Bailey's Avatar
 
Join Date: Apr 2002
Location: The boondocks of Western Massachusetts USA
Posts: 6,533
Same procedure with %Q as with %I.
  Reply With Quote
Old February 15th, 2018, 10:06 AM   #8
Sapper307
Member
United States

Sapper307 is offline
 
Join Date: Nov 2017
Location: Maryland
Posts: 90
not sure if i'm following correctly, but anyway...

if you want to break out the individual bits of a word, %R1 for instance, you can use move_word with the input %R1 and the output %G1. Then %G1 through %G16 will be populated the individual bits of %R1 sequentially. I'm pretty sure you can reverse the process to pack boleens into a word.
  Reply With Quote
Old February 15th, 2018, 10:36 AM   #9
Bit_Bucket_07
Member
United States

Bit_Bucket_07 is offline
 
Bit_Bucket_07's Avatar
 
Join Date: Feb 2013
Location: Southeast US
Posts: 1,403
Quote:
Originally Posted by Sapper307 View Post
not sure if i'm following correctly, but anyway...

if you want to break out the individual bits of a word, %R1 for instance, you can use move_word with the input %R1 and the output %G1. Then %G1 through %G16 will be populated the individual bits of %R1 sequentially. I'm pretty sure you can reverse the process to pack boleens into a word.
Yeah, I prefer using the "word" data type for such data moves, since that will result in copying the exact bit pattern without regard for decoding two's complement representations of signed numbers.
__________________
  Reply With Quote
Old February 15th, 2018, 03:53 PM   #10
NetNathan
Lifetime Supporting Member
United States

NetNathan is offline
 
Join Date: Nov 2011
Location: Corona, CA
Posts: 1,441
Quote:
Originally Posted by Sapper307 View Post
not sure if i'm following correctly, but anyway...

if you want to break out the individual bits of a word, %R1 for instance, you can use move_word with the input %R1 and the output %G1. Then %G1 through %G16 will be populated the individual bits of %R1 sequentially. I'm pretty sure you can reverse the process to pack boleens into a word.
Yes that works..tested....but have not tried the reverse yet.
__________________
****Control Freak****
Net is where I be and Nathan is me.
  Reply With Quote
Old February 16th, 2018, 08:03 AM   #11
NetNathan
Lifetime Supporting Member
United States

NetNathan is offline
 
Join Date: Nov 2011
Location: Corona, CA
Posts: 1,441
Quote:
Originally Posted by Sapper307 View Post
not sure if i'm following correctly, but anyway...

if you want to break out the individual bits of a word, %R1 for instance, you can use move_word with the input %R1 and the output %G1. Then %G1 through %G16 will be populated the individual bits of %R1 sequentially. I'm pretty sure you can reverse the process to pack boleens into a word.
Quote:
Originally Posted by NetNathan View Post
Yes that works..tested....but have not tried the reverse yet.

Lets backpedal on this...
I get "Logic Source - Not Equal" using the G words.
I assume this is because they are restricted to "Genius Bus" comm words, and I have no Genius Bus configured.
__________________
****Control Freak****
Net is where I be and Nathan is me.
  Reply With Quote
Old February 16th, 2018, 09:41 AM   #12
Steve Bailey
Lifetime Supporting Member + Moderator
United States

Steve Bailey is online now
 
Steve Bailey's Avatar
 
Join Date: Apr 2002
Location: The boondocks of Western Massachusetts USA
Posts: 6,533
%G memory is not restricted to Genius applications. It is simply an area of memory typically referenced via Boolean instructions. I'm a little confused about what you're seeing. Does the PLC target validate without error? If you are attempting to send the program to the PLC and it doesn't come up with "Logic Equal", it generally means that PME for some reason could not make the transfer and the reason will show up in the information window.
I frequently used %G memory for bits that were turned on or off by the HMI. It helped me during commissioning and troubleshooting to know that the %G bits were related to the HMI.
  Reply With Quote
Old February 16th, 2018, 10:50 AM   #13
Sapper307
Member
United States

Sapper307 is offline
 
Join Date: Nov 2017
Location: Maryland
Posts: 90
I use the "move_word to %G" method a lot for decoding bit packed words and have never had issue, even with systems that don"t actually have Genius drops on them. you may having an issue elsewhere in the config.
  Reply With Quote
Old February 16th, 2018, 10:53 AM   #14
Sapper307
Member
United States

Sapper307 is offline
 
Join Date: Nov 2017
Location: Maryland
Posts: 90
you can also try addressing the the bits to other boleen memory types, such as %M.
  Reply With Quote
Old February 16th, 2018, 11:32 AM   #15
NetNathan
Lifetime Supporting Member
United States

NetNathan is offline
 
Join Date: Nov 2011
Location: Corona, CA
Posts: 1,441
When I did a "Verify Equality".
I got all "equal" except..
Program Logic Source - NOT EQUAL

I deleted my move_word instruction (%AI513 to %G1) and downloaded then did "Verify Equality" and got:
Program Logic Source - EQUAL

??
__________________
****Control Freak****
Net is where I be and Nathan is me.
  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
signed and unsigned guest LIVE PLC Questions And Answers 13 September 12th, 2017 12:45 AM
Sequencers randy LIVE PLC Questions And Answers 43 December 20th, 2014 02:10 PM
1762-IF2OF2 Analog Input Problem davidgay LIVE PLC Questions And Answers 22 August 14th, 2013 04:25 AM
Quick PAnel communications to GE Rx3i PLC MadPLC LIVE PLC Questions And Answers 11 September 16th, 2011 03:31 PM
GEFANUC QuikPanel Set bits milmat1 LIVE PLC Questions And Answers 2 September 16th, 2005 06:50 AM


All times are GMT -5. The time now is 06:52 PM.


.