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
Unread January 27th, 2014, 12:56 AM   #1
mehrdad
Member
Canada

mehrdad is offline
 
Join Date: Nov 2013
Location: canada
Posts: 18
converting signed to unsigned

Hi all,

I was wondering if there is anyway to convert a signed integer to unsigned integer in Rslogix 5000?
I know that I can use DINT for integers greater than 32767 but how can i convert a singed to unsigned number?

other PLCs simply have a INT to UINT converter function\block.

absence of int to uint converter is really causing serious issues for me.

thanks
  Reply With Quote
Unread January 27th, 2014, 07:58 AM   #2
Robobob
Lifetime Supporting Member
United States

Robobob is offline
 
Robobob's Avatar
 
Join Date: Apr 2004
Location: Toledo
Posts: 224
I think you will want to use the ABS command.The ABS instruction takes the absolute value of the Source and places the result in the Destination.Place the absolute value of value_1 into value_1_absolute. In this example, the absolute value of negative four is positive four.
  Reply With Quote
Unread January 27th, 2014, 08:32 AM   #3
robertmee
Member
United States

robertmee is offline
 
robertmee's Avatar
 
Join Date: Feb 2008
Location: NC
Posts: 1,428
Quote:
Originally Posted by Robobob View Post
I think you will want to use the ABS command.The ABS instruction takes the absolute value of the Source and places the result in the Destination.Place the absolute value of value_1 into value_1_absolute. In this example, the absolute value of negative four is positive four.
That won't work if the OP's after 0 to 65535 unsigned.

Here's an example code to convert:

http://info.bannersalesforce.com/int...&Rendition=web
  Reply With Quote
Unread January 27th, 2014, 10:50 AM   #4
TConnolly
Lifetime Supporting Member
United States

TConnolly is offline
 
TConnolly's Avatar
 
Join Date: Apr 2005
Location: Salt Lake City
Posts: 6,151
Did you see the reply in the other thread you started on this same subject? This problem is super easy to solve. Don't make it harder than it needs to be.
Attached Images
File Type: jpg tc01271401.jpg (12.9 KB, 1056 views)
__________________
True craftsmanship is only one more power tool away.

That's the beauty of processors, they don't have emotions they just run code - The PLC Kid.

Last edited by TConnolly; January 27th, 2014 at 10:56 AM. Reason: To attach picutre
  Reply With Quote
Unread May 17th, 2018, 05:35 PM   #5
preacher.ca
Lifetime Supporting Member
Canada

preacher.ca is offline
 
preacher.ca's Avatar
 
Join Date: Jan 2014
Location: Regina
Posts: 17
Thanks "TConnolly". Your posted solution was exactly what I needed to add to my Function Block Diagram.
  Reply With Quote
Unread October 11th, 2018, 03:33 PM   #6
williamcreis
Member
Brazil

williamcreis is offline
 
Join Date: Oct 2018
Location: Ipatinga
Posts: 1
Saved-me

Quote:
Originally Posted by TConnolly View Post
Did you see the reply in the other thread you started on this same subject? This problem is super easy to solve. Don't make it harder than it needs to be.
Did not know the function, saved my life
=)
  Reply With Quote
Unread October 18th, 2018, 02:47 PM   #7
Petr_Broza
Member
Canada

Petr_Broza is offline
 
Join Date: May 2015
Location: Vancouver
Posts: 36
Simply clever
  Reply With Quote
Unread January 18th, 2019, 01:09 PM   #8
psboy2000
Member
United States

psboy2000 is offline
 
Join Date: Jan 2019
Location: Denver
Posts: 1
Helpful

Thanks for the simple fix TConnolly.
  Reply With Quote
Unread June 3rd, 2019, 04:17 PM   #9
autonow
Member
United States

autonow is offline
 
Join Date: Oct 2013
Location: CA
Posts: 7
Quote:
Originally Posted by TConnolly View Post
Did you see the reply in the other thread you started on this same subject? This problem is super easy to solve. Don't make it harder than it needs to be.

Cool Nice solution. Now I need to go the other way I have a dint and need to goto two ints where the two ints are swapped

So int2 is the first part of the word and int1 is the second part
So when the value of int2 goes over 32767 It goes negative and int1 picks up the remainder. Does that make sense
  Reply With Quote
Unread June 4th, 2019, 01:15 PM   #10
CapinWinky
Member
United States

CapinWinky is offline
 
CapinWinky's Avatar
 
Join Date: Aug 2011
Location: Virginia
Posts: 542
Logix doesn't have unsigned integer types at all, which is weird to me.
__________________
-----------------------------------------------------
Cycling power is a sign of weakness.
  Reply With Quote
Unread June 4th, 2019, 01:17 PM   #11
ohnedich6
Member
United States

ohnedich6 is offline
 
Join Date: Jun 2014
Location: Midlands SC
Posts: 64
Logix added unsigned integer types in V32 of Studio 5000. Just a FYI.
  Reply With Quote
Unread October 8th, 2019, 07:47 PM   #12
TheWaterboy
Lifetime Supporting Member + Moderator
United States

TheWaterboy is offline
 
TheWaterboy's Avatar
 
Join Date: May 2006
Location: State of Denial
Posts: 958
I know this is older - but I have v32 and UINT is an option but is unsupported in the 5380 series PLC. Go Figure.
  Reply With Quote
Unread October 8th, 2019, 08:07 PM   #13
dmroeder
Lifetime Supporting Member
United States

dmroeder is offline
 
dmroeder's Avatar
 
Join Date: Apr 2006
Location: Vancouver, WA
Posts: 2,260
Quote:
Originally Posted by TheWaterboy View Post
I know this is older - but I have v32 and UINT is an option but is unsupported in the 5380 series PLC. Go Figure.
Are you sure? I'm fairly certain I tested this and it was only available for the 5380 and 5580 (5069 and 1756-L8x).
  Reply With Quote
Unread October 9th, 2019, 08:59 PM   #14
TheWaterboy
Lifetime Supporting Member + Moderator
United States

TheWaterboy is offline
 
TheWaterboy's Avatar
 
Join Date: May 2006
Location: State of Denial
Posts: 958
I just went through it yesterday, The datatype is there but when I try to use it I get the unsupported message. V32.11 as I recall.
  Reply With Quote
Unread October 10th, 2019, 11:10 AM   #15
Firejo
Member
United States

Firejo is offline
 
Firejo's Avatar
 
Join Date: Jun 2008
Location: Redmond, WA
Posts: 1,309
Quote:
Originally Posted by TheWaterboy View Post
I just went through it yesterday, The datatype is there but when I try to use it I get the unsupported message. V32.11 as I recall.
I have a 5380 L306 v32.011 and Logix designer 32.00.00 (CPR 9 SR 11). I'm able to configure, download and use a UINT without any errors or notices.
Just an FYI.
__________________
Go Hawks!!!
  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 01:45 AM
Signed & Unsigned Integers dbh6 LIVE PLC Questions And Answers 8 March 20th, 2013 09:36 PM
Modbus Signed vs UnSigned Issue lostcontrol LIVE PLC Questions And Answers 5 May 24th, 2011 01:34 AM
Signed / Unsigned integers with a PanelView shoelesscraig LIVE PLC Questions And Answers 6 February 26th, 2010 04:50 PM
Number formats in PLCs dexdyne LIVE PLC Questions And Answers 11 July 13th, 2007 09:58 AM


All times are GMT -5. The time now is 08:15 AM.


.