Götz Becker Posted June 17, 2008 Report Share Posted June 17, 2008 Hi again, I recently found another data conversion I don´t understand. Why isn´t there a coercion dot at the second join numbers? LV 8.5.1 I know that this isn´t a good style for lowlevel data manipulation, but a hint from LV about the implicit byte that is added would be nice. Quote Link to comment
crelf Posted June 17, 2008 Report Share Posted June 17, 2008 On closer inspection, I think you're right - there should be a coercion dot there... Quote Link to comment
Aristos Queue Posted June 17, 2008 Report Share Posted June 17, 2008 Reported to LV R&D as CAR #116157. Quote Link to comment
Götz Becker Posted June 17, 2008 Author Report Share Posted June 17, 2008 Thank you for reporting. After playing a little with join numbers I came to another behavior I wouldn´t have (naively) expected: (both results are the same) The implicit type cast of the signed inputs made total sense to me after a second thought and reminded me to always think (at least) twice about the bits and bytes underneath when using the data manipulation primitives. Quote Link to comment
silmaril Posted June 18, 2008 Report Share Posted June 18, 2008 QUOTE (Götz Becker @ Jun 17 2008, 12:28 AM) The implicit type cast of the signed inputs made total sense to me after a second thought and reminded me to always think (at least) twice about the bits and bytes underneath when using the data manipulation primitives. Yes I agree that this type cast makes sense. Still, it wouldn't hurt to have coercion dots at those inputs, too. To split some hairs: In this example, the I16 values are not really coerced, they are typecasted, which should make a difference for negative numbers. But that seems to be LabVIEW's normal coercion dot behaviour for converting I16 to U16. If you wire a value of -1 to an U16 input you will get 0xFFFF (which is correct, but I would call this a type cast; a coercion should give the result 0 here as I understand this term). Quote Link to comment
Ton Plomp Posted June 18, 2008 Report Share Posted June 18, 2008 QUOTE (Götz Becker @ Jun 16 2008, 03:53 PM) http://lavag.org/old_files/monthly_06_2008/post-1037-1213624138.png' target="_blank"> One question is the U8 converted or typecasted? With a typecast the U8 is placed in the upper byte of the U16. Ton Quote Link to comment
Aristos Queue Posted June 18, 2008 Report Share Posted June 18, 2008 QUOTE (tcplomp @ Jun 17 2008, 05:13 AM) One question is the U8 converted or typecasted? With a typecast the U8 is placed in the upper byte of the U16. You're right that conversion and typecast are behaving differently, but that would change on a machine with different endian-ness. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.