LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Coercion Function

Hi all,
 
I am new to this forum and fairly new to Labview as well.
 
I am trying to use a VI that came with a digital I/O level measurement device. I believe the program was written in Labview 5.1 but I am using 7.1. When I run the VI, I get numerous warnings saying that data range coercion is no longer supported. The following is an example of a warning that I get: " Configuration.Sensor Length (cm) uses data range coercion, which now only applies to data entry; values will not be coerced when passed to subVIs. To coerce passed values, use the In Range and Coerce Functions". I am not sure what to do about this.
 
I have attached the VI library. Any help is much appreciated!
 
Thanks,
Ima
0 Kudos
Message 1 of 7
(4,260 Views)


@Ima wrote:
I have attached the VI library.
There was nothing atttached. 😞
 
Data coercion occurs if you manually set a range for a control (right-click..data range...). This means if somebody would try to enter a value that is out of range, the input would be coerced to the valid range, if so configured. (e.g. valid range=0...10, enter -20, value will be zero, the closest number in the valid range).
 
If a VI is called as a subVI, the data for the control is obtained via the wire connector, not the operator. In this case the value will not be coerced. It is the responsibility of the calling program to ensure that that inputs contain valid data.
 
Look at the ranges currently set for the controls of the subVIs, see if they are important.
 
0 Kudos
Message 2 of 7
(4,250 Views)

Oops..I'll try attaching again..

And thanks for your reply. I'll take a look at the ranges.

Ima

0 Kudos
Message 3 of 7
(4,244 Views)


@Ima wrote:
... When I run the VI, I get numerous warnings saying that data range coercion is no longer supported. ...

Once you re-save the files in the VI library with your current version of LabVIEW, the warnings will disappear.

A bit of background for the warning is in NI's Knowledgebase here.

=====================================================
Fading out. " ... J. Arthur Rank on gong."
0 Kudos
Message 4 of 7
(4,237 Views)

You were right, they did disappear! Thanks for your help 🙂

Ima

0 Kudos
Message 5 of 7
(4,232 Views)
I have a bug I can't track down and its likely due to a coercion problem. Is there a slick way tell labview to pretend like its an older version and coerce feeding from the data range settings? I'm going through 13 device driver files changing every instance of coercion to explicit coercion and its not pretty.
Thanks
Sloan
0 Kudos
Message 6 of 7
(4,013 Views)


Sloan PHYS wrote:
Is there a slick way tell labview to pretend like its an older version and coerce feeding from the data range settings?
You can try searching through the INI keys lists (there's one in the LAVA forums wiki), but I seriously doubt that there is.

___________________
Try to take over the world!
0 Kudos
Message 7 of 7
(3,975 Views)