4 digit Julian Date in RSLogix 5000??

I think he's depending on the CPT command performing all mathematics in integer form, in which case the following test for equality will only pass in leap years.

Yes - this will fail in the year 2100 but do we really care?
 
Last edited:
Interesting way to calculate that !
2009/4=502.25
502.25*4=2009

but if rounding of is taking place because z_leap_year is DINT
then 2009/4=502
502*4=2008

Eureka !!
 
Bernie is exactly right. Can't remember where I got the idea but I tried it on many different years within a reasonable range (never got to 2100!) and it always works.

It is nice to be able to take advantage of an expressions limitations and use it for something cool!
 
Kind of nice taking advantage of it being an Integer. I had to pop open my calculator quick and check it out for myself. Always nice to learn something thanks.
 

Similar Topics

Good morning all, I'm integerating a device with a Rockwell PLC with V34 Studio 5000. The device reports error codes using a single integer to...
Replies
19
Views
1,301
Hi. I’m doing a PV 1400e to PVP 7 migration and I don’t know how to convert the old 8digit BCD type from PB1400e into something that will work on...
Replies
2
Views
597
Referencing KB document QA9877: "...FactoryTalk View SE Graphics supports single precision floating point values, and by default only provides...
Replies
4
Views
1,810
I am attempting to replace a single digit in string in studio 5000. I need to take the 23rd digit and change it from a 1 to a 5 while the rest of...
Replies
2
Views
1,558
Hello All, I have a Parker CTC touch screen Which connects with M340 Modicon plcs and also comunicates with a data aquisition computer using...
Replies
1
Views
1,560
Back
Top Bottom