Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

GPS Function


kcopeland Jan 27, 2017 05:28 PM

Trying to use the GPS to set a clock on a CR1000.  In the help is says that the "TimeOffset" is type "Constant or variable".  I used a variable for that parameter and the CRBasic compiler (30.01) gives an error saying "Variable illegal in Parameter".  Is the help wrong or is the compiler wrong?


GaryTRoberts Jan 27, 2017 05:44 PM

Kyle,

Looking at the source code for the GPS() instruction, TimeOffset has to be a constant.

We will update the help to reflect this.

Thanks.


kcopeland Jan 27, 2017 05:51 PM

Thanks Gary.

That being said, I am looking for a way to only allow the GPS function to set the clock conditionally (when a boolean goes high).  It appears the GPS function executes the clock set (with a negated comm port) in the background and GPS can not be used in a conditional statement.  I tried to use the GPS function with negated comm port before the scan and it appears that once it sees the GPS function once, it will continually try to keep the clock in sync.  With the exception of parsing the GPS data and using a ClockSet function myself, is there anything else I can do?


GaryTRoberts Jan 28, 2017 06:49 AM

We could not come up with solution for you.  We have passed your question on to Research and Development to see if we can find you a answer.  We will get back to you soon.


GaryTRoberts Jan 30, 2017 05:37 PM

From Research and Development:

You can make the MaxTimeDrift a variable. Set the default value to -1 (this will disable setting time).  When you want to change time, set the MaxTimeDrift to a small value. After the time is set, change the value back to -1.


kcopeland Jan 30, 2017 05:46 PM

Great!  Tell them thanks for the answer.  And thank you Gary for tracking that down!

Log in or register to post/reply in the forum.