Are you sure about your conditions? both 1 and 2 test src >=50 and the second part will always be rtrue for one of the two cases. sSo it doesn't matter what value pvt contains.
The same thing holds true for 3 and 4
If you are receiving two msgs then you need to use a join to join the two msgs so the data can be tested at the same time.
But you do need to pay some attention to your proposed conditions.
Consider if soc == 50 then both (1 or 2) and (3 or 4) will apply.
As Zenofmud says, the output 1 or 0 is not dependent on the value of pvt.
I expect you have the conditions clear in your mind but you need to be able to define a precise algorithm for the computer.
Zenofmud , you are correct about the condition .
for 1 and 2 the out put will be true and for 3 and 4 the output will always be false.
I have tested with this function but sometimes it work and sometime all the condition are not meet .
Just taken a very quick look at your conditions and it would seem (to me) that...
The first two tests where msg1 >= 60, means that msg2 is redundant as it doesn't affect the condition.
So your piece of JavaScript is only doing two tests.
msg1 >= 60
msg1 <= 60 && msg2 <= 400
and of course the default when neither is true.
If msg1 was 'equal to 60' then test 1 or two would be satisfied.
I don't think this "logic" is what you are after.
Please note you have used the condition >= and <= which means if you had a value of 60 or 400 then both tests are satisfied (as that value appears in BOTH tests).
If for example you wanted 60 as the threshold, you could write two tests...
One for <= 60 // This will check for values for 60 and beow
And another for > 60 // This will check for values above 60 (61 or maybe 60.0000001)