LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Asignarle un límite a un indicador numérico.

Hola, estoy aprendiendo a usar LabVIEW, hasta ahora todo intuitivo, pero me encuentro con el asunto de que necesito que un indicador numérico no supere X valor, podría hacerlo con un case, pero opto por asegurarme de que no haya alguna función de nodo o simplemente alguna propiedad que pueda facilitarme eso, muchas gracias.

0 Kudos
Message 1 of 5
(739 Views)

Hi AKSR,

 


@AKSR02 wrote:

Hi, I'm learning how to use LabVIEW, so far so intuitive, but I'm running into the issue that I need a numeric indicator to not exceed Just some property that can facilitate that for me, thank you very much.


So you want to limit the value shown in an indicator? What about using the InRangeAndCoerce function?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(709 Views)

Hi AKSR,

Like GerdW wrote, it sounds like the "In Range and Coerce" function is what you are after. The screenshot below shows how you can use this function to force a certain value (in the example 101.2345) to be in a certain range (in the example 0 to 100).

Petru_Tarabuta_0-1698695485164.png

 

You can find In Range and Coerce inside the Programming >> Comparison palette. By default the function includes the lower limit, but excludes the upper limit. You can right-click on the function and select "Include upper limit".

 

When using numeric controls (numeric inputs on the Front Panel), there is an easy way to limit the values that the user can type in. You can right-click on the control and select "Data Entry..." or select "Properties" and then select the "Data Entry" tab, then you can configure a Minimum and Maximum allowable input value. This can help insure that only safe values are written to an output channel, etc.

Petru_Tarabuta_1-1698695793447.png

0 Kudos
Message 3 of 5
(671 Views)

Hi AKSR,

 


@Petru_Tarabuta wrote:

When using numeric controls (numeric inputs on the Front Panel), there is an easy way to limit the values that the user can type in.


One remark: this really only applies to values typed in by the user.

Input coercion does not apply to values given as input to subVI controls by connector pane/wire!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 5
(654 Views)

Hi GerdW,

 

Thanks for the clarification.

 

I was curious to test this, so created the attached VIs (LabVIEW 2016). They confirm that Data Entry Limits do not coerce the values fed by a caller VI to a subVI.

 

Screenshot 1: The subVI

Petru_Tarabuta_0-1698739158550.png

 

Screenshot 2: Running the caller VI results in the uncoerced value being shown from inside the subVI

Petru_Tarabuta_1-1698739198137.png

Download All
0 Kudos
Message 5 of 5
(648 Views)