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,699
Hello all, I have a question in regards to RSlogix 5000. I am having issues with the program force closing when I try to make online edits. We...
Replies
0
Views
77
I am having trouble with getting no control of my analog output signal. I am using the SCL function block to control my analog output. The logic...
Replies
11
Views
201
Hello, Haven't been on in a while. I need to generate a bit level pdf of the I/O for RSLogix 500. I can generate a report but it just shows the...
Replies
1
Views
106
Greetings ... someone sent me a request for some student handsouts that I developed ... turns out that I had this hosted on my business website...
Replies
0
Views
99
Back
Top Bottom