how add two date in pc worx?
Hello, It’s not (easily) possible to add two variables of type LDATE in PC Worx Engineer … this would be a very unusual requirement. More common would be to add a duration to a Date/Time value - in this case something like the ADD_DT_LTIME function block may be suitable, as shown in the example below:
Can I ask why you need to add two Date values in the PLC? There may be a way to do this with type conversions, if you really need it … - Martin.
Hello Martin; Thanks for your prompt reply, yes what I need is to add a duration to a Date / Time value.
Where can I download the ADD_DT_LTIME function block.
Thank you,
Norberto Semião
Hello Norberto, The ADD_LDT_LTIME function block is included automatically with PC Worx Engineer, and can be found in this location:
- Martin.
OK thank you.
Is this function block also available for pc worx?
Thank you,
Norberto Semião
Hi Norberto, I’m afraid that this community forum doesn’t cover PC Worx Classic software (version 6 and earlier) … but (just quietly) have you tried something like the standard “Add” function? For example:
The result should be a number of milliseconds since 1.1.1990, I think, … I’m afraid I don’t have a Classic controller here to test this, but hopefully something like this will be useful for your application. If you need any more support on PC Worx Classic then please contact your local Phoenix Contact office, who will be able to help. - Martin.
Hello Martin,
yes I already tested and did not work, however with the help of Engineer Carlos Coutinho from Phoenix Contact Portugal I was able to solve the problem with the SYS_PLC_V1_21 library.
best regards,
Norberto Semião