LAVA Forums Buy cool LAVA gear Forums RSS Feed

Welcome Guest ( Log In | Register )

Tags
This content has not been tagged yet

> Bug reporting guidelines:

See here for the proper LabVIEW bug reporting procedure.


 
Reply to this topic Start new topic
> DBL to I16 bug
Kevin Boronka
post Aug 9 2006, 09:57 PM
Post #1


Active
*

Member
Posts: 18
Joined: 25-October 05
From: Kitchener
Member No.: 3342
Using LabVIEW Since:2003
LV:8.0.1 ,7.1.1 ,7.0
Canada ca_ontario Romania


I'm running LabVIEW 8.01

LabVIEW 8.01 handles data type conversions differently.

When converting a Double (36611.0) to an I16, the value of the I16 is maxed out Binary (111111111111111)

When converting a U16 (36611) to an I16, the value of the I16 is the same value as the U16 in Binary (1000111100000011)

This post has been edited by Kevin Boronka: Aug 9 2006, 10:00 PM
Attached File(s)
Attached File  LV8.01_BUG___DBL_to_I16.vi ( 9.45K ) Number of downloads: 175
 


Tags
This content has not been tagged yet
Go to the top of the page
+Quote Post
Ad
post Aug 9 2006, 09:57 PM
Post #















Tags
This content has not been tagged yet
Go to the top of the page
Quote Post
Ton
post Aug 10 2006, 05:11 AM
Post #2


CCT It
*****

Premium Member
Posts: 1290
Joined: 13-June 05
From: Woerden, Netherlands
Member No.: 2399
Using LabVIEW Since:2001
LV:8.5.1 ,6.1 ,8.2.1
Netherlands hol_utrecht Nothing Selected My Blog My Gallery


QUOTE (Kevin Boronka @ Aug 9 2006, 11:57 PM) *
I'm running LabVIEW 8.01

LabVIEW 8.01 handles data type conversions differently.

When converting a Double (36611.0) to an I16, the value of the I16 is maxed out Binary (111111111111111)

When converting a U16 (36611) to an I16, the value of the I16 is the same value as the U16 in Binary (1000111100000011)


It is strange indeed, in LabVIEW 8.2 and 7.1 the same occurs. But looking at the help states that:
QUOTE
This function rounds all floating-point numer values to the nearest integer

But still it should not do a typecast of U16 to I16 but a conversion.. seems like some work for NI

Ton

PS there is no difference when connecting the U16 directly to the indicator

--------------------
Certified LabVIEW Developer
Shouldn't you be programming a Code Repository solution?


Tags
This content has not been tagged yet
Go to the top of the page
+Quote Post
rolfk
post Jan 17 2007, 11:31 AM
Post #3


Extremely Active
****

Premium Member
Posts: 978
Joined: 9-April 04
From: Rotterdam
Member No.: 349
Using LabVIEW Since:1992
LV:8.5.1 ,8.2.1 ,7.1.1
Netherlands Switzerland Nothing Selected


QUOTE (tcplomp @ Aug 10 2006, 12:11 AM) *
It is strange indeed, in LabVIEW 8.2 and 7.1 the same occurs. But looking at the help states that:

But still it should not do a typecast of U16 to I16 but a conversion.. seems like some work for NI

Ton

PS there is no difference when connecting the U16 directly to the indicator


Actually not necessarily. This is a behaviour that also occurres in C, at least the compilers I know of and it has its uses when you read in data from a stream in a certain format but later want to reinterpret some of the data. I know for sure a few cases where I have relied on this fact and changing that now would certainly break lots of peoples VIs.

Rolf Kalbermatter


Tags
This content has not been tagged yet
Go to the top of the page
+Quote Post
robijn
post Jan 17 2007, 02:46 PM
Post #4


Very Active
***

Member
Posts: 165
Joined: 9-February 05
From: region Eindhoven, the Netherlands
Member No.: 1555
Using LabVIEW Since:2008
LV:7.1.1 ,8.5.1 ,8.2.1
Netherlands Nothing Selected Nothing Selected


QUOTE (rolfk @ Jan 17 2007, 12:31 PM) *
Actually not necessarily. This is a behaviour that also occurres in C, at least the compilers I know of and it has its uses when you read in data from a stream in a certain format but later want to reinterpret some of the data. I know for sure a few cases where I have relied on this fact and changing that now would certainly break lots of peoples VIs.

Indeed, I've also relied on that many times. If the behaviour is to be changed (which would not be a bad thing on itself IYAM), the automatic version upgrade process should replace the U32 or I32 nodes by Typecasts nodes. Because from the Typecast function that behaviour is expectable.

I find it strange that the typecast node sometimes modifies data. It should never do that.

Joris


Tags
This content has not been tagged yet
Go to the top of the page
+Quote Post

Reply to this topicStart new topic

 




Time is now: 10th October 2008 - 11:12 PM