Unsigned Integer

mehrdad

Member
Join Date
Nov 2013
Location
canada
Posts
18
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
 
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.
 
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.
 
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
 

Similar Topics

I have a cognex camera that is transmitting a trigger id as an unsigned integer. However, everything in siemens displays it as a signed integer...
Replies
10
Views
6,200
I'm having to make an AOI to use with a generic ethernet device because the manufacturer does not provide an AOP. I just want to do a sanity check...
Replies
13
Views
1,250
Is there a way in CX-Programmer to ad UINTs together with an instruction without a compiler warning. Ladder Rung: Warning: Instructions...
Replies
2
Views
1,236
I'm trying to read a u32 register from a fuel meter over modbus rtu. There isn't a unsigned integer option under the "treat as" field. I select...
Replies
15
Views
3,854
Hello, I'm reading a modbus register 40125 I'm using a modbus poll program to read this register. If i read the register as a "signed" value it...
Replies
12
Views
9,228
Back
Top Bottom