Sign in to follow this  
Followers 0
kake

PLC5 - real time clock

4 posts in this topic

I have a PLC5/40L and a DDE link in an excel spreadsheet. The spreadsheet has a macro that records some counter values (DDE link) at the top of the hour (every hour) then the PLC sets counters to zero at the top of the hour (every hour) a couple seconds later. The clock from the PLC and the clock from the windows PC do not stay in sync. This causes zeros to be recorded on occation. How can I sync the two clocks? I cannot find an RTC function in the Thanks Kurt

Share this post


Link to post
Share on other sites
You can do a write to S:21, S:22, and S:23 in the PLC (These are the Time Registers in the PLC-5) from VBA in excel to keep the clocks sync'd. Going from memory it would be something like: DDEPoke RSIchan, "S:21", 10 Check out the VBA DDE examples in RSLinx HELP for more info Edited by TechJunki

Share this post


Link to post
Share on other sites
Another approach would be to let the PLC control the action. When the PLC clock senses the top of the hour trigger a copy of the relevant data to another set of registers, set a flag and clear the original registers. Meanwhile the VBA in excel, as it approaches the top of the hour begins watching that flag. When it goes true, copy out the relevant copied registers and reset the flag.

Share this post


Link to post
Share on other sites
Thanks for your input. I will investigate these. Kurt

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0