Here is the situation. Not everyone knows how to deal with military time.
So I used a math box to convert standard time to military time to deal with the UDT in the plc. All is good up to midnight.
What I have is they can enter in 5 for the hour. That goes to V1. Then I have a button to select AM or PM. C30 on for PM. The results goes to V100. That is now 17. I use that number for my UDT stuff. I wrote if(C30,V1+12,V1). Problem is 12 AM is midnight which is Zero. I can not figure out how deal with 12 plus 12 = 24. I need to change it to Zero for UDT to work.
FYI minutes is coming in on V2. I load them both into UDT1.hour and UDT1.Minutes.
Am I making this too complicated?