This example demonstrates how to use the TSN driver to create a single Talker/Listener application for deterministic data streaming. This driver provides direct access to the fields of a TSN frame and executes based on configuration information entered directly by the user. This information would normally come from a network configuration tool (CNC) used to set-up the switches. When directly connecting two NI controllers the default values will also work.
Using Example with Cisco IE 4000 TSN Switch:
Cisco IE4000 alone provides 802.1as synchronization for rest of the TSN devices on the network but in order to stream deterministic data through the switch it is necessary to configure it using Cisco centralized network configuration (CNC) tool. For more information about obtaining IE 4000 switch and optional CNC tool visit this page. CNC tool will provide necessary information needed to configure a stream in TSN API:
DMAC - The MAC address associated with the stream
VID - VLAN ID number
PCP - Priority Code Point
Period - Network communication period for all talkers and listeners on a TSN network
Tx Offset - Offset in time since the start of the period when the talker should transmit its data
Rx Offset - Offset in time since the start of the period when the reader should receive its data.
Optionally this example shows how to take advantage of the time-stamping features of the driver to characterize the behavior of the network. Time stamping can be turned off for all talkers, allowing them to send TSN frames without additional header information.
General Instruction Installing a VI Package (.vip) Example:
Download the attached .vip package to your PC. Double click on the .vip package which should open up a VI Package Manager (VIPM). In the VIPM window click on the "Install" button on the top left corner and wait for the installation to finish. Once the installation is finished, the example can be accessed from the LabVIEW example finder. In any LabVIEW windows click on Help>>Find Examples...>> Select 'Directory Structure' radio button>> scroll down and find TSN Community Examples directory.
Alternatively, example source code will be placed in C:\<Program Files>\National Instruments\LabVIEW 2017\examples\TSN Community Examples directory.
We recommend using the code provided on this page. It has a few additions and enhancements for status monitoring and to help reduce errors:
Thanks for putting this code together. Some remarks to avoid dummy configuration errors
It's not mandatory to change App Timing config and Stream Conf from App cluster elements unless you have to want to tune the communication.
Hope this helps.
I have the following question: When I try to load the Simple TSN Listener.vi from the Deterministic Comm - TSN API Example LV project, the following VIs are missing: 1588 time to LabVIEW time.vi and LabVIEW time to 1588 time.vi
What needs to be installed additionally to the installations mentioned in the instructions in "Installing Software and Hardware Setup for NI TSN Devices" ...?
Thank you in advance ...
I think in the latest installer they changed the name from "1588 time" to "absolute time".
It is installed in vilib or if you install the community tools the VI will appear on the pallet so you can replace it. We also updated the community monitor tools recently (last week) so it should have the correct linking:
With 17.0 TSN driver those VIs are located in:
C:\Program Files (x86)\National Instruments\LabVIEW 2017\vi.lib\TSN Toolkit
With 17.5 TSN driver they were renamed to 'Absolute Time to LabVIEW Timestamp.vi' and 'LabVIEW Timestamp to Absolute Time.vi"
C:\Program Files (x86)\National Instruments\LabVIEW 2017\vi.lib\tsndriver\internal
Alternatively, you can install the TSN Community Tools Base Package and you should be able to find those VIs in the palette.
Or manually in C:\Program Files (x86)\National Instruments\LabVIEW 2017\user.lib\_TSN Community Tools
On my Industrial Controller (IC-3172), TSN works only with the first Ethernet port (eth1). On other ports: eth2-eth4, I receive a TSN driver error. I have tried changing all the ports from the block diagram of this example, but no success.
I feel like TSN is not enabled on other ports in firmware etc..
Sorry, I am not sure whether it's a right place to post this problem, maybe I should have opened another thread or contact the CS.
Can you post the error code you are getting? I am assuming its coming from the tsndriver.lvlib.Intialize.vi. Am I correct?
Yes, exactly. Sorry I can only get the error code tomorrow. Which other things (images, VIs, kernel version) should I post?
Thank you and regards
The error code would be enough. And maybe confirm your NI TSN driver version. I am assuming NI TSN 17.5