Convert Miltary Time to AM / PM Time

Tim Ganz

Member
Join Date
Dec 2010
Location
Dallas, Texas
Posts
685
How can I convert military time to 12 hour time in a contrologix 5000 plc? The machine already has a GSV block and it has a destination named clock and if I look at that tag it has the data and time in it. I just want to display it with a event on the HMI page and it is on the page now like I want but it is in military hours. How is a simple way to change this? I am just starting to learn this plc so the elegant way would confuse me. I need down and dirty simple?
 
To create a PM bit (0 = AM, 1 = PM) and '12Hour' from '24Hour'

If 24Hour > 11 then PM = 1 else PM = 0

12Hour = 24Hour
If 12Hour = 0 then 12Hour = 12
If 12Hour > 12 then 12Hour = 12Hour - 12
 

Similar Topics

Hello all, I'm currently working on a servo motor linear positioning system (ball screw). I'm all set up regarding communication between my HMI...
Replies
1
Views
87
I have an application using an incremental encoder and then I convert it to degree (0-360) using calculation program. For a while, the calculation...
Replies
7
Views
233
Hi all. Me again still learning Rockwell. So I'll be polling an INT data array from a Modbus SE power meter with a L82 (with a Modbus ProSoft in...
Replies
56
Views
1,354
Hello, could someone kindly convert the attached RSP files that are currently used for SLC 5 PLC into PDF please
Replies
6
Views
519
I'm trying to convert an RS Logix 500 fille when I open the 500 file and try to "save as" a .slc file, it does not allow it. It says " SLC library...
Replies
7
Views
681
Back
Top Bottom