PCS7 V8.2 Reading actual day

HRagab

Member
Join Date
Dec 2022
Location
Bnisuef
Posts
7
Hello everyone,
i would like to read in pcs7 v8.2 the actual day of the month(ex 1 or 25 of the month)
i used as attached read_CLK AND DT_DATE but i can't find a way to extract only the day there are a DT_DAY BLOCK But get the week day type Sunday or Monday.

any help for that

screen.png
 
In Siemens PCS 7, you can extract the day of the month from the date value stored in the CLK data block by using the following formula:

DayOfMonth := (DT_DATE AND %MDAY) + 1

The DT_DATE function reads the current date and time from the system clock. The %MDAY mask is used to extract the day of the month from the date value. Finally, the + 1 at the end is used to convert the zero-based day of the month to a one-based value, so the result will be in the range of 1 to 31.

You can then use the DayOfMonth variable in your program to perform any desired operations or control logic based on the current day of the month.
 

Similar Topics

In another life, I developed a large project in PCS7 V5.0. I created some custom function blocks and simulation logic that I would like to use. I...
Replies
0
Views
4,075
Does anyone have an example project of the cm ptp ET200 SP HA with 410-5H DCS (PCs7 9.1 SP1) for MODBUS MASTER/SLAVE communication ?
Replies
2
Views
132
Hello, Is there a sequence when installing both TIA Portal and PCS7 in the same PC? First TIA and then PCS7 or viceversa? Thanks in advance.
Replies
0
Views
484
Hello, I'm currently working on a project involving both PCS7 (v9.1 sp2 upd1) and a Panel Comfort system. This necessitates the use of TIA Portal...
Replies
2
Views
805
I'm coming from a background of PLC ladderlogic/rockwell products. I am new to blocks. Can you point me in right right direction? What I would...
Replies
5
Views
1,562
Back
Top Bottom