Sign in to follow this  
Followers 0
PdL

CX-Supervisor 2.1 clock synchronise PC-PLC

8 posts in this topic

A customer wants to run an installation on a timed basis so several PLCs from within CX-Supervisor need to have a start/stop time set with reference to the PLC clock time. So far no problem. But the system runs on a ship that sails the world, so different time zones are involved. I am looking for an easy way to provide a clock set or sync function from PC to PLC from within CXS. I am not sure it the PC clock is on a time server but I am sure the PLC network is not. I just want to test two options: - Operator syncs the PC clock to the PLC clocks whenever the boat sits on a spot for a longer periods. I could use the VB example CXServer.Clockwrite command. Anyone has an example? - Operator sets the clocks manually wen he likes. I could use the PLCClock component like described in this topic, but when I run the command as in the last post nothing happens, but no error. Besides when configuring the component I run into the same problem as in this topic, I can't set the comms settings. Is this component still supported? If possible I would like to use ready made components to do this so if anyone has suggestions or other methods to share I'd appreciate it!

Share this post


Link to post
Share on other sites
Hi PdL, Might be fixed by "OpenComponent" instead of execute above. Anyhow does the component work properly when you launch from CX-Programmer? If you still don't get this going I'll try to find some time to try it out... Bertie

Share this post


Link to post
Share on other sites
Hi Bertie, I did change the page name in the AxtiveX control, otherwise it does give an error. But it just does nothing when clicked, probably because the comms parameters have not been set, but this isn't possible either so how do I get the component to work?? Tried the OpenComponent command instead of Execute, same result. See attached. Running in demo mode as an example, but no difference in licensed mode. The clock component does work from within CX-Programmer, most likely because the comms parameters have been passed on correctly.... Anyway I will be off this project the coming weeks so will get back to it later on. If anyone has some suggestions in the mean time thanks! Clock_component.avi

Share this post


Link to post
Share on other sites
Tried out your little prob pdl and had the same results... could get it to work with CX-Server Lite but not CX-Supervisor - very dissapointing since it should be an included component. The only other alternative is to have the PC clocking writing to a DM area and using date set in PLC...etc...

Share this post


Link to post
Share on other sites
Hi PdL & Sleepy Wombat I took the challange and came to the same conclusion. I could not get to work as embedded ActiveX control or with OpenComponent (sorry for the bum steer). Interestingly, when browsing in the Script Wizard for OpenComponent it lists all the PLC Components (Memory Monitor, Setup, Error log etc) EXCEPT the PLC Clock component. Now I'm wondering if this ommission was intentional... I guess the CXServer.ClockRead and Clock write will still work - or indeed as Sleepy suggests writing to DM (or D ) area - just you need to create the UI now as a Supervisor page. Regards, Bertie.

Share this post


Link to post
Share on other sites
Thanks for the reply and pointing out the alternatives, but IMHO this is a bug in CXS and needs to be fixed...

Share this post


Link to post
Share on other sites
I came across this problem some time ago! I use web sinchronisation of my PC Clock with NTP servers, and every hour I sync my PLCs from within CX-Supervisor. This is my sollution: 1) CX-Supervisor created points (copy/paste): Nastavi_Cas_v_PLC --> set time in PLC is an Array point (4 fields), starting address W500 Nastavi_Cas_v_PLC Integer On Request PLC I/O PLC W500 4 Single word unsigned BCD Always Update Enabled 0 to 9999 [0] None Read Only Read Only Volatile No Description Sinhroniziraj_uro --> this is a control bit, to set PLC time with values in point Nastavi_Cas_v_PLC Sinhroniziraj_uro Boolean On Request PLC I/O PLC W504.0 1 Bit Always Update Enabled Off / On [FALSE] None Read Only Read Only Volatile No Bit za sinhronizacijo ure v PLCju 2) CX-Supervisor script, executed cyclic every hour: Nastavi_Cas_v_PLC[0] = $Minute*100 + $Second Nastavi_Cas_v_PLC[1] = $DayOfMonth*100 + $Hour Nastavi_Cas_v_PLC[2] = $ShortYear*100 + $Month Nastavi_Cas_v_PLC[3] = $WeekDay Sinhroniziraj_uro=1 OutputPoint(Nastavi_Cas_v_PLC) OutputPoint(Sinhroniziraj_uro) 3) You only need to do a very little program change in PLC: You could also install NTP server on your PC and use Ethernet settings in PLC to do synchronisation (if you use ethernet cards in PLCs - does not work with PLCs with embedded ETN like CJ1M-CPU13ETN). Best regards, JinX Edited by pro17

Share this post


Link to post
Share on other sites
Great! Thanks pro17, I think I can use this method.

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