Created
January 25, 2021 22:05
-
-
Save mharsch/cfd02f95d8ae784c638f465251b9dcbb to your computer and use it in GitHub Desktop.
why does this fail in the Node-RED function editor?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (msg.payload == 0) { | |
| msg.payload = "No trip factor " | |
| } else if (msg.payload == 1) { | |
| msg.payload = "Over-current event while at constant speed" | |
| } else if (msg.payload == 2) { | |
| msg.payload = "Over-current event during deceleration" | |
| } else if (msg.payload == 3) { | |
| msg.payload = "Over-current event during acceleration " | |
| } else if (msg.payload == 4) { | |
| msg.payload = "Over-current event during other conditions" | |
| } else if (msg.payload == 5) { | |
| msg.payload = "Overload protection" | |
| } else if (msg.payload == 6) { | |
| msg.payload = "Braking resistor overload protection" | |
| } else if (msg.payload == 7) { | |
| msg.payload = "Overvoltage protection" | |
| } else if (msg.payload == 8) { | |
| msg.payload = "EEPROM error" | |
| } else if (msg.payload == 9) { | |
| msg.payload = "Undervoltage protection" | |
| } else if (msg.payload == 10) { | |
| msg.payload = "Current detection error " | |
| } else if (msg.payload == 11) { | |
| msg.payload = "CPU error" | |
| } else if (msg.payload == 12) { | |
| msg.payload = "External trip" | |
| } else if (msg.payload == 13) { | |
| msg.payload = "USP error" | |
| } else if (msg.payload == 14) { | |
| msg.payload = "Ground-fault protection " | |
| } else if (msg.payload == 15) { | |
| msg.payload = "Input overvoltage protection " | |
| } else if (msg.payload == 21) { | |
| msg.payload = "Inverter thermal trip" | |
| } else if (msg.payload == 22) { | |
| msg.payload = "CPU error" | |
| } else if (msg.payload == 25) { | |
| msg.payload = "Main circuit error" | |
| } else if (msg.payload == 30) { | |
| msg.payload = "Driver error" | |
| } else if (msg.payload == 35) { | |
| msg.payload = "Thermistor error" | |
| } else if (msg.payload == 36) { | |
| msg.payload = "Braking error" | |
| } else if (msg.payload == 37) { | |
| msg.payload = "Safe Stop" | |
| } else if (msg.payload == 38) { | |
| msg.payload = "Low-speed overload protection" | |
| } else if (msg.payload == 40) { | |
| msg.payload = "Operator connection" | |
| } else if (msg.payload == 41) { | |
| msg.payload = "Modbus communication error" | |
| } else if (msg.payload == 43) { | |
| msg.payload = "Easy sequence error (invalid instruction)" | |
| } else if (msg.payload == 44) { | |
| msg.payload = "Easy sequence error (invalid nesting count)" | |
| } else if (msg.payload == 45) { | |
| msg.payload = "Easy sequence execution error 1" | |
| } else if (msg.payload == 80) { | |
| msg.payload = "Encoder disconnection " | |
| } else if (msg.payload == 81) { | |
| msg.payload = "Excessive speed" | |
| } else if (msg.payload == 83) { | |
| msg.payload = "Position control range trip" | |
| } else { | |
| msg.payload = "ERROR" | |
| } | |
| return msg; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment