Getting Only the Day and the Month Using Lookout Time FunctionsPrimary Software: LookoutPrimary Software Version: 5.0 Primary Software Fixed Version: N/A Secondary Software:
Problem: Can I Get Only the Day and the Month Using Lookout Time Functions? How can I write to 3 separate PLC registers the current Day, Month and Year? Solution: You may use the "NOW()" function in Lookout to retrieve the current date and time. The result is a floating point number in which the integer represents date and the fraction represents the time of day. You can display this value on the HMI panel in different formats. Right click on this display and select 'Numeric Format' Currently, there is no built-in function that will take this floating point number, analyze it, and return the day, month, year and time as separate datamember values. This can be achieved using the following steps: 1) Define your own "reference time" (for example Jan. 1 of this year) 2) Determine the floating point value for that reference time 2) Subtract your floating point reference value from the current time's value 3) Use mathematical operations/expressions to calculate month and/or day of month. 4) Write each of these values to their respective PLC registers individually Related Links: Attachments:
Report Date: 10/31/2002 Last Updated: 11/19/2002 Document ID: 2QUARCPE |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
