No announcement yet.

Help with clock setting from the web ... nettime

  • Filter
  • Time
  • Show
Clear All
new posts

  • Help with clock setting from the web ... nettime

    I think I have the C-more synchronized with the PLC. I took the clock values on the plc (sdt0.second for example) and copied them to a "D" register. In the c-more I set the clock to the appropriate "D" register .. I will find out at 1:00 am

    So, now I want the PLC to get the time from the web.

    I checked the help functions and found NETTIME.

    Instructions are a bit confusing to me .... do I leave everything set to the default except the fixed IP?

    What IP do I use ... I did a quick search on the web ... gives me ... NIST, Gaithersburg, Maryland

    Is this all I need to do and it will automatically sync?

    Thanks .... Mike

  • #2
    Ask your IT people - they may already have that service available on a local server. If it is, see if you have access to that server via an IP Address, or possibly use DNSLOOKUP instruction that can take a name to get you an IP Address (fixed vs. variable IP Address)

    If they don't have a Time Server available, you have to pick one on the Internet (assuming your PLC can access a gateway to the Internet). Others can chime in which one(s) they use.
    There are 10 kinds of people in this world, those who know binary, and those who do not.


    • #3
      Here's mine:

      Click image for larger version

Name:	1-3 - NETTIME.PNG
Views:	253
Size:	56.1 KB
ID:	124089


      • #4
        Man, I would have never gotten that from the help files!

        I am the IT guy ... and the panel designer, panel builder, programmer, documentation writer, cook, dishwasher ... ooops, went to far :-) As I tell everyone, I run everything in our house .. the washer, the dryer, the vacuum, the fridge ..... sorry, could not help myself ... wife says I have terrible humor.

        I am a one man shop .... my clients usually ask me not to use PLC's. They want a simple panel to control and sequence a few pumps and such. In fact, a panel I built last year had 28 relays just for login in it but that is what they wanted. Their electricians in the field can fix these easily. This time it is a remote site and they want it to report pump flow via e-mail and be able to turn off and on pumps remotely. I am using the PLC and a C-more panel and talking via a cellular modem.

        This has been a really steep leaning curve. Last time I touched a PLC was about 10 years ago (worked for Westinghouse in SC back them for 10 years ... they put a GE PLC in everything).

        Think I am finally at the point were I can actually built the panel!

        I will copy in these commands .

        Thanks so very much !!!!!!!



        • #5
          Sooooooooooo close and yet so far!

          It seems I am doing something wrong on the NETTIME command .... or maybe the PLC is not connecting to the modem?

          The error bit is coming on after a while so I know it is not working at this point.

          Till now, I have not tried to connect the PLC with the modem ... all my communication has been done using the c-more.

          Is there something I must to?

          The PLC, C-more and cellular modem all connect together using Ethernet via a dumb switch.

          Not sure what I need to do here ....

          Thanks .... Mike


          • #6
            OK ... I'm lost as usual.

            The PLC must be communicating with the web.

            I did the "IP Address Lookup" .... did a quick search for google time ... gave me "" ... entered this and hit look up ... came back with ... so it must be going out to the web to find this IP.

            I am getting a ST143 Error ... "any device time out" ... and getting an "operation timed out .. in NETTIME at $Main@5"

            I did increase the time out to 10000 ms

            Soooooo ... what am I doing wrong?

            Thanks .... Mike

            Attached Files


            • #7
              dumb ... OK, it still can be the PLC not talking to the web. Just hit me the look-up in the program is on the programming computer which is hooked to the web.

              So I know the Ethernet port is working as that is how the PLC talks to the C-more.

              I know the C-more talks to the web ... I use the remote program and it sends out e-mails.

              What do I need to do (or how can I check) if the PLC is talking to the web (via the cellular modem)?



              • #8
                What is the PLC's gateway setting?


                • #9
                  EXACTLY! ... but one minor problem yet ..... please see question ...

                  I was just writing to say "FOUND IT"

                  I remembered that when I was having problems with the c-more it was because I didn't have a gateway entered.

                  I went to "Internal Ethernet Port Configuration" .... hit configure .... Gateway .... hmmmm ... put in the modem IP .... IT WORKS!

                  You know, I might get the hang of this yet :-)

                  Sorry for writing so much ... it seems as I type, it helps going step by step through the process.

                  One minor problem .... I tried ( ... got a time out error .... tried entering "" ... came back with ... that worked but seems slow.

                  I went back to ... came back with ... this worked and seems faster then the .gov sites.

                  Questions: 1) is it "safer" to go with the gov site as this will be running for years and I assume they will not change their IP but google might?

                  2) do I need to put anything in the DNS address of the PLC? I have in there now. I put (primary) and (secondary) in the c-more so I could send out g-mail.

                  Thanks so much again !!!!!!!!!!! Mike

                  PS... did learn anther new command ...STRPRINT ... is it just used to look at the program and see something like this (just to confirm it is working) or is there other uses for it?


                  • #10
                    STRPRINT is good for sending data, commands, whatever to serial devices. My clock routines are just stuff I have played with to learn what I can do. I have a very old (but still current product) digital speed controller on my desk that has absolutely nothing to do with being a clock, but the Do-more is sending it commands to change a speed ratio setpoint and that allows me to use the LED display to show the current time.

                    And this was handy to learn to talk proprietary comms with that brand unit that I later had an opportunity to use another variant of in a retrofit project. And that was where STRPRINT was super useful.

                    But yes, in that example, it's just a neat way of seeing the last update time.


                    • #11

                      Still the same questions if anyone can help .....

                      I have let this run for the past few hours and I keep getting a time out error (about once per hour ... I set my timer to once a minute just for testing) on the .gov site

                      Thanks again ... Mike


                      • #12
                        I know that some time sites have a limit on how often an IP can interrogate. Check their documentation. Just checked, nist has a limit of one every 4 seconds so you should be okay with it. Check your specific time source.
                        Last edited by bcarlton; 07-17-2019, 10:18 PM.



                        • #13
                          Sorry ... one more question.

                          Thinking that I might have to change the time server IP at some point in the future, I want to use the "variable IP address" option in NETTIME

                          The Default is D0.

                          2 questions again ...

                          1) using a number pad, how would I need to enter this? or ????

                          2) the number pad on the c-more can only input 7 numbers ... I looked at the thumb wheel, 5 dig max. Is there a way of using say 4 variable ... something like D0":"D1":"D2":"D3 , then I could use 4 thumbwheels with three digits each? Or is there some other way on the c-more to enter this value?

                          Thanks .... Mike


                          • #14
                            I suspect you may have to use more than one (say, 4) numeric input controls on the c-more and combine them in the Do-More

                            Help topic DMD0039 says:

                            Variable IP Address : select this option if the IP Address resides in a numeric memory location in the CPU. This can be any readable DWord numeric location. This allows the IP Address to be changed at runtime. Each octet of the IP Address is stored in one byte of the Variable Address location. In the example below the Initialize Data instruction will use the :UB operator to place the 4 octet values of IP Address into the 4 Bytes of the DWord location D0 in the proper order.
                            I don't know that a C-More can do that (if it can I don't know how to make it do it)


                            • #15
                              Exactly what I needed ... I think.

                              I wondered about casting (just happened across it in the help area last week) ... think it makes sense now!

                              So, D0 is broken up into parts and the UDx is the "part" or section of the value.

                              Rather then a real number, I am guessing I can put something like an Rx value in the table (INIT).

                              I can then use 4 sets of 3 thumb wheels in the c-more and a "load" button

                              It is almost 3 in the morning here in VT .... I have the alarm set for 7 ... I will try it first thing ... well after my coffee :-)

                              Thanks so very much !!!!!!!!!!!!!!!!