RSLogix Calculating 1st Monday of the Month

ksmohammed

Member
Join Date
Jan 2018
Location
Dallas
Posts
6
Hey guys,

I need help calculating first Monday of the month. Has anyone ever had to perform such calculation? Rockwell has UFDB that calculates the Day of the Week.
 
Hey guys,

I need help calculating first Monday of the month. Has anyone ever had to perform such calculation? Rockwell has UFDB that calculates the Day of the Week.

I suspect that I am mis-understanding the question, but here goes:

When you use the GSV to read the date and time into an array of dints, I call mine PLC_DateTime, index 0 is year, 1 is month, 2 is day

EQU PLC_DateTime[2] 1 ons First_Day_Oneshot ote Your_New_Tag

Capture.jpg
 
I would think you should be able to do that with a bit of code once you have the following:

- Day of the week
- Day of the month
- New month tracking bit

Once you enter a new month, you set the New Month tracking bit then look for Monday...
 
I don't think you'd even need the tracking bit, given that the first Monday (or any other day of the week) would occur no later than the 7th day of the month.
 
I suspect that I am mis-understanding the question, but here goes:

When you use the GSV to read the date and time into an array of dints, I call mine PLC_DateTime, index 0 is year, 1 is month, 2 is day

EQU PLC_DateTime[2] 1 ons First_Day_Oneshot ote Your_New_Tag

I *KNEW* that I had not understood the question ... why can't you see that sort of thing BEFORE you hit SUBMIT?
 
I would think of in only two conditions:
Day of week is monday ( this routine already exists) and day of the month (very easy to get) less than or equal to 6.
if those conditions are true the that is the first monday of the month.
 
Last edited:
I would think of in only two conditions:
Day of week is monday ( this routine already exists) and day of the month (very easy to get) less than or equal to 6.
if those conditions are true the that is the first monday of the month.

Less than or equal to 7... Today is a good example. :)
 

Similar Topics

All - I am writing a control panel program in RSLogix500 f/u/w a MicroLogix 1100 PLC controller. I have 8 exhaust port temps stored in...
Replies
4
Views
14,742
I have a little bit of experience with Allen-Bradley. I have a Micrologix 1500 (RSLogix 500) and a PanelView Plus 7 (FactoryTalk View Studio ME)...
Replies
2
Views
77
I am completely stuck on building a ladder program that requires a start button to be pressed 3 times to turn on motor 1. Then motor 2 starts...
Replies
20
Views
517
buen dia. tengo una falla al pasar los tags de mi plc SLC 5 0/4 a mi panel me aparece un error Problem writing value " " to item <tag name>...
Replies
1
Views
69
Back
Top Bottom