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 January 26th, 2014, 11:56 PM   #1
mehrdad
Member
Canada

mehrdad is offline
 
Join Date: Nov 2013
Location: canada
Posts: 17
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
Old January 27th, 2014, 06:58 AM   #2
Robobob
Lifetime Supporting Member
United States

Robobob is offline
 
Robobob's Avatar
 
Join Date: Apr 2004
Location: Toledo
Posts: 206
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
Old January 27th, 2014, 07: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
Old January 27th, 2014, 09: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,147
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, 407 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 09:56 AM. Reason: To attach picutre
  Reply With Quote
Old May 17th, 2018, 04:35 PM   #5
preacher.ca
Lifetime Supporting Member
Canada

preacher.ca is offline
 
preacher.ca's Avatar
 
Join Date: Jan 2014
Location: Regina
Posts: 14
Thanks "TConnolly". Your posted solution was exactly what I needed to add to my Function Block Diagram.
  Reply With Quote
Old October 11th, 2018, 02: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
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
Signed & Unsigned Integers dbh6 LIVE PLC Questions And Answers 8 March 20th, 2013 08:36 PM
Modbus Signed vs UnSigned Issue lostcontrol LIVE PLC Questions And Answers 5 May 24th, 2011 12:34 AM
Signed / Unsigned integers with a PanelView shoelesscraig LIVE PLC Questions And Answers 6 February 26th, 2010 03:50 PM
Number formats in PLCs dexdyne LIVE PLC Questions And Answers 11 July 13th, 2007 08:58 AM


All times are GMT -5. The time now is 10:19 PM.


.