Hello everyone, I am curious if the DTR instruction can be used to generate a weekly pulse. Can someone provide assistance in understanding this concept? I have successfully generated a one-second pulse by masking "255" with the source and reference values as the PLC clock's second. For example, if I create a pulse at midnight and increment it by 1 each time until it reaches 7, a pulse will be generated. However, a potential issue arises if the site is started in the middle of the week, as it will not complete a full week. Any advice on how to address this situation would be greatly appreciated. Thank you in advance.
One interesting project I worked on involved calculating the Julian Date and day of the week using a SLC 5/04 system. It's been nearly two decades, but I vaguely recall possibly utilizing a lookup table for the Julian date of the first Sunday of the year. Maintenance utilized the Julian Date of the previous Sunday as a password, leading to occasional login issues if the password was forgotten. To streamline the process, I automated it for easier access. In the Logix 5000 environment, consider starting with a GSV of the LocalDateTime attribute of the WallClockTime Class to calculate the current day of the year. Monitor the time elapsed since the last week pulse and trigger a new pulse if more than seven days have passed. Keep a log of the current day of the year for reference in the future.
The CurrentValue attribute of the WallClockTime GSV glass represents the number of microseconds since January 1, 1970. This date fell on a Thursday. By dividing the 64-bit CurrentValue by 86,400,000,000Β΅s/day (truncated down, not rounded), you can calculate the offset in days from January 1, 1970. Taking this days offset result modulo 7 will give you the offset in days from Thursday, where 0 represents Thursday, 1 is Friday, and so on up to 6 for Wednesday. To generate a pulse on Monday, monitor the [GSV=>DIV by 8.64E10 => MOD by 7] value from the previous scan. When this value changes from not 4 to 4 (as Monday is offset from Thursday by 4 days), trigger the weekly pulse accordingly.
One important factor to consider is how to account for downtime when the machine is turned off, especially on Mondays or for an extended period of time. While this can be easily managed, your chosen method is likely a more straightforward way to calculate the Julian date or a similar metric.
Looking for a convenient way to determine the day of the week in your Rockwell software? Visit Rockwellsoftware.com for a complimentary add-on instruction that provides this functionality. Additionally, they offer useful date add/subtract add-ons for calculating downtime when your machine powers on. Don't miss out on these essential tools for maximizing efficiency in your operations.
Hey there! It sounds like you're on the right track with generating pulses! To create a weekly pulse using the DTR instruction, consider incorporating a way to track when the PLC starts upβlike storing a timestamp or a counter in your memory that resets after reaching 7 days. You could check the current day against that stored value and trigger the pulse accordingly. This way, even if your system starts mid-week, you'll ensure it accounts for the missed days. Adding a little logic to handle scenarios like unexpected starts should help you maintain a consistent weekly pulse! Good luck!
It sounds like you've made great progress with the DTR instruction for generating a pulse! To tackle the situation of starting mid-week, consider implementing a way to track the current day of the week when your system boots up. You could use a combination of timers or system clocks to determine if the process has already started for the week. By storing the last pulse time or using a bit to mark that the weekly pulse has been initiated, you could adjust your logic to ensure the pulse aligns with the intended start day each week. This way, even if the system kicks in mid-week, it won't disrupt your weekly cycle. Good luck!
β Work Order Management
β Asset Tracking
β Preventive Maintenance
β Inspection Report
We have received your information. We will share Schedule Demo details on your Mail Id.
Answer: - Yes, the DTR instruction can be utilized to generate a weekly pulse by manipulating values and conditions within the PLC program.
Answer: - One approach is to mask specific values with the source and reference values, such as using the PLC clock's second, and incrementing the pulse generation until it reaches the desired weekly interval.
Answer: - An issue may occur if the site is started in the middle of the week, as it may not complete a full week cycle, leading to a potential discrepancy in the pulse generation process.
Answer: - To address this situation, you may need to implement logic or additional programming steps to account for the starting point of the pulse generation and ensure a complete weekly cycle even if the process begins mid-week.
Join hundreds of satisfied customers who have transformed their maintenance processes.
Sign up today and start optimizing your workflow.