Celsius–Fahrenheit Converter
A PLC program built in OpenPLC Editor that converts a temperature from Celsius to Fahrenheit and raises a freezing alert. The conversion follows °F = (°C × 9) / 5 + 32, wired as a chain of function blocks: the Celsius input is multiplied by 9, divided by 5, then added to 32, with the constants held in named variables (K9, K5, K32) instead of being hard-coded. A separate section compares Celsius against zero with a less-than block and drives a Freezing_Alert output that turns true whenever the temperature drops below 0 °C. The program was tested in OpenPLC Editor's live debugger, where every wire shows its value as the program runs. Three test cases are shown: 25 °C gives 77 °F with no alert, 0 °C gives 32 °F with no alert, and −10 °C gives 14 °F with the freezing alert switched on. All values are integers, so results are whole degrees.