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 23rd, 2014, 05:59 PM   #1
mehrdad
Member
Canada

mehrdad is offline
 
Join Date: Nov 2013
Location: canada
Posts: 17
Unsigned Integer

Hi all,

apparently there is no data type UINT (Unsigned Integer) in RsLogix5000!
is that correct?!! or it has got a different name?
if there is no UINT then what is the way around this without using DINT instead?

thanks
  Reply With Quote
Old January 23rd, 2014, 06:04 PM   #2
TConnolly
Lifetime Supporting Member
United States

TConnolly is offline
 
TConnolly's Avatar
 
Join Date: Apr 2005
Location: Salt Lake City
Posts: 6,151
Make it a DINT. If you make a tag an INT then it is still going to allocate 4 bytes of memory unless it is part of an array. Its a 32 bit system, so 32 bit chunks are more efficient.

Do not use MOV to transfer a 16 bit unsigned pattern to it. Use COP, CPW, AND, BTD, or similar appropriate instruction.
__________________
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.
  Reply With Quote
Old August 22nd, 2019, 09:52 AM   #3
votecoffee
Member
United States

votecoffee is offline
 
Join Date: Nov 2011
Location: MI
Posts: 20
Changes in v32

They added unsigned types in version 32. They don't play very well in some cases though. You can't use the COP instruction on unsigned types, and you can't use string conversion operators on them like DTOS and STOD. they also don't support BTD and a few other operators you would expect.



Unless you have a strict need, you're better off using signed types that are larger like the previous answer recommends, or using a signed type of the same size if you're not using math operators on them.


BTD is also handy when copying unsigned data between SINT/INT/DINT and better conveys the intent than a COP instruction. It also prevents foul ups when copying array elements as COP will copy multiple source blocks to single destination blocks or vice versa if the size doesn't match.
  Reply With Quote
Old August 22nd, 2019, 09:56 AM   #4
dmroeder
Lifetime Supporting Member
United States

dmroeder is offline
 
dmroeder's Avatar
 
Join Date: Apr 2006
Location: Vancouver, WA
Posts: 2,206
Quote:
Originally Posted by votecoffee View Post
They added unsigned types in version 32. They don't play very well in some cases though.
For clarity, unsigned types were added in v32 but only for the 5580/5380 controllers (L8xE/5069).
  Reply With Quote
Old August 22nd, 2019, 10:23 AM   #5
kamenges
Member
United States

kamenges is online now
 
kamenges's Avatar
 
Join Date: Nov 2002
Location: Brillion, WI
Posts: 3,874
Quote:
Originally posted by votecoffee:

You can't use the COP instruction on unsigned types,...
Rockwell has perpetrated some true head-scratchers in the past but this one might take the cake. COP, by design is not concerned with data type. It is a byte-by-byte duplication with no concern for conversion. Why it would have issues with an unsigned type is completely beyond me.

Keith
  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
ML 1100 floatvalues to two integer values srv LIVE PLC Questions And Answers 3 December 3rd, 2012 03:52 PM
Red Lion Strings from Integer Array Old No. 7 LIVE PLC Questions And Answers 10 November 3rd, 2010 08:16 PM
Signed / Unsigned integers with a PanelView shoelesscraig LIVE PLC Questions And Answers 6 February 26th, 2010 03:50 PM
Copying integer values gbradley LIVE PLC Questions And Answers 6 April 25th, 2008 08:49 PM
Migrating VB6 IDEA app to VB.Net Extrasoft LIVE PLC Questions And Answers 5 November 4th, 2007 06:13 AM


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


.