LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI-Sync with cRIO-9035

Solved!
Go to solution

Hello,

 

I am attempting to setup a cRIO-9035 to receive 1588 Timestamp data via Ethernet to the second ethernet port on the cRIO (eth1).

I am sending the 1588 Grandmaster signal from a PXIe1065 with an NI 6682 time card.

 

I logged into the cRIO and followed the steps in this article: 

http://digital.ni.com/public.nsf/allkb/3FBB102D0D65AE3486257D88007CCB20

 

I modified the "/usr/local/natinst/share/TimeSync/tsm.json" file through the instructions as shown below:

 

        "timeReferences":       {
                "IEEE 1588-2008_1":     {
                        "defaults":     "/usr/local/natinst/share/TimeSync/TimeReferences/IEEE_1588-2008.json",
                        "priority":     "unknown"
                        "protocolConfig" :
                        {
                                "priority1" : 128,
                                "priority2" : 128,
                                "hwTimestamping" : 1,
                                "interface" : "eth1",
                                "statusFile" : "/var/run/ptp_eth1.status"
                        }
                },
                "timeKeeper":   {
                        "library":      "/usr/local/natinst/share/TimeSync/TimeKeepers/liblinuxTimekeeper.so.16.
                },
                "servo":        {
                        "library":      "/usr/local/natinst/share/TimeSync/Servos/libdefaultServo.so.16.0.0"
                }
        }

 

 

But I get the following error when I read the "/var/log/messages" file:

TimeSync daemon, got status: FAIL(-52005,null)

 

The article hints that it might be a syntax error from when I modified the "tsm.json" file.

 

1) Does anyone have the code required to setup IEEE1588-2008 with cRIO?

2) Is there a way to do this entirely through Measurement & Automation Explorer?

0 Kudos
Message 1 of 14
(9,156 Views)

Hello KeithLV,

 

As for configuration in MAX it looks like you should be able to see something like figure 2 in this article below.

 

Timing and Synchronization in NI LabVIEW - http://www.ni.com/white-paper/11466/en/

 

As for that error, it is mentioned in this article below. Would anything there be relevant to you?

 

NI-TimeSync 15.0 or Later Does Not Run on Linux Real-Time Targets with NI-Industrial Communications for EtherCAT 14.0 or Earlier Installed - http://digital.ni.com/public.nsf/allkb/214E0CA29D58611D86257F6C0073A3F2?OpenDocument

 

JY
Application Engineer, RF and Communications
National Instruments
0 Kudos
Message 2 of 14
(9,106 Views)

JY,

 

I am not seeing the picture shown in figure 2 of the article: http://www.ni.com/white-paper/11466/en/

I attached a picture of what I see in MAX under the network configuration settings.

 

This is what I should see in the Time Synchronization Properties in Max under the cRIO-9035 hardware. (http://www.ni.com/white-paper/11466/en/)

 

This is what I see for the Time Synchronization Settings (I cannot enable NI-Sync nor enable 1588 protocol):

Untitled.png

 

1) Is there a reason I do not see the NI-Sync settings??? I believe that I have TimeSync 16.0.0 installed.

 

 

I am not using EtherCAT, so I do not think the other article applies in my case.

Regardless, I am dumbfounded that I cannot see the NI-Sync settings with LabVIEW 16.0.0 and NI-TimeSync IEEE 1588 installed.

 

 

2) Should I have other Time packages loaded on the cRIO-9035 in order for the NI-Sync settings to show up?

What I have installed so far on the cRIO-9035:

Untitled1.png

Untitled2.png

Untitled3.png

 

Thank you,

Keith

Message 3 of 14
(9,102 Views)

Hi Keith,

 

Configuration through MAX is only for PharLap and VxWorks targets at the moment, so it's expected that you would not see the 1588 info in MAX for your target. You will need to configure 1588 on your LinuxRT target through the configuration files as you were doing at first.

 

The only software component you need to install for 1588 is the NI-TimeSync Time Reference for IEEE 1588-2008, which it looks like you already have installed.

 

I think this is probably just a syntax issue - bracket placement, missing comma, and it also looks like the end of the timekeeper library path is cut off. Give this a try:

 

{

                "timeReferences":          {

                                "IEEE 1588-2008-1":         {

                                                "defaults":          "/usr/local/natinst/share/TimeSync/TimeReferences/IEEE_1588-2008.json",

                                                "priority":            "unknown",

                                                "protocolConfig":             {

                                                                "priority1":          128,

                                                                "priority2":          128,

                                                                "hwTimestamping":        1,

                                                                "interface":        "eth1",

                                                                "statusFile":       "/var/run/ptp_eth1.status"

                                                }

                                }

                },

                "timeKeeper":  {

                                "library":              "/usr/local/natinst/share/TimeSync/TimeKeepers/liblinuxTimekeeper.so.16.0.0"

                },

                "servo":               {

                                "library":              "/usr/local/natinst/share/TimeSync/Servos/libdefaultServo.so.16.0.0"

                }

}

Message 4 of 14
(9,083 Views)

Hi Keith,

 

One correction my last post. You should actually remove the line:

 "hwTimestamping":        1,

 

This property is only valid for targets that support hardware timestamping with NI-TimeSync, like the IC-317x targets. So I don't believe synchronization will work correctly if you leave that flag in there. I'm going to get a note about this added to the KnowledgeBase article you referenced earlier as well.

Message 5 of 14
(9,067 Views)

Thank you! That worked!

Steps I took to start the TimeSync server on the cRIO-9035:

 

Before You Start:

a) Make sure you have 'putty' installed on your windows pc talking with the cRIO: www.putty.org/

b) make sure you have NI-TimeSync16.0 installed on the cRIO (right click on add/remove software located in Measurement&Automation Explorer(NI-MAX)
Untitled7.png

 

1)start 'putty' application and type in IP address of cRIO and then login when the command prompt window is shown.

NOTE: default username is admin (no password, so leave it blank and press enter)

 

2) go to the directory with the TimeSync Configuration Settings:

admin@NI-cRIO-9035-01B6E188: cd /usr/local/natinst/share/TimeSync/

 

3) Edit the TimeSync Config File 'tsm.json'

admin@NI-cRIO-9035-01B6E188: vi tsm.json

 

4) In the VI editor window, delete the contents of the file and paste the attached code 'tsm.json' into the file:

press the escape key on your keyboard to enter command mode for the VI editor

type the following to clear the file contents

:1,$d

copy the contents of the attached code into 'tsm.json'

 

{
	"timeReferences": 		{
		"IEEE 1588-2008-1":		{
			"defaults":          "/usr/local/natinst/share/TimeSync/TimeReferences/IEEE_1588-2008.json",
			"priority":            "unknown",
			"protocolConfig": 		{
				"priority1":          128,
				"priority2":          128,
				"interface":        "eth1",
				"statusFile":       "/var/run/ptp_eth1.status"
			}
		}
	},
	"timeKeeper":  {
		"library":              "/usr/local/natinst/share/TimeSync/TimeKeepers/liblinuxTimekeeper.so.16.0.0"
	},
	"servo":       {
		"library":              "/usr/local/natinst/share/TimeSync/Servos/libdefaultServo.so.16.0.0"
	}
}

 

On your windows machine: select all the code in the file I attached --> right click --> copy

On the cRIO putty window: (right mouse click inside the VI editor to paste the code.

write the changes you made and exit the file

press the escape key on your keyboard to enter command mode for the VI editor

type the following to write changes and quit/exit the file:

:wq

 

5) Restart the cRIO by pressing the cRIO power Button.

 

6) Reboot cRIO and restart your 'putty' session as discussed in step 1.

 

7) navigate to the cRIO log directory:

admin@NI-cRIO-9035-01B6E188: cd var/log

 

😎 search the log directory for status of 'TimeSync' when the cRIO booted up:

admin@NI-cRIO-9035-01B6E188:/var/log# grep 'TimeSync' messages


2016-08-09T09:47:01.000-04:00 NI-cRIO-9035-01B6E188 nitsmd[1936]: Starting TimeS ync daemon...
2016-08-09T09:47:01.000-04:00 NI-cRIO-9035-01B6E188 nitsmd[1936]: Successfully loaded the following TimeSync settings:
2016-08-09T09:47:01.321-04:00 NI-cRIO-9035-01B6E188 Library: /usr/local /natinst/share/TimeSync/TimeKeepers/liblinuxTimekeeper.so.16.0.0
2016-08-09T09:47:01.321-04:00 NI-cRIO-9035-01B6E188 Library: /usr/local /natinst/share/TimeSync/Servos/libdefaultServo.so.16.0.0
2016-08-09T09:47:01.321-04:00 NI-cRIO-9035-01B6E188 Defaults File: /usr/local/na tinst/share/TimeSync/TimeReferences/IEEE_1588-2008.json
2016-08-09T09:47:01.321-04:00 NI-cRIO-9035-01B6E188 Library: /usr/local/na tinst/share/TimeSync/TimeReferences/libtr_ptp.so.16.0.0
2016-08-09T09:47:01.000-04:00 NI-cRIO-9035-01B6E188 nitsmd[1936]: TimeSync daemo n running.
2016-08-09T09:47:01.000-04:00 NI-cRIO-9035-01B6E188 ptpd_wrapper[1949]: Started ptpd wrapper for NI-TimeSync 16.0.0.

Message 6 of 14
(9,050 Views)

Dear National Instruments:

 

PLEASE add the NI-Sync features into the NI-Linux Measurement and Automation (MAX) settings.

 

This was really convoluded on how to setup the NI-Sync using config files.

 

-Keith

Message 7 of 14
(9,046 Views)

Yikes!!!

Nevermind! The problem was not solved.

I attached the cRIO-9035 test project (added "Set Time Reference" example straight from Examples-->Timing and Synchronization-->Time-based-->Set Time Reference

 

I attached the error message below.

Initializing...
Calculating dependencies...
Checking items for conflicts. This operation could take a while...
Preparing items for download. This operation could take a while...
Deploying NI-cRIO-9035-01B6E188(successfully deployed target settings)
Deploying GetRTHostConnectedProp.vi (4.07 K)
Deploying niSync Convert 1588 Time To Time Stamp.vi (5.49 K)
Deploying whitespace.ctl (1.43 K)
Deploying TagReturnType.ctl (1.43 K)
Deploying Check Special Tags.vi (5.41 K)
Deploying niSync Convert Time Stamp To 1588 Time.vi (6.56 K)
Deploying DialogType.ctl (1.43 K)
Deploying Error Code Database.vi (4.13 K)
Deploying DialogTypeEnum.ctl (1.43 K)
Deploying Search and Replace Pattern.vi (7.80 K)
Deploying Trim Whitespace.vi (3.28 K)
Deploying Find Tag.vi (10.68 K)
Deploying Format Message String.vi (6.28 K)
Deploying General Error Handler Core CORE.vi (45.01 K)
Deploying General Error Handler.vi (10.33 K)
Deploying Simple Error Handler.vi (8.02 K)
Deploying IVI Error Message Builder.vi (15.08 K)
Deploying niSync IVI Error Converter.viniSync IVI Error Converter.vi loaded with errors on the target and was closed.
LabVIEW: Failed to load shared library niSync.*:niSync_GetErrorInfo:C . Ensure that the library is present on the RT target. Use either MAX to install NI software or FTP to transfer custom libraries to the RT target.
LabVIEW: Failed to load shared library niSync.*:niSync_error_message:C . Ensure that the library is present on the RT target. Use either MAX to install NI software or FTP to transfer custom libraries to the RT target.
Deploying NI-cRIO-9035-01B6E188 Container
Deployment completed with errors
0 Kudos
Message 8 of 14
(9,035 Views)

Hi Keith,

 

The example you're trying to run is for NI-Sync, which is the hardware driver for NI's PXI and PCI timing and synchronization modules. So it's not intended to run on cRIOs. The software component being used on your cRIO for software 1588 synchronization is installed with NI-TimeSync.

 

So maybe we could take a step back - what are you actually trying to accomplish? If the TimeSync daemon started successfully on the cRIO, that should be all you need to do to have that target participate in 1588. If you would like to monitor synchronization performance, you can monitor the ptp status file that you designated in the tsm.json file. (More info on that at the end of the KnowledgeBase article mentioned earlier.)

Message 9 of 14
(9,025 Views)

LindSW,

 

Design of System:

I am attempting to synchronize the cRIO-0935 over 1588 PTP with a PXIe-6682 in a PXIe-1065, slot 2 (peripheral, not hybrid slot).

 

I get this error when attempting to read the file "/var/run/ptp.status" on the cRIO within the following 1588_cRIO VI.

Error 8 occurred at Open/Create/Replace File in 1588_cRIO_Client_PXIgrandmaster.vi

Possible reason(s):
LabVIEW:  File permission error. You do not have the correct permissions for the file.

/var/run/ptp_eth1.status

Do I need to have this in the timed loop in "1588_cRIO_Client_PXIgrandmaster.vi" in the "Testing1588WithPXIgrandmaster_LaptopAndCRIOareClients.lvproj":

1) close the /var/run/ptp.status file

2) read the /var/run/ptp.status file

3) re-open the file to receive updates from the /var/run/ptp.status file

 

Is there a better way to do this?

How do you read a file in LabVIEW without closing the file (read the live data written to the file)?

 

I attached the LabVIEW code: both for the PXI and the cRIO.

 

Thank you,

Keith

0 Kudos
Message 10 of 14
(8,987 Views)