Wow, 30 years!? Thanks, Norm, for being such a long-time OptoUser!
I’m still a little confused here on what you mean by “within a ms or two” for your test values, vs. “off a second or two in a few minutes…”, and I’m also not sure how this fits in with the rest of your logic – the timing of which could also vary depending on how many and what charts you’re running, etc.
However, there IS a 100ths of seconds value in the mem map, which you can read from your strategy.
Specifically at address F035 0000 (as seen here in the mem map protocol guide, form 1465):
and in PAC Manager:
Here’s how you might read/parse this in your strategy:
// Read date/time from mem map, format: "2015-01-09 14:36:48.96"
nResult = ReadStrFromIoUnitMemMap( 22, MyMemMap, 0xF0350000, sMemMapDateTime );
// that 22 character date/time could be parsed a few different ways, here's one way:
GetSubstring( sMemMapDateTime, 11, 2, sHours );
GetSubstring( sMemMapDateTime, 14, 2, sMinutes );
GetSubstring( sMemMapDateTime, 17, 2, sSeconds );
GetSubstring( sMemMapDateTime, 20, 2, sMilliseconds );
sMilliseconds = sMilliseconds + "0"; // since we read just hundreds of a second
nMSSinceMidnight = StringToInt32(sMilliseconds) + (StringToInt32(sSeconds) * 1000) + // that's all the seconds & parts of them
( StringToInt32(sMinutes) * 60 ) * 1000 + // there's the minutes converted to milliseconds
( StringToInt32(sHours) * 60 * 60 ) * 1000; // there's the hours to minutes to seconds to milliseconds
I’m not sure you’d even need to do all that parsing. Depending on your setup, you might have a “master” R1 that’s occasionally calling the NTP commands also do that ReadStrFromIoUnitMemMap above, then do the corresponding write to all other R1s.
The write would look like this:
nResult = WriteStrToIoUnitMemMap( YourMemMap, 0xF0350000, sMemMapdateTime );
Do you see what I mean? Would that help?
-OptoMary