05-02-2006 02:27 PM
05-03-2006 09:46 AM
Interestingly, after I call niSync_Init, I can use the VISA calls to access the device's attributes. But the NI-Sync calls do not work.
Another possibly related item is that the Sentinel Protection service always fails when I start-up. I think this service was included with the NI software (although I am not sure), but I have not hardware dongle so I'm not even sure what it's trying to do. I have disabled the service since I don't think I need it. I don't know if the NI-Sync software depends on this.
- Matt
05-03-2006 10:36 AM
05-03-2006 10:53 AM - edited 05-03-2006 10:53 AM
Some sample code:
status = niSync_init("PXI3::4::INSTR", VI_TRUE, VI_TRUE, &myVi);
if (status) // error or warning
{
niSync_error_message (myVi, status, emsg);
printf("niSync_init did not succeed: %s\n", emsg);
}
// fire up the PTP function
else
{
char ipstr[50];
ViInt16 int16;
status = viGetAttribute (myVi, VI_ATTR_RSRC_NAME,ipstr);
printf("RSRC_NAME: '%s'\n", ipstr);
status = viGetAttribute (myVi, VI_ATTR_INTF_NUM, &int16);
printf("INTF_NUM: '%d'\n", int16);
status = niSync_GetAttributeViInt32 (myVi, "", NISYNC_ATTR_INTF_NUM, &int32);
printf("INTF_NUM(2): '%d'\n", int32);
status = niSync_GetAttributeViString (myVi, "", NISYNC_ATTR_1588_IP_ADDRESS, sizeof(ipstr), ipstr);
printf("IP addr: '%s'\n", ipstr);
status = niSync_GetAttributeViString (myVi, "", NISYNC_ATTR_1588_UUID, sizeof(ipstr), ipstr);
printf("UUID: '%s'\n", ipstr);
status = niSync_StartPTP(myVi, NISYNC_VAL_INIT_TIME_SRC_SYSTEM_CLK, 0, 0, 0);
if (status) // error or warning
{
niSync_error_message (myVi, status, emsg);
printf("niSync_StartPTP did not succeed: %s\n", emsg);
}
else
{
printf("\nNI-1588 is Running!\n\n");
}
THe output is as follows:
RSRC_NAME: 'PXI3::4::INSTR'
INTF_NUM: '3'
INTF_NUM(2): '0'
IP addr: '0.0.0.0'
UUID: '00-00-00-00-00-00'
niSync_StartPTP did not succeed: The IP address for the specified device cannot
be determined, and, therefore, the specified operation cannot be completed.
Message Edited by mschrier on 05-03-2006 10:57 AM
05-03-2006 03:51 PM
05-03-2006 03:55 PM
Windows XP, SP1 (I now remember that I suspected this might be an issue, since NI-sync claims to require SP2). Total of three network cards: my main one to the corporate net, another for a separate subnet for my development, and the PCI-1588 on that same development subnet.
I manually assigned the IP address.
- Matt
05-04-2006 08:09 AM
05-04-2006 09:10 AM