04-12-2023, 12:15 AM
Hi, you can check if it works using the emulator first. Just replace the modbus with the emulator output variables
This correction is better in case the input value is not in range 1..3
I don't know why it happens. I have checked your script. It works fine. You have to post more information about this issue.
This correction is better in case the input value is not in range 1..3
Code:
if (BranderModus == 1) {
Branderuit = '{"tag":"OutputTag1", "value":1}';
Branderaan = '{"tag":"OutputTag2", "value":0}';
result = [Branderuit, Branderaan];
} else if (BranderModus == 2) {
Branderuit = '{"tag":"OutputTag1", "value":0}';
Branderaan = '{"tag":"OutputTag2", "value":0}';
result = [Branderuit, Branderaan];
} else if (BranderModus == 3) {
Branderuit = '{"tag":"OutputTag1", "value":0}';
Branderaan = '{"tag":"OutputTag2", "value":1}';
result = [Branderuit, Branderaan];
} else {
result = null; // return null if you don't want to send a value to output variable
}
I don't know why it happens. I have checked your script. It works fine. You have to post more information about this issue.