Thanks for giving me some ideas for getting started. I have taken you advice and have completed everything in your first paragraph. For now I have just done this for one card and have yet to try it with 2 cards at the same time. Here is my code that executes after niSync_StartPTP
while (i<100) {
//GET LOCAL 1588 CLOCK TIME
status = niSync_Get1588Time (myVi, &TSec, &TNano, &TFNano);
cout << "Time: " << TSec << "." << TNano << "." << TFNano << endl;
//GET STATE OF LOCAL 1588 CLOCK
status = niSync_GetAttributeViInt32 (myVi, "", NISYNC_ATTR_1588_1588_CLK_STATE, &int32);
cout << "State = ";
if (int32 == -1) { cout << "Not Defined (" << int32 << ")" << endl; }
else if (int32 == 0) { cout << "Initializing (" << int32 << ")" << endl; }
else if (int32 == 1) { cout << "Faulty (" << int32 << ")" << endl; }
else if (int32 == 2) { cout << "Disabled (" << int32 << ")" << endl; }
else if (int32 == 3) { cout << "Listening (" << int32 << ")" << endl; }
else if (int32 == 4) { cout << "Pre-Master (" << int32 << ")" << endl; }
else if (int32 == 5) { cout << "Master (" << int32 << ")" << endl; }
else if (int32 == 6) { cout << "Passive (" << int32 << ")" << endl; }
else if (int32 == 7) { cout << "Uncalibrated (" << int32 << ")" << endl; }
else { cout << "Slave (" << int32 << ")" << endl; }
//CHECK OFFSET FROM MASTER CLOCK
status = niSync_GetAttributeViReal64 (myVi, "", NISYNC_ATTR_1588_OFFSET_FROM_MASTER, &real64);
cout << "Offset = " << real64 << endl;
Sleep(250);
i++;
cout << endl;
}
}
A couple questions:
Is there a way to convert the seconds outputted into the date or at least hours:minutes:seconds?
Also, is there a way to code this loop in C++ so that it executes until I press a key to stop?
For now I am going to get this up and running on PC #2 and see how they communicate.
Message Edited by HNelson on 08-03-2007 10:46 AM