News:

We really need your input in this questionnaire

Main Menu

Threshold script

Started by cserzs, November 13, 2014, 01:06:24 PM

Previous topic - Next topic

cserzs

Hi,

Could you send me a sample threshold function script for the following situation:

The configured activation event will be started if the last polled value more than 0 and less than 1

Thank you in advance and best regards,
Zsolt

multix

Hi
in treshold section, you must select "script" from function, samples=1, activation event and deactivation event as your choice.

Press Script Button and write :

dcival=GetDCIValue($node, FindDCIByName($node, "Status")); (Status=your DCI name)
if (dcival>0 && decimal <1) return true;
return false;

cserzs

Hi,

Thank you very much for your answer. I have tested your script but I found that the value of dcival in each case were "(null)". Please find the details in the attachment. However the dci value was about 2.8

What could be the problem?

BR,
Zsolt

Alex Kirhenshtein

There is a space in DCI name, please verify that you have space in configuration too.

cserzs

Hello,

Yes, in the DCI name also exist the space character before "(A)" substring. However I modified the DCI name to "MUXD_CurrentPA" and I checked the script with this name as well. The result was also the "(null)" value.

BR,
Zsolt

Victor Kirhenshtein

Hi,

can you show a screenshot of DCI "MUXD_CurrentPA" configuration?

Best regards,
Victor

cserzs

Hi,

Please find in the attachement.

BR,
Zsolt

tomaskir

Use FindDCIByDescription.

The field you are searching for is the description, not the name.

cserzs

Hi,

Thank you very much it is works well.

Regards,
Zsolt

KjellO

In transformation and threshold scripts, think you can simply use the "$1" to get last collected value.

dcival = $1;


If you wish to process values from another DCI you must of course use the FindDCI* methods, but here it looks like you are interested in the value from this particular DCI itself.

Best regards,
Kjell

cserzs

Hi,

Yes you're right, this is a useful advice.

thanks a lot,
Zsolt