LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

unsigned vs signed pointer-sized integer

I understand what pointer-sized integers are (and I was plesently surprised that they have been added to LabVIEW), but what's the difference between a signed pointer-sized integer, and an unsigned pointer-sized integer. they seem to do the same thing, so I thought maybe it just allows one to wire the different LabVIEW datatype to the input without a coercion dot. I can't seem to find anything about the difference.

 

~Benjamin

0 Kudos
Message 1 of 4
(4,141 Views)

BenjaminS wrote:

I understand what pointer-sized integers are (and I was plesently surprised that they have been added to LabVIEW), but what's the difference between a signed pointer-sized integer, and an unsigned pointer-sized integer. they seem to do the same thing, so I thought maybe it just allows one to wire the different LabVIEW datatype to the input without a coercion dot. I can't seem to find anything about the difference.

 

~Benjamin


I'm not really sure but there is most likely no technical difference. On the LabVIEW diagram this is simply a signed or unsigned 64 bit integer. But whenever this 64 bit integer is passed to a Call Library Node parameter that is configured to be pointer sized LabVIEW will copy the lower significant 32 bit part to the stack when it is running as 32 bit version and te entire 64 bit value when it is running as 64 bit (and of course the according reverse operation when you have wired the output side on the right side).

Message Edited by rolfk on 02-15-2010 11:06 PM
Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 4
(4,127 Views)
BenjaminS,

I'm fairly certain the difference in the two is their range of accepted values. Check out the LabVIEW Numeric Data Types Table (http://zone.ni.com/reference/en-XX/help/371361F-01/lvhowto/numeric_data_types_table/) for examples of Signed vs. Unsigned Data Types.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ben Sisney
FlexRIO V&V Engineer
National Instruments
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
0 Kudos
Message 3 of 4
(4,103 Views)

Of course Ben, but for a pointer that has little significance. The pointer-integer is passed to the function as is.

 

I would simply make sure that a particular pointer is always the same signedness just to be on the safe side, but LabVIEW does for integers of the same size really a cast anyways, just as C compilers normally do.

 

I guess you could say that the CPU treats pointers always as unsigned but that is also just an academic exercise really. It is how we like to look at the pointers and that is usually in Hex notation which by its nature is normally unsigned. For the CPU it is just a bunch of 1 and 0 anyhow.

Rolf Kalbermatter
My Blog
0 Kudos
Message 4 of 4
(4,092 Views)