Back

Topic

[KB777]How to change variable thresholds at once

Tags: Scada Basic

10 years ago
By RM
Options
Print
Applies to:

PcVue all versions


Summary:

You can change at once several threshold values using following scada basic instruction:rank

However, the new threshold value is sometimes not updated.


Solution:

There are different ways to change variable thresholds.

For example you create 4 Scada Basic procedures for levels hihi, high, low and lolo.

You will then notice that sometimes the THRESHOLD_SETVALUE mode does not work if you call these procedures one after the other, as shown below:

Sub threshold_hihi()

     variable(“THRESHOLD_SETVALUE”,VarName,Rank_hihi,Value);

End Sub

Sub threshold_high()

     variable(“THRESHOLD_SETVALUE”,VarName,Rank_high,Value);

End Sub

 Sub threshold_low()

     variable(“THRESHOLD_SETVALUE”,VarName,Rank_low,Value);

End Sub

 Sub threshold_lolo()

     variable(“THRESHOLD_SETVALUE”,VarName,Rank_lolo,Value);

End Sub

 

 Sub Main()

     threshold_hihi();

     threshold_high();

     threshold_low();

     threshold_lolo();

End Sub

 

To fix this refreshing issue , you must use the same instruction with

the following syntax:

Sub Main()

     ‘variable(“THRESHOLD_SETVALUE”,Varname,Rank,Value[,Rank,Value][,Rank,Value][,Rank,Value]);

     variable(“THRESHOLD_SETVALUE”,“Register”,3,@Value_lolo,2,@Value_low,1,@Value_high,0,Value_hihi);

End Sub

 

This instruction must be used for all rank modification.

Please refer to online help for further details about VARIABLE Scada basic instruction

 

Warning: 

Concerning threshold value, the following rule must always be applied:

Value_lolo < Value_low < Value_High < Value_hihi

For example, you can have:

       Threshold_hihi = 100

       Threshold_high = 90

       Threshold_low = 10

       Threshold_lolo = 0

If you try to set threshold_high value to 101, it will not work because threshold_hihi must always be greater than threshold_high. 

 

Rank number is as follow:

       0 -> rank_hihi

       1 -> rank_high

       2 -> rank_low

       3 -> rank_lolo

  

 


Created on: 13 Apr 2015 Last update: 13 May 2024