LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Can't see device attributes or start PTP on NI-1588

I'm trying to use an NI-1588, simply to run as a time master, and after realizing that I need to "start it up" via software I cobbled together a simple "C" program to get it going.  After calling niSync_init I am unable to read any meaningful attributes from the device (they all come back as 0's).  Also, the function niSync_StartPTP fails, complaining that it can not determine the device's IP address.
 
I know this is a relatively new module, as there are no other posts in this forum on this product, but I hope that someone can help me to resolve my problem.
 
Regards
- Matt
0 Kudos
Message 1 of 8
(4,089 Views)

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

0 Kudos
Message 2 of 8
(4,080 Views)
Hi Matt,

Since I don't have a 1588 down in my group, I can't yet verify if that's what's supposed to be happening, but I'm escalating to R&D.  In the meantime, could you give me the C code you put together to init and try to get the attributes?  What attributes are you trying to get?

Thanks for your patience!
mike
0 Kudos
Message 3 of 8
(4,075 Views)

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

0 Kudos
Message 4 of 8
(4,070 Views)
Which OS and service packs are you using and do you have multiple network cards in addition to the PCI-1588 installed? It may also help if you can run ipconfig /all to determine if the OS has assigned an IP address to the board. It will not work otherwise. The board should be listed with the description of a AMD PCNET...

-Josh
0 Kudos
Message 5 of 8
(4,058 Views)

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

0 Kudos
Message 6 of 8
(4,056 Views)
Yep... the SP1 is your problem. There is a bug in XP that they fixed with SP2 that for some strange reason will only send UDP Multicast packets (required for 1588) out of the default NIC even when the application specifies a different one. Upgrade to SP2 or disable all of the other NICs in the system and it should work.

-Josh
0 Kudos
Message 7 of 8
(4,040 Views)
Well that worked - I disabled my other 2 NIC's and the PCI-1588 seems to work OK, at least my sample test code says it does.  On now to further testing and qualification ... and talk to my admin about SP2.
 
Thanks
- Matt
0 Kudos
Message 8 of 8
(4,036 Views)