1

Only 2 values of a parameter should change the Sensor Satus.

Topic: Only 2 values of a parameter should change the Sensor Satus.

The gps device sends me a parameter where the value could be a lot of values.

Can I have a sensor that can change its state according with the value of the parameter ONLY when 20 or 21 comes as value?

For Example:

When 20 value comes, I want to change the status a Disconnected.
When 21 value comes, I want to change the status to Connected

Any other value SHOULDN'T change the status of the sensor. Only 20 and 21.


param_x = 20 -> State of sensor: Disconnected
param_x = 14 -> State of sensor: Disconnected   (Still disconnected, because only 20 and 21 will affect the State of sensor)
param_x = 21 -> State of sensor: Connected
param_x = 10 -> State of sensor: Connected   (Still connected, because only 20 and 21 will affect the State of sensor)

Thanks so much for taking time to answer my question.

2

Only 2 values of a parameter should change the Sensor Satus.

Re: Only 2 values of a parameter should change the Sensor Satus.

Please follow the instructions below.

1. Create a custom digital sensor.
2. Leave option "Last message only" disabled.
3. Add the following lines into the calculation table:
   X=20; a=0; b=0
   X=21; a=0; b=1
4. Set the lower bound to 20 and the upper bound to 22.

Steps 3 and 4 are also attached as a screenshot.

@ Oleg Zharkovsky
Technical Consulting / Training Team
"Timely is the best. But still better late than never."
3

Only 2 values of a parameter should change the Sensor Satus.

Re: Only 2 values of a parameter should change the Sensor Satus.

zark wrote:

Please follow the instructions below.

1. Create a custom digital sensor.
2. Leave option "Last message only" disabled.
3. Add the following lines into the calculation table:
   X=20; a=0; b=0
   X=21; a=0; b=1
4. Set the lower bound to 20 and the upper bound to 22.

Steps 3 and 4 are also attached as a screenshot.



Thanks for your answer Zark! One more question. Is this solution going to work if the 2 values I need are for example 15 and 79?

I mean should I just ajust the bounds? and values of X in the calculation table?

4

Only 2 values of a parameter should change the Sensor Satus.

Re: Only 2 values of a parameter should change the Sensor Satus.

orlo_26 wrote:

Is this solution going to work if the 2 values I need are for example 15 and 79?

No, 'cause the values don't go one by one in this new case and there is one more range to to take into consideration (from 15 up to 79). So you need another instruction.

1. Create a custom digital sensor.
2. Leave option "Last message only" disabled.
3. Add the following lines into the calculation table:
   X=0; a=0; b=-5
   X=15; a=0; b=0
   X=16; a=0; b=-5
   X=79; a=0; b=1
   X=80; a=0; b=-5
4. Set the lower bound to 0.
5. Enable option "Apply after calculation".

@ Oleg Zharkovsky
Technical Consulting / Training Team
"Timely is the best. But still better late than never."