Weeknumber calculation

P.S I was not being disrespectful when I posted 'Germans must be strange people'



I didn't think for a moment that you would even dream of being disrespectful, Paul - let's hope our German members think the same!

There again, anybody that can dream up the idea of 360 day years and then send me bank statements with transactions listed as occurring on Feb. 30th has got to be at least a little bit strange!
 
Hi,

Germans must be strange people Roy. :rolleyes:
>I didn't think for a moment that you would even dream of being >disrespectful, Paul - let's hope our German members think the same!
absolutely.;)
From the attachment in Borte's post:
In commercial and industrial applications (delivery times, production plans, etc.), especially in Europe, it is often required to refer to a week of a year. Week 01 of a year is per definition the first week that has the Thursday in this year, which is equivalent to the week that contains the fourth day of January....

If you know that, it's not so hard to write a function
in Step7,to get the number of the week

cheers
Rolf
[ATTCHMENT]
 
Whow Rolf!

Thank you!
This was way better than I hoped for!

You solved all my problems... And the calculation wasn't to big either!

Cheers
Borte
 
have you also tried to unzip it and just open it cause maybe it was a normally safed program. in other words not archived but safed with the plain old "save as" option
 
have you also tried to unzip it and just open it cause maybe it was a normally safed program. in other words not archived but safed with the plain old "save as" option

Yes, I considered that, but there are 90 files mainly .DBF and .MDX which lookes more less normal for an archived S7 ´project.

Oops, hadn't spotted your answer Borte, will give it a try.

Edit:

Yep, that worked fine, thanks for the tip - never seen that done before.
 
Last edited:
As you say Borte, that solution is neater than I would have expected. Those who prefer their calendar week to start on Sunday rather than Monday will need to modify it slightly, as will those in countries where week 1 is always the week containing 01.01, but both those are pretty trivial.

Nice one Rolf!
 
Hi,

I'm glad if I could help a little..
The function is 'from the scratch', so it can
certainly be optimised for your purpose and
I've tested only some 'in_Date' in 2004 / 2005


@Roy,
Yes, I considered that, but there are 90 files mainly .DBF and .MDX which lookes more less normal for an archived S7 ´project.

I've checked this and it seems to be 'normal':eek: (SIEMENS)
The project is saved without 'Hardware..' to keep it small.

please check this in a Dos-Box with one of your project's
and type in dir *.*/s ..it's unbelievable:nodi:

cheers
Rolf
 
The project is saved without 'Hardware..' to keep it small.



I wondered if that might be why I couldn't open it directly, so I tried saving S7Guy's UDT example, which I happened to have open at present, without hardware, but I was able to dearchive it OK. Guess we'll just have to put it down to another Siemens funny!

Doesn't matter though, now I know how to solve the problem, it's no longer a problem!
 
I tested some dates in 2004/2005 too and it seemed to work fine, it got 53 weeks in 2004 and 52 in 2005 so I think it works fine. And I'm using it for marking purposes so I'll go for the international one (if there is one... ha ha)

Thanks again!
 

Similar Topics

Hello everybody, I believe that I will find experts here who have already solved a similar topic. I need to calculate the length of the...
Replies
7
Views
348
Does this instruction calculate values during a single scan, or does it require number of scans based on element count in the array? For Example...
Replies
3
Views
116
Hi!! I'm looking for Temperature rise calculation software from Rockwell, I just download "Product selection toolbox 2022" but this software is...
Replies
1
Views
226
I have a bunch of tags in Historian/VantagePoint that off by one decimal point. I looked into the HMI displaying the same number, and the HMI is...
Replies
2
Views
117
I might be overthinking my problem, but I need some help. I am trying to write a formula in my plc to calculate the footage of paper being...
Replies
6
Views
630
Back
Top Bottom