Jon Sweeney Posted November 30, 2006 Report Share Posted November 30, 2006 I'm either going crazy, or have forgotten something basic, or this is a bug. :question: I have been away from LabVIEW for some time, working with Visual Basic, so either of the 1st two options is possible. I have tried this example with 3 different LV versions with the same result so I find it hard to believe it's a bug. But ... There is an integer input control with a Data Range of 1-10 and "Out of range action" set to "Coerce". I am unable, from the front panel to set it to anything except values between 1 and 10, as expected. But I also expect any calling parameter to be coerced. That isn't happening. Negative, 0, and values >10 are passed right through without coercion. The simple vi and calling vi is attached (ver 8.0.1). Download File:post-133-1164846160.viDownload File:post-133-1164846242.vi Thanks for any insight, Jon Sweeney Quote Link to comment
jpdrolet Posted November 30, 2006 Report Share Posted November 30, 2006 I'm either going crazy, or have forgotten something basic, or this is a bug. :question: I have been away from LabVIEW for some time, working with Visual Basic, so either of the 1st two options is possible. I have tried this example with 3 different LV versions with the same result so I find it hard to believe it's a bug. But ... There is an integer input control with a Data Range of 1-10 and "Out of range action" set to "Coerce". I am unable, from the front panel to set it to anything except values between 1 and 10, as expected. But I also expect any calling parameter to be coerced. That isn't happening. Negative, 0, and values >10 are passed right through without coercion. The simple vi and calling vi is attached (ver 8.0.1). Download File:post-133-1164846160.viDownload File:post-133-1164846242.vi Thanks for any insight, Jon Sweeney You're not yet crazy, you didn't forgot and it is not a bug: the behavior has been changed. The behavior of data range coercion has been changed in LabVIEW (???). Before, the data was coerced on call but that was potential for bugs very difficult to track down and source of numerous service calls to NI. Indeed there is no visual clue on the diagram indicating that the data was coerced on input. The datarange coercion has been removed for VI calls and you must now coerce the input data using the coerce node on the diagram. There is a message when you convert old VIs to recent LabVIEW versions that tells you that the behavior has changed when data range coercion is used. The data range coercion only occurs for user input. Quote Link to comment
Jon Sweeney Posted November 30, 2006 Author Report Share Posted November 30, 2006 You're not yet crazy, you didn't forgot and it is not a bug: the behavior has been changed.The behavior of data range coercion has been changed in LabVIEW (???). Before, the data was coerced on call but that was potential for bugs very difficult to track down and source of numerous service calls to NI. Indeed there is no visual clue on the diagram indicating that the data was coerced on input. The datarange coercion has been removed for VI calls and you must now coerce the input data using the coerce node on the diagram. There is a message when you convert old VIs to recent LabVIEW versions that tells you that the behavior has changed when data range coercion is used. The data range coercion only occurs for user input. Wow, I missed that one. I've used the "In Range and Coerce" for other things but never knew it was necessary for input controls that had the DataRange/Coerce set. Must admit though that it makes the diagram more self documenting. "???" must be before 6.0.1 so I've been in the dark a long time! Thanks so much for the response. Jon Sweeney Quote Link to comment
Chris Davis Posted November 30, 2006 Report Share Posted November 30, 2006 LabVIEW (???) I believe it was LV 7.0 but I can't find it anywhere in the upgrade notes Must admit though that it makes the diagram more self documenting. That's why they made the change. Essentially, part of your code was hidden on a property page, and couldn't be seen by the casual / new user. Quote Link to comment
crelf Posted November 30, 2006 Report Share Posted November 30, 2006 I believe it was LV 7.0 but I can't find it anywhere in the upgrade notes Yeah - and if you upgrade older code that uses this feature, you'll get a warning that it's not supported anymore. 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.