Тема: I can n't recover the value of sensor ignition
Hi i have this issue
I can n't recover the value of sensor ignition, I always get the value -348201.3876
This is my code
for (var i = 0; i< units.length; i++)
{ // construct Select object using found units
var u = units[i]; // current unit in cycle
var unit = wialon.core.Session.getInstance().getItem(u.getId());
var sens = unit.getSensors();
for(var z in sens) // construct select list
{
var str = sens[z].n
var res = str.substring(0,4)
if (res == 'Igni')
{
var result = unit.calculateSensorValue(sens[z].n, unit.getLastMessage());
if (result != -348201.3876 && parseFloat(result))
{
value = 'on';
}
else
{
value = 'off';
}
break;
}
}
}
}