P. 1
Labview Book

Labview Book

|Views: 381|Likes:
Published by jit20088791

More info:

Published by: jit20088791 on May 07, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

08/29/2013

pdf

text

original

XNET

NI-XNET Hardware and Software Manual
NI-XNET Hardware and Software Manual

September 2009 372840A-01

Support Worldwide Technical Support and Product Information ni.com National Instruments Corporate Headquarters 11500 North Mopac Expressway Austin, Texas 78759-3504 USA Tel: 512 683 0100 Worldwide Offices Australia 1800 300 800, Austria 43 662 457990-0, Belgium 32 (0) 2 757 0020, Brazil 55 11 3262 3599, Canada 800 433 3488, China 86 21 5050 9800, Czech Republic 420 224 235 774, Denmark 45 45 76 26 00, Finland 358 (0) 9 725 72511, France 01 57 66 24 24, Germany 49 89 7413130, India 91 80 41190000, Israel 972 3 6393737, Italy 39 02 41309277, Japan 0120-527196, Korea 82 02 3451 3400, Lebanon 961 (0) 1 33 28 28, Malaysia 1800 887710, Mexico 01 800 010 0793, Netherlands 31 (0) 348 433 466, New Zealand 0800 553 322, Norway 47 (0) 66 90 76 60, Poland 48 22 328 90 10, Portugal 351 210 311 210, Russia 7 495 783 6851, Singapore 1800 226 5886, Slovenia 386 3 425 42 00, South Africa 27 0 11 805 8197, Spain 34 91 640 0085, Sweden 46 (0) 8 587 895 00, Switzerland 41 56 2005151, Taiwan 886 02 2377 2222, Thailand 662 278 6777, Turkey 90 212 279 3031, United Kingdom 44 (0) 1635 523545 For further support information, refer to the Technical Support and Professional Services appendix. To comment on National Instruments documentation, refer to the National Instruments Web site at ni.com/info and enter the info code feedback. © 2009 National Instruments Corporation. All rights reserved.

Important Information
Warranty
The NI-XNET hardware is warranted against defects in materials and workmanship for a period of one year from the date of shipment, as evidenced by receipts or other documentation. National Instruments will, at its option, repair or replace equipment that proves to be defective during the warranty period. This warranty includes parts and labor. The media on which you receive National Instruments software are warranted not to fail to execute programming instructions, due to defects in materials and workmanship, for a period of 90 days from date of shipment, as evidenced by receipts or other documentation. National Instruments will, at its option, repair or replace software media that do not execute programming instructions if National Instruments receives notice of such defects during the warranty period. National Instruments does not warrant that the operation of the software shall be uninterrupted or error free. A Return Material Authorization (RMA) number must be obtained from the factory and clearly marked on the outside of the package before any equipment will be accepted for warranty work. National Instruments will pay the shipping costs of returning to the owner parts which are covered by warranty. National Instruments believes that the information in this document is accurate. The document has been carefully reviewed for technical accuracy. In the event that technical or typographical errors exist, National Instruments reserves the right to make changes to subsequent editions of this document without prior notice to holders of this edition. The reader should consult National Instruments if errors are suspected. In no event shall National Instruments be liable for any damages arising out of or related to this document or the information contained in it. EXCEPT AS SPECIFIED HEREIN, NATIONAL INSTRUMENTS MAKES NO WARRANTIES, EXPRESS OR IMPLIED, AND SPECIFICALLY DISCLAIMS ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. CUSTOMER’S RIGHT TO RECOVER DAMAGES CAUSED BY FAULT OR NEGLIGENCE ON THE PART OF NATIONAL INSTRUMENTS SHALL BE LIMITED TO THE AMOUNT THERETOFORE PAID BY THE CUSTOMER. NATIONAL INSTRUMENTS WILL NOT BE LIABLE FOR DAMAGES RESULTING FROM LOSS OF DATA, PROFITS, USE OF PRODUCTS, OR INCIDENTAL OR CONSEQUENTIAL DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. This limitation of the liability of National Instruments will apply regardless of the form of action, whether in contract or tort, including negligence. Any action against National Instruments must be brought within one year after the cause of action accrues. National Instruments shall not be liable for any delay in performance due to causes beyond its reasonable control. The warranty provided herein does not cover damages, defects, malfunctions, or service failures caused by owner’s failure to follow the National Instruments installation, operation, or maintenance instructions; owner’s modification of the product; owner’s abuse, misuse, or negligent acts; and power failure or surges, fire, flood, accident, actions of third parties, or other events outside reasonable control.

Copyright
Under the copyright laws, this publication may not be reproduced or transmitted in any form, electronic or mechanical, including photocopying, recording, storing in an information retrieval system, or translating, in whole or in part, without the prior written consent of National Instruments Corporation. National Instruments respects the intellectual property of others, and we ask our users to do the same. NI software is protected by copyright and other intellectual property laws. Where NI software may be used to reproduce software or other materials belonging to others, you may use NI software only to reproduce materials that you may reproduce in accordance with the terms of any applicable license or other legal restriction.

Trademarks
National Instruments, NI, ni.com, and LabVIEW are trademarks of National Instruments Corporation. Refer to the Terms of Use section on ni.com/legal for more information about National Instruments trademarks. Other product and company names mentioned herein are trademarks or trade names of their respective companies. Members of the National Instruments Alliance Partner Program are business entities independent from National Instruments and have no agency, partnership, or joint-venture relationship with National Instruments.

Patents
For patents covering National Instruments products/technology, refer to the appropriate location: Help»Patents in your software, the patents.txt file on your media, or the National Instruments Patent Notice at ni.com/patents.

WARNING REGARDING USE OF NATIONAL INSTRUMENTS PRODUCTS
(1) NATIONAL INSTRUMENTS PRODUCTS ARE NOT DESIGNED WITH COMPONENTS AND TESTING FOR A LEVEL OF RELIABILITY SUITABLE FOR USE IN OR IN CONNECTION WITH SURGICAL IMPLANTS OR AS CRITICAL COMPONENTS IN ANY LIFE SUPPORT SYSTEMS WHOSE FAILURE TO PERFORM CAN REASONABLY BE EXPECTED TO CAUSE SIGNIFICANT INJURY TO A HUMAN. (2) IN ANY APPLICATION, INCLUDING THE ABOVE, RELIABILITY OF OPERATION OF THE SOFTWARE PRODUCTS CAN BE IMPAIRED BY ADVERSE FACTORS, INCLUDING BUT NOT LIMITED TO FLUCTUATIONS IN ELECTRICAL POWER SUPPLY, COMPUTER HARDWARE MALFUNCTIONS, COMPUTER OPERATING SYSTEM SOFTWARE FITNESS, FITNESS OF COMPILERS AND DEVELOPMENT SOFTWARE USED TO DEVELOP AN APPLICATION, INSTALLATION ERRORS, SOFTWARE AND HARDWARE COMPATIBILITY PROBLEMS, MALFUNCTIONS OR FAILURES OF ELECTRONIC MONITORING OR CONTROL DEVICES, TRANSIENT FAILURES OF ELECTRONIC SYSTEMS (HARDWARE AND/OR SOFTWARE), UNANTICIPATED USES OR MISUSES, OR ERRORS ON THE PART OF THE USER OR APPLICATIONS DESIGNER (ADVERSE FACTORS SUCH AS THESE ARE HEREAFTER COLLECTIVELY TERMED “SYSTEM FAILURES”). ANY APPLICATION WHERE A SYSTEM FAILURE WOULD CREATE A RISK OF HARM TO PROPERTY OR PERSONS (INCLUDING THE RISK OF BODILY INJURY AND DEATH) SHOULD NOT BE RELIANT SOLELY UPON ONE FORM OF ELECTRONIC SYSTEM DUE TO THE RISK OF SYSTEM FAILURE. TO AVOID DAMAGE, INJURY, OR DEATH, THE USER OR APPLICATION DESIGNER MUST TAKE REASONABLY PRUDENT STEPS TO PROTECT AGAINST SYSTEM FAILURES, INCLUDING BUT NOT LIMITED TO BACK-UP OR SHUT DOWN MECHANISMS. BECAUSE EACH END-USER SYSTEM IS CUSTOMIZED AND DIFFERS FROM NATIONAL INSTRUMENTS' TESTING PLATFORMS AND BECAUSE A USER OR APPLICATION DESIGNER MAY USE NATIONAL INSTRUMENTS PRODUCTS IN COMBINATION WITH OTHER PRODUCTS IN A MANNER NOT EVALUATED OR CONTEMPLATED BY NATIONAL INSTRUMENTS, THE USER OR APPLICATION DESIGNER IS ULTIMATELY RESPONSIBLE FOR VERIFYING AND VALIDATING THE SUITABILITY OF NATIONAL INSTRUMENTS PRODUCTS WHENEVER NATIONAL INSTRUMENTS PRODUCTS ARE INCORPORATED IN A SYSTEM OR APPLICATION, INCLUDING, WITHOUT LIMITATION, THE APPROPRIATE DESIGN, PROCESS AND SAFETY LEVEL OF SUCH SYSTEM OR APPLICATION.

Compliance
Electromagnetic Compatibility Information
This hardware has been tested and found to comply with the applicable regulatory requirements and limits for electromagnetic compatibility (EMC) as indicated in the hardware’s Declaration of Conformity (DoC)1. These requirements and limits are designed to provide reasonable protection against harmful interference when the hardware is operated in the intended electromagnetic environment. In special cases, for example when either highly sensitive or noisy hardware is being used in close proximity, additional mitigation measures may have to be employed to minimize the potential for electromagnetic interference. While this hardware is compliant with the applicable regulatory EMC requirements, there is no guarantee that interference will not occur in a particular installation. To minimize the potential for the hardware to cause interference to radio and television reception or to experience unacceptable performance degradation, install and use this hardware in strict accordance with the instructions in the hardware documentation and the DoC1. If this hardware does cause interference with licensed radio communications services or other nearby electronics, which can be determined by turning the hardware off and on, you are encouraged to try to correct the interference by one or more of the following measures: • Reorient the antenna of the receiver (the device suffering interference). • Relocate the transmitter (the device generating interference) with respect to the receiver. • Plug the transmitter into a different outlet so that the transmitter and the receiver are on different branch circuits. Some hardware may require the use of a metal, shielded enclosure (windowless version) to meet the EMC requirements for special EMC environments such as, for marine use or in heavy industrial areas. Refer to the hardware’s user documentation and the DoC1 for product installation requirements. When the hardware is connected to a test object or to test leads, the system may become more sensitive to disturbances or may cause interference in the local electromagnetic environment. Operation of this hardware in a residential area is likely to cause harmful interference. Users are required to correct the interference at their own expense or cease operation of the hardware. Changes or modifications not expressly approved by National Instruments could void the user’s right to operate the hardware under the local regulatory rules.

1. The Declaration of Conformity (DoC) contains important EMC compliance information and instructions for the user or installer. To obtain the DoC for this product, visit ni.com/certification, search by model number or product line, and click the appropriate link in the Certification column.

Contents
About This Manual
Conventions ...................................................................................................................xxiii Related Documentation..................................................................................................xxiii

Chapter 1 Introduction Chapter 2 Installation and Configuration
Safety Information .........................................................................................................2-1 Measurement & Automation Explorer (MAX) .............................................................2-3 Verifying CAN and FlexRay Hardware Installation .....................................................2-4 Configuring CAN and FlexRay Interfaces ....................................................................2-5 LabVIEW Real-Time (RT) Configuration ....................................................................2-5 PXI System ....................................................................................................................2-6 Tools ..............................................................................................................................2-6

Chapter 3 NI-XNET Hardware Overview
Overview........................................................................................................................3-1 NI-XNET FlexRay Hardware (PXI-8517 and PCI-8517) .............................................3-1 Pinout...............................................................................................................3-1 FlexRay Physical Layer...................................................................................3-2 Transceiver ......................................................................................................3-2 Bus Power Requirements ................................................................................3-2 Cabling Requirements for FlexRay .................................................................3-2 Cable Lengths..................................................................................................3-2 Termination .....................................................................................................3-3 NI-XNET CAN Hardware (PXI-8511/8512/8513 and PCI-8511/8512/8513)..............3-3 Pinout...............................................................................................................3-3 XS Software Selectable Physical Layer ..........................................................3-4 High-Speed Physical Layer .............................................................................3-4 Transceiver........................................................................................3-4 Bus Power Requirements ..................................................................3-5 Cabling Requirements for High-Speed CAN....................................3-5 Cable Lengths ...................................................................................3-5 Number of Devices ...........................................................................3-5

© National Instruments Corporation

v

NI-XNET Hardware and Software Manual

Contents

Cable Termination ............................................................................ 3-6 Cabling Example .............................................................................. 3-7 Low-Speed/Fault-Tolerant Physical Layer ..................................................... 3-7 Transceiver ....................................................................................... 3-7 Bus Power Requirements.................................................................. 3-8 Cabling Requirements for Low-Speed/ Fault-Tolerant CAN........... 3-8 Number of Devices ........................................................................... 3-9 Termination ...................................................................................... 3-9 Determining the Necessary Termination Resistance for the Board........................................................................................ 3-9 Single Wire Physical Layer............................................................................. 3-11 Transceiver ....................................................................................... 3-11 Bus Power Requirements.................................................................. 3-11 Cabling Requirements for Single Wire CAN ................................... 3-11 Cable Length..................................................................................... 3-12 Number of Devices ........................................................................... 3-12 Termination (Bus Loading) .............................................................. 3-12 Isolation ......................................................................................................................... 3-12 RTSI .............................................................................................................................. 3-12

Chapter 4 NI-XNET API for LabVIEW
Getting Started............................................................................................................... 4-1 LabVIEW Project............................................................................................ 4-1 Examples......................................................................................................... 4-1 Palettes ............................................................................................................ 4-2 Basic Programming Model............................................................................................ 4-3 Interfaces ....................................................................................................................... 4-4 What Is an Interface? ...................................................................................... 4-4 How Do I View Available Interfaces? ............................................................ 4-5 Measurement and Automation Explorer (MAX).............................. 4-5 I/O Name .......................................................................................... 4-6 LabVIEW Project ............................................................................. 4-6 System Node..................................................................................... 4-6 Databases....................................................................................................................... 4-7 What Is a Database? ........................................................................................ 4-7 What Is an Alias? ............................................................................................ 4-8 Database Programming ................................................................................... 4-9 Already Have File? ........................................................................... 4-9 Can Use File As Is? .......................................................................... 4-9 Select from File ................................................................................ 4-10 Edit and Select .................................................................................. 4-11 Want to Use a File? .......................................................................... 4-12

NI-XNET Hardware and Software Manual

vi

ni.com

Contents

Create New File Using the Database Editor .....................................4-12 Create in Memory .............................................................................4-12 Sessions..........................................................................................................................4-13 What Is a Session?...........................................................................................4-13 Session Modes .................................................................................................4-14 Frame Input Queued Mode ...............................................................4-15 Frame Input Single-Point Mode........................................................4-18 Frame Input Stream Mode ................................................................4-19 Frame Output Queued Mode.............................................................4-22 Frame Output Single-Point Mode .....................................................4-24 Frame Output Stream Mode..............................................................4-27 Signal Input Single-Point Mode........................................................4-29 Signal Input Waveform Mode...........................................................4-32 Signal Input XY Mode ......................................................................4-34 Signal Output Single-Point Mode .....................................................4-36 Signal Output Waveform Mode ........................................................4-37 Signal Output XY Mode ...................................................................4-40 How Do I Create a Session?............................................................................4-44 LabVIEW Project..............................................................................4-44 XNET Create Session.vi ...................................................................4-44 Using CAN ....................................................................................................................4-45 Understanding CAN Frame Timing ................................................................4-45 Configuring Frame I/O Stream Sessions.........................................................4-45 Using FlexRay ...............................................................................................................4-46 Starting Communication..................................................................................4-46 Understanding FlexRay Frame Timing ...........................................................4-47 Using LabVIEW Real-Time ..........................................................................................4-47 High Priority Loops.........................................................................................4-47 XNET I/O Names ............................................................................................4-48 Deploying Databases .......................................................................................4-48 FlexRay Timing Source...................................................................................4-49 Creating a Built Real-Time Application..........................................................4-49 NI-XNET API for LabVIEW Reference .......................................................................4-50 XNET Session Constant ..................................................................................4-50 XNET Create Session.vi..................................................................................4-51 XNET Create Session (Frame Input Queued).vi ..............................4-52 XNET Create Session (Frame Input Single-Point).vi .......................4-53 XNET Create Session (Frame Input Stream).vi................................4-54 XNET Create Session (Frame Output Queued).vi............................4-56 XNET Create Session (Frame Output Single-Point).vi ....................4-57 XNET Create Session (Frame Output Stream).vi .............................4-58 XNET Create Session (Generic).vi ...................................................4-59 XNET Create Session (Signal Input Single-Point).vi .......................4-61 XNET Create Session (Signal Input Waveform).vi..........................4-62

© National Instruments Corporation

vii

NI-XNET Hardware and Software Manual

Contents

XNET Create Session (Signal Input XY).vi..................................... 4-63 XNET Create Session (Signal Output Single-Point).vi.................... 4-64 XNET Create Session (Signal Output Waveform).vi....................... 4-65 XNET Create Session (Signal Output XY).vi .................................. 4-66 XNET Session Property Node ........................................................................ 4-67 Interface Properties........................................................................... 4-68 CAN Interface Properties ................................................... 4-68 Interface:CAN:Listen Only?................................ 4-68 Interface:CAN:Single Shot Transmit?................. 4-69 Interface:CAN:Termination................................. 4-70 Interface:CAN:Transceiver State......................... 4-72 Interface:CAN:Transceiver Type ........................ 4-75 FlexRay Interface Properties.............................................. 4-77 Interface:FlexRay:Accepted Startup Range......... 4-77 Interface:FlexRay:Allow Halt Due To Clock? .... 4-78 Interface:FlexRay:Allow Passive to Active......... 4-79 Interface:FlexRay:Cluster Drift Damping ........... 4-80 Interface:FlexRay:Coldstart? ............................... 4-81 Interface:FlexRay:Decoding Correction.............. 4-82 Interface:FlexRay:Delay Compensation Ch A .... 4-83 Interface:FlexRay:Delay Compensation Ch B .... 4-84 Interface:FlexRay:Key Slot Identifier ................. 4-85 Interface:FlexRay:Latest Tx ................................ 4-87 Interface:FlexRay:Listen Timeout ....................... 4-88 Interface:FlexRay:Macro Initial Offset Ch A ...... 4-89 Interface:FlexRay:Macro Initial Offset Ch B ...... 4-90 Interface:FlexRay:Max Drift ............................... 4-91 Interface:FlexRay:Micro Initial Offset Ch A....... 4-92 Interface:FlexRay:Micro Initial Offset Ch B....... 4-93 Interface:FlexRay:Microtick................................ 4-94 Interface:FlexRay:Null Frames To Input Stream? .................................................... 4-95 Interface:FlexRay:Offset Correction ................... 4-96 Interface:FlexRay:Offset Correction Out ............ 4-97 Interface:FlexRay:Rate Correction ...................... 4-98 Interface:FlexRay:Rate Correction Out ............... 4-99 Interface:FlexRay:Samples Per Microtick........... 4-100 Interface:FlexRay:Single Slot Enabled? .............. 4-101 Interface:FlexRay:Statistics Enabled? ................. 4-102 Interface:FlexRay:Sync Frames Channel A Even .................................................................. 4-103 Interface:FlexRay:Sync Frames Channel A Odd.................................................................... 4-104

NI-XNET Hardware and Software Manual

viii

ni.com

Contents

Interface:FlexRay:Sync Frames Channel B Even...................................................................4-105 Interface:FlexRay:Sync Frames Channel B Odd ....................................................................4-106 Interface:FlexRay:Sync Frame Status..................4-107 Interface:FlexRay:Termination ............................4-108 Interface:FlexRay:Wakeup Channel ....................4-109 Interface:FlexRay:Wakeup Pattern ......................4-110 Interface:Baud Rate ............................................................4-111 Interface:Echo Transmit? ...................................................4-113 Interface:I/O Name .............................................................4-114 Auto Start? ........................................................................................4-115 Cluster ...............................................................................................4-116 Database ............................................................................................4-117 List of Frames ...................................................................................4-118 List of Signals ...................................................................................4-119 Mode .................................................................................................4-120 Number in List ..................................................................................4-120 Number of Values Pending ...............................................................4-121 Number of Values Unused ................................................................4-122 Payload Length Maximum................................................................4-123 Protocol .............................................................................................4-124 Queue Size ........................................................................................4-125 Resample Rate...................................................................................4-130 XNET Read.vi .................................................................................................4-131 XNET Read (Frame CAN).vi ...........................................................4-133 XNET Read (Frame FlexRay).vi ......................................................4-137 XNET Read (Frame Raw).vi ............................................................4-142 XNET Read (Signal Single-Point).vi................................................4-145 XNET Read (Signal Waveform).vi...................................................4-146 XNET Read (Signal XY).vi ..............................................................4-148 XNET Read (State CAN Comm).vi..................................................4-151 XNET Read (State FlexRay Comm).vi.............................................4-155 XNET Read (State FlexRay Cycle Macrotick).vi.............................4-159 XNET Read (State FlexRay Statistics).vi .........................................4-161 XNET Read (State Time Comm).vi..................................................4-163 XNET Read (State Time Current).vi ................................................4-164 XNET Read (State Time Start).vi .....................................................4-165 XNET Write.vi ................................................................................................4-167 XNET Write (Signal Single-Point).vi ...............................................4-168 XNET Write (Signal Waveform).vi..................................................4-169 XNET Write (Signal XY).vi .............................................................4-171 XNET Write (Frame CAN).vi ..........................................................4-173 XNET Write (Frame FlexRay).vi .....................................................4-176

© National Instruments Corporation

ix

NI-XNET Hardware and Software Manual

Contents

XNET Write (Frame Raw).vi ........................................................... 4-180 Database Subpalette ........................................................................................ 4-183 XNET Database Property Node........................................................ 4-183 Clusters............................................................................... 4-184 ShowInvalidFromOpen? .................................................... 4-185 XNET Database Constant................................................................. 4-186 XNET Cluster Property Node........................................................... 4-186 FlexRay Properties ............................................................. 4-187 FlexRay:Action Point Offset ............................... 4-187 FlexRay:CAS Rx Low Max................................. 4-188 FlexRay:Channels................................................ 4-189 FlexRay:Cluster Drift Damping........................... 4-190 FlexRay:Cold Start Attempts............................... 4-191 FlexRay:Cycle ..................................................... 4-192 FlexRay:Dynamic Segment Start......................... 4-193 FlexRay:Dynamic Slot Idle Phase ....................... 4-194 FlexRay:Latest Guaranteed Dynamic Slot .......... 4-195 FlexRay:Latest Usable Dynamic Slot.................. 4-196 FlexRay:Listen Noise .......................................... 4-197 FlexRay:Macro Per Cycle.................................... 4-198 FlexRay:Macrotick .............................................. 4-199 FlexRay:Max Without Clock Correction Fatal.... 4-200 FlexRay:Max Without Clock Correction Passive............................................................... 4-201 FlexRay:Minislot Action Point Offset................. 4-202 FlexRay:Minislot ................................................. 4-203 FlexRay:Network Management Vector Length... 4-204 FlexRay:NIT Start................................................ 4-205 FlexRay:NIT ........................................................ 4-206 FlexRay:Number of Minislots ............................. 4-207 FlexRay:Number of Static Slots .......................... 4-208 FlexRay:Offset Correction Start .......................... 4-209 FlexRay:Payload Length Dynamic Maximum .... 4-210 FlexRay:Payload Length Maximum .................... 4-211 FlexRay:Payload Length Static ........................... 4-212 FlexRay:Static Slot .............................................. 4-213 FlexRay:Symbol Window Start ........................... 4-214 FlexRay:Symbol Window.................................... 4-215 FlexRay:Sync Node Max..................................... 4-216 FlexRay:TSS Transmitter .................................... 4-217 FlexRay:Wakeup Symbol Rx Idle ....................... 4-218 FlexRay:Wakeup Symbol Rx Low ...................... 4-219 FlexRay:Wakeup Symbol Rx Window................ 4-220

NI-XNET Hardware and Software Manual

x

ni.com

Contents

FlexRay:Wakeup Symbol Tx Idle........................4-221 FlexRay:Wakeup Symbol Tx Low.......................4-222 Baud Rate ...........................................................................4-223 Comment ............................................................................4-224 Configuration Status ...........................................................4-224 Database..............................................................................4-225 ECUs...................................................................................4-225 Frames ................................................................................4-226 Name (Short) ......................................................................4-227 Protocol...............................................................................4-229 Signals ................................................................................4-229 XNET Cluster Constant ....................................................................4-230 XNET ECU Property Node...............................................................4-230 Cluster.................................................................................4-231 FlexRay:Coldstart? .............................................................4-231 Comment ............................................................................4-232 Configuration Status ...........................................................4-232 Frames Received.................................................................4-233 Frames Transmitted ............................................................4-233 Name (Short) ......................................................................4-234 FlexRay:Startup Frame.......................................................4-236 XNET ECU Constant........................................................................4-237 XNET Frame Property Node ............................................................4-237 CAN:Extended Identifier? ..................................................4-237 CAN:Timing Type..............................................................4-238 CAN:Transmit Time...........................................................4-240 Cluster.................................................................................4-241 Comment ............................................................................4-241 Configuration Status ...........................................................4-242 Default Payload ..................................................................4-243 FlexRay:Base Cycle ...........................................................4-245 FlexRay:Channel Assignment ............................................4-247 FlexRay:Cycle Repetition...................................................4-248 FlexRay:Payload Preamble?...............................................4-250 FlexRay:Startup? ................................................................4-251 FlexRay:Sync?....................................................................4-252 FlexRay:Timing Type.........................................................4-253 FlexRay:In Cycle Repetitions:Channel Assignments.........4-254 FlexRay:In Cycle Repetitions:Enabled?.............................4-255 FlexRay:In Cycle Repetitions:Identifiers ...........................4-256 Identifier .............................................................................4-257 Mux:Data Multiplexer Signal .............................................4-259 Mux:Is Data Multiplexed?..................................................4-259 Mux:Static Signals..............................................................4-260

© National Instruments Corporation

xi

NI-XNET Hardware and Software Manual

Contents

Mux:Subframes .................................................................. 4-260 Name (Short) ...................................................................... 4-261 Payload Length................................................................... 4-263 Signals ................................................................................ 4-264 XNET Frame Constant ..................................................................... 4-265 XNET Subframe Property Node....................................................... 4-265 Dynamic Signals ................................................................ 4-266 Frame.................................................................................. 4-266 Multiplexer Value .............................................................. 4-267 Name (Short) ...................................................................... 4-268 XNET Signal Property Node ............................................................ 4-270 Byte Order .......................................................................... 4-271 Comment ............................................................................ 4-273 Configuration Status........................................................... 4-274 Data Type ........................................................................... 4-275 Default Value ..................................................................... 4-276 Mux:Dynamic?................................................................... 4-277 Frame.................................................................................. 4-278 Maximum Value................................................................. 4-278 Minimum Value ................................................................. 4-279 Mux:Multiplexer Value...................................................... 4-279 Mux:Data Multiplexer? ...................................................... 4-280 Name (Short) ...................................................................... 4-281 Number of Bits ................................................................... 4-283 Scaling Factor..................................................................... 4-284 Scaling Offset..................................................................... 4-284 Start Bit .............................................................................. 4-285 Mux:Subframe.................................................................... 4-287 Unit..................................................................................... 4-287 XNET Signal Constant ..................................................................... 4-288 XNET Database Open.vi .................................................................. 4-288 XNET Database Open (Cluster).vi..................................... 4-289 XNET Database Open (Database).vi ................................. 4-291 XNET Database Open (ECU).vi ........................................ 4-293 XNET Database Open (Frame).vi...................................... 4-294 XNET Database Open (Signal).vi...................................... 4-296 XNET Database Open (Subframe).vi................................. 4-298 XNET Database Close.vi.................................................................. 4-300 XNET Database Close (Cluster).vi .................................... 4-301 XNET Database Close (Database).vi ................................. 4-302 XNET Database Close (ECU).vi........................................ 4-303 XNET Database Close (Frame).vi ..................................... 4-304 XNET Database Close (Signal).vi ..................................... 4-305 XNET Database Close (Subframe).vi ................................ 4-306

NI-XNET Hardware and Software Manual

xii

ni.com

Contents

XNET Database Create Object.vi .....................................................4-307 XNET Database Create (Cluster).vi ...................................4-308 XNET Database Create (Dynamic Signal).vi.....................4-310 XNET Database Create (ECU).vi.......................................4-312 XNET Database Create (Frame).vi ....................................4-314 XNET Database Create (Signal).vi ....................................4-316 XNET Database Create (Subframe).vi ...............................4-318 XNET Database Delete Object.vi .....................................................4-320 XNET Database Delete (Cluster).vi ...................................4-321 XNET Database Delete (ECU).vi.......................................4-322 XNET Database Delete (Frame).vi ....................................4-323 XNET Database Delete (Signal).vi ....................................4-324 XNET Database Delete (Subframe).vi ...............................4-325 XNET Database Save.vi ...................................................................4-326 File Management Subpalette.............................................................4-327 XNET Database Add Alias.vi ............................................4-327 XNET Database Deploy.vi .................................................4-329 XNET Database Get List.vi................................................4-331 XNET Database Remove Alias.vi ......................................4-333 XNET Database Undeploy.vi .............................................4-334 Notify Subpalette.............................................................................................4-335 XNET Wait.vi ...................................................................................4-335 XNET Wait (Transmit Complete).vi ..................................4-336 XNET Wait (Interface Communicating).vi ........................4-337 XNET Wait (CAN Remote Wakeup).vi.............................4-339 XNET Create Timing Source.vi........................................................4-340 XNET Create Timing Source (FlexRay Cycle).vi..............4-340 Advanced Subpalette .......................................................................................4-349 XNET Start.vi ...................................................................................4-349 XNET Stop.vi....................................................................................4-351 XNET Clear.vi ..................................................................................4-353 XNET Flush.vi ..................................................................................4-354 XNET Connect Terminals.vi ............................................................4-355 XNET Disconnect Terminals.vi........................................................4-361 XNET Terminal Constant .................................................................4-362 XNET System Property Node...........................................................4-362 Devices ...............................................................................4-363 Interfaces (FlexRay) ...........................................................4-363 Interfaces (All)....................................................................4-364 Interfaces (CAN) ................................................................4-364 Version:Build......................................................................4-365 Version:Major.....................................................................4-366 Version:Minor ....................................................................4-367

© National Instruments Corporation

xiii

NI-XNET Hardware and Software Manual

Contents

Version:Phase..................................................................... 4-368 Version:Update................................................................... 4-369 XNET Device Property Node........................................................... 4-370 Form Factor ........................................................................ 4-370 Interfaces ............................................................................ 4-371 Number of Ports ................................................................. 4-372 Product Name..................................................................... 4-372 Product Number ................................................................. 4-373 Serial Number .................................................................... 4-373 XNET Interface Property Node ........................................................ 4-374 CAN.Termination Capability ............................................. 4-375 CAN.Transceiver Capability.............................................. 4-376 Device................................................................................. 4-377 Name .................................................................................. 4-377 Number............................................................................... 4-378 Port Number ....................................................................... 4-379 Protocol .............................................................................. 4-380 XNET Interface Constant ................................................................. 4-381 XNET Blink.vi.................................................................................. 4-381 XNET String to IO Name.vi............................................................. 4-384 XNET String to IO Name (Cluster).vi ............................... 4-385 XNET String to IO Name (Database Alias).vi................... 4-386 XNET String to IO Name (Database Filepath).vi .............. 4-387 XNET String to IO Name (ECU).vi................................... 4-388 XNET String to IO Name (Frame).vi................................. 4-389 XNET String to IO Name (Interface).vi............................. 4-390 XNET String to IO Name (Session).vi............................... 4-391 XNET String to IO Name (Signal).vi................................. 4-392 XNET String to IO Name (Subframe).vi ........................... 4-393 Controls Palette ............................................................................................... 4-394 XNET Session Control ..................................................................... 4-394 Database Controls............................................................................. 4-394 System Controls................................................................................ 4-395 Additional Topics .......................................................................................................... 4-395 Overall............................................................................................................. 4-395 Creating a Built Application............................................................. 4-395 Error Handling .................................................................................. 4-396 Fault Handling .................................................................................. 4-397 Multiplexed Signals .......................................................................... 4-399 Raw Frame Format ........................................................................... 4-400 Required Properties .......................................................................... 4-404 State Models ..................................................................................... 4-406

NI-XNET Hardware and Software Manual

xiv

ni.com

Contents

CAN.................................................................................................................4-412 NI-CAN.............................................................................................4-412 CAN Timing Type and Session Mode..............................................4-413 FlexRay............................................................................................................4-417 FlexRay Timing Type and Session Mode.........................................4-417 XNET I/O Names ............................................................................................4-420 I/O Name Classes..............................................................................4-421 XNET Cluster I/O Name...................................................................4-423 XNET Database I/O Name ...............................................................4-426 XNET Device I/O Name...................................................................4-429 XNET ECU I/O Name ......................................................................4-429 XNET Frame I/O Name ....................................................................4-432 XNET Interface I/O Name ................................................................4-435 XNET Session I/O Name..................................................................4-437 XNET Signal I/O Name....................................................................4-439 XNET Subframe I/O Name...............................................................4-442 XNET Terminal I/O Name ...............................................................4-443

Chapter 5 NI-XNET API for C
Getting Started ...............................................................................................................5-1 LabWindows/CVI............................................................................................5-1 Examples...........................................................................................5-1 Visual C++ 6 ...................................................................................................5-2 Examples...........................................................................................5-2 Interfaces........................................................................................................................5-3 What Is an Interface?.......................................................................................5-3 How Do I View Available Interfaces? ............................................................5-4 Measurement and Automation Explorer (MAX) ..............................5-4 Databases .......................................................................................................................5-4 What Is a Database? ........................................................................................5-4 What Is an Alias?.............................................................................................5-5 Database Programming ...................................................................................5-5 Already Have File? ...........................................................................5-6 Can I Use File as Is? .........................................................................5-6 Select From File ................................................................................5-6 Edit and Select ..................................................................................5-7 Want to Use a File?...........................................................................5-7 Create New File Using the Database Editor .....................................5-7 Create in Memory .............................................................................5-7

© National Instruments Corporation

xv

NI-XNET Hardware and Software Manual

Contents

Sessions ......................................................................................................................... 5-8 What Is a Session? .......................................................................................... 5-8 Session Modes................................................................................................. 5-8 Frame Input Queued Mode............................................................... 5-10 Frame Input Single-Point Mode ....................................................... 5-12 Frame Input Stream Mode ................................................................ 5-13 Frame Output Queued Mode ............................................................ 5-16 Frame Output Single-Point Mode..................................................... 5-18 Frame Output Stream Mode ............................................................. 5-21 Signal Input Single-Point Mode ....................................................... 5-23 Signal Input Waveform Mode .......................................................... 5-25 Signal Input XY Mode ..................................................................... 5-27 Signal Output Single-Point Mode..................................................... 5-29 Signal Output Waveform Mode ....................................................... 5-30 Signal Output XY Mode................................................................... 5-33 NI-XNET API for C Reference..................................................................................... 5-37 Functions......................................................................................................... 5-37 nxBlink ............................................................................................. 5-37 nxClear.............................................................................................. 5-40 nxConnectTerminals......................................................................... 5-41 nxCreateSession................................................................................ 5-47 nxCreateSessionByRef ..................................................................... 5-50 nxdbAddAlias ................................................................................... 5-52 nxdbCloseDatabase .......................................................................... 5-54 nxdbCreateObject ............................................................................. 5-55 nxdbDeleteObject ............................................................................. 5-57 nxdbDeploy ...................................................................................... 5-58 nxdbFindObject ................................................................................ 5-60 nxdbGetDatabaseList........................................................................ 5-62 nxdbGetDatabaseListSizes ............................................................... 5-64 nxdbGetProperty............................................................................... 5-66 nxdbGetPropertySize........................................................................ 5-67 nxdbOpenDatabase ........................................................................... 5-68 nxdbRemoveAlias ............................................................................ 5-69 nxdbSaveDatabase............................................................................ 5-70 nxdbSetProperty ............................................................................... 5-71 nxdbUndeploy .................................................................................. 5-72 nxDisconnectTerminals .................................................................... 5-73 nxFlush ............................................................................................. 5-75 nxGetProperty................................................................................... 5-76 nxGetPropertySize............................................................................ 5-78 nxReadFrame.................................................................................... 5-79 nxReadSignalSinglePoint ................................................................. 5-82 nxReadSignalWaveform................................................................... 5-84

NI-XNET Hardware and Software Manual

xvi

ni.com

........................................................5-113 Baud Rate ....................5-97 nxStatusToString...................................................................5-135 FlexRay:Number of Minislots ...........................5-127 FlexRay:Macrotick ........................................................5-115 FlexRay:Action Point Offset ......5-118 FlexRay:Cluster Drift Damping ......................................................5-104 nxWriteFrame .....................................................................................................................................................................................5-114 Database....................................................5-96 nxStart ...Contents nxReadSignalXY ..................5-126 FlexRay:Macro Per Cycle ................5-121 FlexRay:Dynamic Segment Start ..............5-122 FlexRay:Dynamic Slot Idle Phase ...................................................................................................................5-128 FlexRay:Max Without Clock Correction Fatal .......................................................................5-106 nxWriteSignalSinglePoint....................................................5-115 ECUs............................................5-86 nxReadState ...................................................................................................................................................................................5-139 © National Instruments Corporation xvii NI-XNET Hardware and Software Manual ..............................5-119 FlexRay:Cold Start Attempts..........5-100 nxSystemClose..................................................................5-137 FlexRay:Offset Correction Start ...........................................................................5-138 FlexRay:Payload Length Dynamic Maximum ..................................................5-130 FlexRay:Minislot ............................................................5-109 nxWriteSignalXY...............................5-116 FlexRay:CAS Rx Low Max .......5-132 FlexRay:Network Management Vector Length ...5-136 FlexRay:Number of Static Slots ............................5-111 Properties...........5-113 Comment ....................................................................................................................................................................................................................5-131 FlexRay:Minislot Action Point Offset..................................................................................................................................................................................................5-99 nxStop ..................................................................5-117 FlexRay:Channels...............................................................................................................5-120 FlexRay:Cycle .....................5-113 XNET Cluster Properties ........................................5-124 FlexRay:Latest Usable Dynamic Slot..................................................................................................................................................................................5-134 FlexRay:NIT Start ...............5-133 FlexRay:NIT ..................................................5-129 FlexRay:Max Without Clock Correction Passive ......5-102 nxSystemOpen ...................5-103 nxWait ...5-123 FlexRay:Latest Guaranteed Dynamic Slot ................................................................5-125 FlexRay:Listen Noise ...................................................................................5-114 Configuration Status .............................5-108 nxWriteSignalWaveform ..5-88 nxSetProperty.........................................................................................................................................................

.................................................Contents FlexRay:Payload Length Maximum ................................................. 5-145 FlexRay:TSS Transmitter............................................................... 5-141 FlexRay:Static Slot................................................................................................................... 5-155 Clusters..... 5-163 Name (Short) ............................................................................................................................................................................................................................................................................................................................................................................................................... 5-157 Form Factor ................................................................................................................................................................................................... 5-155 ShowInvalidFromOpen? .......................................... 5-161 FlexRay:Coldstart?.......................... 5-165 CAN:Timing Type .......................... 5-163 Frames Transmitted......... 5-162 FlexRay:Startup Frame .. 5-160 Comment .......................... 5-151 Frames ........................................................................................................ 5-165 CAN:Extended Identifier?................................... 5-154 Signals ....... 5-166 CAN:Transmit Time ........................ 5-152 Name (Short) . 5-158 Product Number .......................................... 5-140 FlexRay:Payload Length Static.................................................................................................................................................................................................................................................................................................. 5-147 FlexRay:Wakeup Symbol Rx Low ........................ 5-160 Cluster .................................................................................... 5-148 FlexRay:Wakeup Symbol Rx Window ..... 5-154 XNET Database Properties. 5-169 Comment ............................... 5-156 XNET Device Properties .................................... 5-169 Configuration Status.................................................... 5-158 Product Name... 5-170 Default Payload ......................................................................... 5-160 Configuration Status......................................................................................... 5-144 FlexRay:Sync Node Max .................................................................................................................................................................. 5-168 Cluster .......................... 5-150 FlexRay:Wakeup Symbol Tx Low........................ 5-146 FlexRay:Wakeup Symbol Rx Idle.................. 5-143 FlexRay:Symbol Window Start ....................................................................................................... 5-159 Serial Number .................................................................................................................... 5-164 XNET Frame Properties ............com ............................... 5-157 Number of Ports .............................................................................................. 5-153 Protocol ...................... 5-149 FlexRay:Wakeup Symbol Tx Idle..... 5-157 Interfaces ......................................................... 5-142 FlexRay:Symbol Window .......... 5-171 FlexRay:Base Cycle ................... 5-162 Frames Received .......... 5-173 NI-XNET Hardware and Software Manual xviii ni.......................... 5-159 XNET ECU Properties .....................

....................................5-198 Auto Start? ...................................................................................................................................................5-209 Interface:Echo Transmit? ....................................................................................................5-212 Interface:FlexRay:Accepted Startup Range ...........5-182 FlexRay:Sync?..............................5-197 XNET Session Properties...............................................5-211 FlexRay Interface Properties.............................................5-187 Mux:Static Signals...................................................................5-194 Number ...........................................Transceiver Capability ...........................................................................................5-193 Device ..................5-181 FlexRay:Startup? ...............5-183 FlexRay:Timing Type.........................................................................................5-199 Interface Properties............................5-198 ClusterName ...5-187 Mux:Is Data Multiplexed?..5-196 Protocol...............5-190 Signals ...........5-195 Port Number .................................................................................................................................................5-179 FlexRay:In Cycle Repetitions:Identifiers .......................................5-180 FlexRay:Payload Preamble?...............................5-189 Payload Length ................................Termination Capability ........................5-212 Interface:FlexRay:Allow Halt Due To Clock?..................5-194 Name.......................5-213 © National Instruments Corporation xix NI-XNET Hardware and Software Manual ................................5-200 Interface:Baud Rate..........................5-176 FlexRay:In Cycle Repetitions:Channel Assignments.......5-191 XNET Interface Properties....................................Contents FlexRay:Channel Assignment ...5-192 CAN.....................................................................................................................................5-200 CAN Interface Properties ........................................5-202 Interface:CAN:Listen Only?....................................5-184 Identifier ......................5-188 Name (Short) ...............................................................................................5-204 Interface:CAN:Transceiver State...................................................................5-199 DatabaseName ....................................................5-188 Mux:Subframes .......................................5-206 Interface:CAN:Transceiver Type ..........................5-192 CAN.......5-185 Mux:Data Multiplexer Signal .......................................................................................................................5-202 Interface:CAN:Single Shot Transmit?...............................................................5-203 Interface:CAN:Termination..................................................................5-178 FlexRay:In Cycle Repetitions:Enabled?........................................5-175 FlexRay:Cycle Repetition............................................................................................

................ 5-222 Interface:FlexRay:Listen Timeout .................... 5-229 Interface:FlexRay:Null Frames To Input Stream?........................... 5-219 Interface:FlexRay:Key Slot Identifier ................................................................ 5-239 Interface:FlexRay:Sync Frames Channel A Odd ......................... 5-217 Interface:FlexRay:Delay Compensation Ch A .............................. 5-223 Interface:FlexRay:Macro Initial Offset Ch A........................................ 5-236 Interface:FlexRay:Statistics Enabled?...........................................Contents Interface:FlexRay:Allow Passive to Active ............ 5-226 Interface:FlexRay:Micro Initial Offset Ch A.... 5-237 Interface:FlexRay:Sync Frame Status ....................................... 5-216 Interface:FlexRay:Decoding Correction .................... 5-214 Interface:FlexRay:Cluster Drift Damping ......... 5-224 Interface:FlexRay:Macro Initial Offset Ch B........ 5-241 NI-XNET Hardware and Software Manual xx ni. 5-230 Interface:FlexRay:Offset Correction .................... 5-238 Interface:FlexRay:Sync Frames Channel A Even.............. 5-227 Interface:FlexRay:Micro Initial Offset Ch B..... 5-218 Interface:FlexRay:Delay Compensation Ch B...................................................... 5-220 Interface:FlexRay:Latest Tx........... 5-233 Interface:FlexRay:Rate Correction Out ..............................................................................com ... 5-240 Interface:FlexRay:Sync Frames Channel B Even .................................................. 5-215 Interface:FlexRay:Coldstart?....... 5-231 Interface:FlexRay:Offset Correction Out ........ 5-232 Interface:FlexRay:Rate Correction........... 5-228 Interface:FlexRay:Microtick ................................. 5-225 Interface:FlexRay:Max Drift ........................................................ 5-234 Interface:FlexRay:Samples Per Microtick ............................................................ 5-235 Interface:FlexRay:Single Slot Enabled? ...........................

.......5-247 Number of Values Unused ....................................................5-256 Byte Order .........................................................................................................................5-248 Payload Length Maximum .......................................................5-244 Interface:FlexRay:Wakeup Pattern........................................Contents Interface:FlexRay:Sync Frames Channel B Odd.........................5-256 Comment ................................5-242 Interface:FlexRay:Termination........................5-245 List ......................................................5-272 Frame .................................................................5-249 Protocol.......................................................................................5-273 Multiplexer Value.......................................................................5-277 Interfaces (FlexRay) .............5-255 XNET Signal Properties.................................5-258 Configuration Status ...........................................................5-276 Devices ............................................................5-246 Mode ..................5-276 Interfaces (All).................................................................................................................................................................5-259 Data Type .......................................................................................................5-269 Scaling Offset ...................................................................5-270 Unit .5-262 Minimum Value....5-275 XNET System Properties ......................5-274 Name (Short) ......5-263 Mux:Data Multiplexer? ..........................................................................................5-279 © National Instruments Corporation xxi NI-XNET Hardware and Software Manual .................................................................................................5-247 Number of Values Pending.........................................................................................................................................5-243 Interface:FlexRay:Wakeup Channel................................................................5-262 Maximum Value ..........................5-266 Name (Short) ...........................5-260 Default Value.......................................................................................................................................................................................5-261 Frame ..................................................................................................................................................................5-277 Interfaces (CAN) .............................................................................................................................................................................................................................................5-266 Mux:Subframe ..............5-249 Queue Size ........................................................5-267 Number of Bits .....................................................................................................................................................................................................5-265 Mux:Multiplexer Value .....................5-278 Version:Build....................5-268 Scaling Factor ...........5-272 XNET Subframe Properties .................5-264 Mux:Dynamic? ....5-269 Start Bit.......................................................................5-272 Dynamic Signals.......5-250 Resample Rate ............5-246 Number in List......................................................................................................

.......................................... 5-291 CAN ...................................................................................................................................................................................................................................................................................................................................................................................................................................................... 5-284 Overall............................................... 5-302 FlexRay Timing Type and Session Mode ................................... 5-283 Additional Topics .......................................................................................................... 5-297 NI-CAN .. 5-282 Version:Update......................... 5-289 State Models ................................................. 5-302 Chapter 6 Troubleshooting and Common Questions Appendix A Summary of the CAN Standard Appendix B Summary of the FlexRay Standard Appendix C Specifications Appendix D LabVIEW Project Provider Appendix E Bus Monitor Appendix F Database Editor NI-XNET Hardware and Software Manual xxii ni......................... 5-280 Version:Minor ..... 5-281 Version:Phase........................................com .............................................................. 5-298 FlexRay ..................... 5-297 CAN Timing Type and Session Mode ........................ 5-284 Multiplexed Signals .............................................Contents Version:Major .......................................................................................................................... 5-285 Required Properties ................................... 5-284 Raw Frame Format ......................................................................

Contents Appendix G Technical Support and Professional Services Index © National Instruments Corporation xxiii NI-XNET Hardware and Software Manual .

emphasis. Text in this font denotes text or characters that you should enter from the keyboard. a cross-reference. and select Options from the last dialog box.About This Manual This manual describes how to install and configure the NI-XNET hardware and software and summarizes the CAN and FlexRay standards. which advises you of precautions to take to avoid injury. subprograms. Bold text also denotes parameter names. programs. subroutines. or an introduction to a key concept. paths. and extensions. sections of code. programming examples. bold Bold text denotes items that you must select or click in the software. This icon denotes a note. This font is also used for the proper names of disk drives. Italic text also denotes text that is a placeholder for a word or value that you must supply. select the Page Setup item. data loss. and syntax examples. italic monospace Related Documentation The following documents contain information that you may find helpful as you read this manual: • • • NI-XNET Hardware and Software Help NI-XNET Tools and Utilities Help NI-XNET Hardware and Software Installation Guide © National Instruments Corporation xxiii NI-XNET Hardware and Software Manual . Conventions The following conventions appear in this manual: » The » symbol leads you through nested menu items and dialog box options to a final action. Italic text denotes variables. The sequence File»Page Setup»Options directs you to pull down the File menu. It also includes the NI-XNET LabVIEW and C API reference. such as menu items and dialog box options. device names. filenames. which alerts you to important information. functions. variables. or a system crash. This icon denotes a caution. directories. operations.

NI-XNET Hardware Overview. If you use C. refer to Appendix A. for a description of NI-XNET software concepts and programming models. refer to Getting Started in Chapter 4. Summary of the FlexRay Standard. © National Instruments Corporation 1-1 NI-XNET Hardware and Software Manual . refer to Appendix B. Summary of the CAN Standard. C++.Introduction 1 Ease of use: NI-XNET features provide fundamental concepts so that you can get started with programming. from easy-to-use signal I/O. so you can focus on your application. for a description of NI-XNET software concepts and programming models. Performance: Read and Write functions are designed to execute quickly. refer to Getting Started in Chapter 5. If you are new to the FlexRay protocol. Welcome to NI-XNET. NI-XNET is designed to meet the following goals: • • • • If you are new to the CAN protocol. You can use these features simultaneously on the same interface: input along with output and signal I/O along with frame I/O. without loss of data. Performance for LabVIEW Real-Time (RT) applications is a key focus of NI-XNET software and hardware architecture. NI-XNET API for LabVIEW. the National Instruments software for CAN and FlexRay products. for an introduction. Chapter 3. or another language for programming. These concepts help to abstract the differences between protocols. Consistency: NI-XNET uses common industry concepts for embedded networks such as CAN and FlexRay. for an introduction. If you use LabVIEW for programming. Completeness: NI-XNET provides a broad spectrum of features. down to more advanced streaming of raw frames. summarizes the features of National Instruments hardware for CAN and FlexRay. NI-XNET API for C.

© National Instruments Corporation 2-1 NI-XNET Hardware and Software Manual . Do not operate the module in a manner not specified in this document. nonconductive pollution occurs. use a soft. however. If you need to clean the module. If the module is damaged. You can compromise the safety protection built into the module if the module is damaged in any way. The following section contains important safety information that you must follow when installing and using the module. Pollution is foreign matter in a solid. Occasionally. liquid. Make sure that the module is completely dry and free from contaminants before returning it to service. The following is a description of pollution degrees: • • Pollution Degree 1 means no pollution or only dry. Operate the module only at or below Pollution Degree 2. and cables specified in the installation instructions. Use the module only with the chassis. You must have all covers and filler panels installed during operation of the module. a temporary conductivity caused by condensation must be expected. return it to National Instruments (NI) for repair. The pollution has no influence. If you must operate the module in such an environment. Do not substitute parts or modify the module except as described in this document. accessories. nonmetallic brush. Do not operate the module in an explosive atmosphere or where there may be flammable gases or fumes. Misuse of the module can result in a hazard. modules. Pollution Degree 2 means that only nonconductive pollution occurs in most cases. or gaseous state that can reduce dielectric strength or surface resistivity.Installation and Configuration Safety Information 2 This chapter explains how to install and configure NI-XNET hardware. it must be in a suitably rated enclosure.

Other examples • • 1 2 3 Installation categories. and electronics. Working voltage is the highest rms value of an AC or DC voltage that can occur across any particular insulation. Suitably rated measuring circuits may be connected to the MAINS for measuring purposes. Measurement circuits are subjected to working voltages2 and transient stresses (overvoltage) from the circuit to which they are connected during measurement or test. or 230 AC voltage for Europe). Do not exceed the maximum ratings for the module. also referred to as measurement categories. Operate the module at or below the installation category1 marked on the hardware label. Installation Category III is for measurements performed in the building installation at the distribution level. portable tools. Installation categories establish standard impulse withstand voltage levels that commonly occur in electrical distribution systems. MAINS is defined as a hazardous live electrical supply system that powers equipment.Chapter 2 Installation and Configuration • Pollution Degree 3 means that conductive pollution occurs. You must insulate signal connections for the maximum voltage for which the module is rated.S. 115 AC voltage for U. are defined in electrical safety standard IEC 61010-1. special equipment. Avoid contact between your body and the connector block signal when hot swapping modules. or dry. such as that provided by a standard wall outlet (for example. nonconductive pollution occurs that becomes conductive due to condensation. Do not remove or add connector blocks when power is connected to the system. Such voltage measurements include signal levels. The following is a description of installation categories: • Installation Category I is for measurements performed on circuits not directly connected to the electrical distribution system referred to as MAINS3 voltage. circuits powered by regulated low-voltage sources. distribution boards.com . Examples of Installation Category II are measurements performed on household appliances. NI-XNET Hardware and Software Manual 2-2 ni. This category refers to measurements on hard-wired equipment such as equipment in fixed installations. This category refers to local-level electrical distribution. and circuit breakers. This category is for measurements of voltages from specially protected secondary circuits. Installation Category II is for measurements performed on circuits directly connected to the electrical distribution system. limited-energy parts of equipment. and similar modules. Remove power from signal lines before connecting them to or disconnecting them from the module. Do not install wiring while the module is live with electrical signals.

socket outlets in the fixed installation. Examples include electricity meters and measurements on primary overcurrent protection devices and on ripple control units. consult the online help at Help»Help Topics»NI-XNET. junction boxes. © National Instruments Corporation 2-3 NI-XNET Hardware and Software Manual . click the Measurement & Automation shortcut on the desktop or select Start»Programs»National Instruments»Measurement & Automation. Like other National Instruments hardware products.000 V). NI-XNET uses MAX as the centralized location for all configuration and tools. For information about the NI-XNET software in MAX. and stationary motors with permanent connections to fixed installations. bus bars. If this help pane does not appear on the right side of the MAX window. You can view help for MAX Configuration tree items using the built-in MAX help pane. To launch MAX. including cables. click the Show Help button in the upper right corner. switches.Chapter 2 Installation and Configuration are wiring. • Installation Category IV is for measurements performed at the primary electrical supply installation (<1. Measurement & Automation Explorer (MAX) You can use Measurement & Automation Explorer (MAX) to access all National Instruments products.

If the self-test fails. the card icon shows a checkmark. To verify installation of the CAN or FlexRay hardware.Chapter 2 Installation and Configuration Verifying CAN and FlexRay Hardware Installation The MAX Configuration tree Devices and Interfaces branch lists NI-XNET hardware (along with other local computer system hardware). NI-XNET Hardware and Software Manual 2-4 ni. for information about resolving hardware installation problems. and the Test Status in the right pane describes the problem. Figure 2-1. If the self-test passes. To search for the new hardware.com . right-click the CAN or FlexRay device and select Self-Test. the card icon shows an X mark. Refer to Chapter 6. NI-XNET Hardware Listed in MAX If the NI-XNET hardware is not listed here. press <F5>. MAX is not configured to search for new devices on startup. Troubleshooting and Common Questions. as shown in Figure 2-1.

Chapter 2 Installation and Configuration Configuring CAN and FlexRay Interfaces The CAN and FlexRay hardware interfaces are listed under the device name. Figure 2-2. you can simulate the behavior of a control algorithm within a XNET device. select a new one from the Interface Name box in the middle pane. If LabVIEW RT exists. When you install the NI-XNET software. When you use a National Instruments PXI controller. For example. as shown in Figure 2-2. To change the interface name. you then download the NI-XNET software to the LabVIEW RT system using the Remote Systems © National Instruments Corporation 2-5 NI-XNET Hardware and Software Manual . As with any other NI product for LabVIEW RT. Renaming an Interface LabVIEW Real-Time (RT) Configuration LabVIEW Real-Time (RT) combines easy-to-use LabVIEW programming with the power of real-time systems. you can install a PXI-XNET card and use the NI-XNET API to develop real-time applications. using data from received CAN or FlexRay messages to generate outgoing CAN or FlexRay messages with deterministic response times. the installer checks for the LabVIEW RT module presence. the NI-XNET installer copies components for LabVIEW RT to the Windows system.

Tools NI-XNET includes two tools you can launch from MAX: • Bus Monitor—Displays statistics for CAN or FlexRay frames. For more information. Perform a self test for all installed NI-XNET devices.Chapter 2 Installation and Configuration branch in MAX. right-click NI Spy. Even on the RT target you can configure your NI-XNET hardware the same way as on the local system. Browse to Devices and Interfaces and open the NI-XNET Devices group. you need to verify the installation. This tool helps in debugging application programming problems. Launch this tool by right-clicking a CAN or Flexray interface and selecting Bus Monitor from the context menu. • NI Spy—Monitors function calls to the NI-XNET APIs. open the Software branch of the MAX Configuration tree. Note The Bus Monitor supports Windows targets only. PXI System After you install the PXI XNET cards and download the NI-XNET software to the LabVIEW RT system. Find your PXI target device in MAX under Network Devices and expand the tree. To launch this tool. and select Launch NI Spy. NI-XNET Hardware and Software Manual 2-6 ni. refer to the LabVIEW RT documentation.com . This is a basic tool for analyzing CAN or FlexRay network traffic.

FlexRay DB9 Pinout Pin 1 2 3 4 5 6 7 8 9 Signal NC FlexRay A BM COM FlexRay B BM SHLD COM FlexRay A BP FlexRay B BP (Ext_VBat) Signal No connection FlexRay channel A bus minus Ground FlexRay channel B bus minus FlexRay shield Ground FlexRay channel A bus plus FlexRay channel B bus plus Optional external bus voltage © National Instruments Corporation 3-1 NI-XNET Hardware and Software Manual . Table 3-1. NI-XNET FlexRay Hardware (PXI-8517 and PCI-8517) Pinout Table 3-1 describes the FlexRay DB9 pinout.NI-XNET Hardware Overview Overview 3 NI-XNET is a suite of products that provide connectivity to common automotive and industrial networks.

This isolation protects the NI XNET hardware and the PC it is installed in from being damaged by high-voltage spikes on the FlexRay bus. COM serves as the reference ground for the isolated signals. and is Galvanically isolated up to 500 VDC (2 s max withstand) channel-to-bus. Bus Power Requirements Because the High-Speed physical layer is completely powered internally. there is no need to supply bus power. Detailed cable length recommendations are in the FlexRay Electrical Physical Layer Specification available from the FlexRay Consortium. For detailed TJA1080 specifications. The XNET FlexRay physical layer is powered internally (from the card) through a DC-DC converter. In general. the maximum electrical length between point-to-point connections is 24 m. Transceiver NI FlexRay hardware uses a pair of Philips TJA1080 FlexRay transceivers per port. NI-XNET Hardware and Software Manual 3-2 ni. Cabling Requirements for FlexRay Cables may be shielded or unshielded and should meet the physical medium requirements described in Table 3-2 Table 3-2.Chapter 3 NI-XNET Hardware Overview FlexRay Physical Layer The FlexRay physical layer circuitry interfaces the FlexRay protocol controller to the physical bus wires. FlexRay Cable Characteristics Characteristic Differential mode impedance @ 10 MHz Specific line delay Cable attenuation @ 5 MHz (sine wave) Value 80–110 Ω 10 ns/m 82 dB/km Cable Lengths The cabling characteristics. The TJA1080 is fully compatible with the FlexRay standard and supports baud rates up to 10 Mbps. This device also supports advanced power management through a low-power sleep mode. and desired bit transmission rates affect the allowable cable length.com . cabling topology. refer to the Philips TJA1080 data sheet.

For all XNET devices. NI-XNET CAN Hardware (PXI-8511/8512/8513 and PCI-8511/8512/8513) Pinout Table 3-3 describes the CAN DB9 pinout. Table 3-3.Chapter 3 NI-XNET Hardware Overview Termination The simplest way to terminate FlexRay networks is with a single termination resistor between the bus wires Bus Plus and Bus Minus. The specific network topology determines the optimal termination values. the termination is software selectable. CAN DB9 Pinout D-SUB Pin 1 2 3 4 5 6 7 8 9 Signal NC CAN_L V– NC (SHLD) (COM) CAN_H NC (Ext_Vbat) Description No connection CAN_L bus line CAN reference ground No connection Optional CAN shield Optional CAN reference ground CAN_H bus line No connection Optional CAN power supply if bus power/external VBAT is required (single-wire CAN on XS hardware only) © National Instruments Corporation 3-3 NI-XNET Hardware and Software Manual . Refer to the Termination attribute in the XNET API for more details. XNET provides the option of 80 Ω between Bus Plus and Bus Minus or no termination. You cannot set termination for channel A and channel B independently. refer to the FlexRay Electrical Physical Layer Specification for more information. To determine the appropriate termination for your network.

This isolation protects the NI XNET hardware and the PC it is installed in from being damaged by high-voltage spikes on the CAN bus. and is Galvanically isolated up to 500 VDC (2 s max withstand) channel-to-bus. or Single Wire physical layer section to determine the behavior for the mode selected. When an XS port is selected as Low-Speed/Fault-Tolerant. When an XS port is selected as Single Wire. the bus power requirements for an XS port configured for Single Wire mode are identical to those of a dedicated Single Wire node. it behaves exactly as a dedicated Single Wire interface with the AU5790 transceiver.Chapter 3 NI-XNET Hardware Overview XS Software Selectable Physical Layer XNET CAN XS hardware allows you to select each port individually in the physical layer for one of the following transceivers: • • • High-Speed Low-Speed/Fault-Tolerant Single Wire When an XS port is selected as High-Speed. NI-XNET Hardware and Software Manual 3-4 ni. Low-Speed/Fault-Tolerant. The XNET High-Speed CAN physical layer is powered internally (from the card) through a DC-DC converter. For detailed TJA1041 specifications. The TJA1041 is fully compatible with the ISO 11898 standard and supports baud rates up to 1 Mbps. Transceiver CAN High-Speed hardware uses the Philips TJA1041 High-Speed CAN transceiver.com . For example. refer to the Philips TJA1041 data sheet. Refer to the appropriate High-Speed. The bus power requirements depend on the mode selected. it behaves exactly as a dedicated Low-Speed/Fault-Tolerant interface with the TJA1054A transceiver. High-Speed Physical Layer The CAN physical layer circuitry interfaces the CAN protocol controller to the physical bus wires. This device also supports advanced power management through a low-power sleep mode. it behaves exactly as a dedicated High-Speed interface with the TJA1041 transceiver. This feature is provided as the API Interface Transceiver Type property.

you can connect 64 devices to the network. The ISO 11898 specification says that significantly longer cable lengths may be allowed at lower bit rates. shown in Table 3-4. 120 Ω nominal. Detailed cable length recommendations are in the ISO 11898 and CiA DS 102 specifications. Belden cable (3084A) meets all these requirements and should be suitable for most applications. ISO 11898 Specifications for Characteristics of a CAN_H and CAN_L Pair of Wires Characteristic Impedance Length-related resistance Specific line delay Value 108 Ω minimum. If all devices meet the requirements of ISO 11898.3 m for a bit rate of 1 Mbps. The V– signal serves as the reference ground for the isolated signals. Number of Devices The maximum number of devices depends on the electrical characteristics of the devices on the network. ISO 11898 specifies 40 m total cable length with a maximum stub length of 0. Table 3-4. You can connect higher numbers of devices if the device electrical characteristics do not degrade signal quality below ISO 11898 signal level specifications. Cabling Requirements for High-Speed CAN Cables should meet the physical medium requirements specified in ISO 11898.Chapter 3 NI-XNET Hardware Overview Bus Power Requirements Because the High-Speed physical layer is completely powered internally. 132 Ω maximum 70 mΩ /m nominal 5 ns/m nominal Cable Lengths The cabling characteristics and desired bit transmission rate affect the allowable cable length. but each node should be analyzed for signal integrity problems. © National Instruments Corporation 3-5 NI-XNET Hardware and Software Manual . If all devices on the network meet the DeviceNet specifications. there is no need to supply bus power. you can connect at least 30 devices to the bus.

However. Refer to Figure 3-1 for an example of where termination resistors should be placed in a system with more than two devices. Termination Resistor Placement The termination resistors on a cable should match the nominal impedance of the cable. CAN Device CAN_H CAN Device 120 Ω CAN_L CAN Device CAN Device 120 Ω Figure 3-1. On the PXI-8512. each signal change on the line causes reflections that may cause communication failures.Chapter 3 NI-XNET Hardware Overview Cable Termination The pair of signal wires (CAN_H and CAN_L) constitutes a transmission line. NI-XNET devices feature software selectable bus termination for High-Speed CAN transceivers. Because communication flows both ways on the CAN bus. PCI-8513 (in high-speed mode). the user can enable 120 Ω termination resistors between CAN_H and CAN_L through an API call.com .25 W of power. Each termination resistor should be capable of dissipating 0. or PXI-8513 (in high-speed mode). so you should use a 120 Ω resistor at each end of the cable. ISO 11898 requires a cable with a nominal impedance of 120 Ω. CAN requires that both ends of the cable be terminated. only the devices on the ends of the cable should have termination resistors. NI-XNET Hardware and Software Manual 3-6 ni. If multiple devices are placed along the cable. PCI-8512. this requirement does not mean that every device should have a termination resistor. If the transmission line is not terminated.

The TJA1054A supports baud rates up to 125 kbps. This isolation protects the NI CAN hardware and the PC/chassis it is installed in from being damaged by high-voltage spikes on the CAN bus. For the internal power configuration. The transceiver can detect and automatically recover from the following CAN bus failures: • • CAN_H wire interrupted CAN_L wire interrupted © National Instruments Corporation 3-7 NI-XNET Hardware and Software Manual . and is Galvanically isolated up to 500 VDC (2 s max withstand) channel-to-bus. no V+ connection is required. 5-Pin Combicon Pin 4 Pin 2 Pin 3 Pin 5 Pin 1 9-Pin D-Sub Pin 7 120 Ω Pin 2 Pin 5 Pin 9 Pin 3 CAN_H CAN_L 120 Ω 9-Pin D-Sub Pin 7 Pin 2 Pin 5 Pin 9 Pin 3 5-Pin Combicon Pin 4 Pin 2 Pin 3 Pin 5 Pin 1 SHIELD V+ V– Power Connector V+ V– Figure 3-2.Chapter 3 NI-XNET Hardware Overview Cabling Example Figure 3-2 shows an example of a cable to connect two CAN devices. Transceiver CAN Low-Speed/Fault-Tolerant hardware uses the Philips TJA1054A Low-Speed/Fault-Tolerant transceiver. Cable Connecting Two CAN Devices Low-Speed/Fault-Tolerant Physical Layer The CAN Low-Speed/Fault-Tolerant physical layer is powered internally (from the card) through a DC–DC converter.

Bus Power Requirements Because the Low-Speed/Fault-Tolerant physical layer is completely powered internally. there is no need to supply bus power. Table 3-5. Belden cable (3084A) meets all of those requirements and should be suitable for most applications.com . Cabling Requirements for Low-Speed/ Fault-Tolerant CAN Cables should meet the physical medium requirements shown in Table 3-5. refer to the Philips TJA1054 data sheet.Chapter 3 NI-XNET Hardware Overview • • • • • • • CAN_H short-circuited to battery CAN_L short-circuited to battery CAN_H short-circuited to VCC CAN_L short-circuited to VCC CAN_H short-circuited to ground CAN_L short-circuited to ground CAN_H and CAN_L mutually short-circuited The TJA1054A supports advanced power management through a low-power sleep mode. CAN_H and ground. The V– signal serves as the reference ground for the isolated signals. Specifications for Characteristics of a CAN_H and CAN_L Pair of Wires Characteristic Length-related resistance Length-related capacitance: CAN_L and ground. CAN_L and CAN_H Value 90 mΩ/m nominal 30 pF/m nominal NI-XNET Hardware and Software Manual 3-8 ni. For detailed specifications for the TJA1054A. This feature is provided as the API Interface Transceiver Mode property.

Figure 3-3 shows termination resistor placement in a Low-Speed CAN network. Termination Resistor Placement for Low-Speed CAN The Determining the Necessary Termination Resistance for the Board section explains how to determine the correct termination resistor values for the Low-Speed CAN transceiver. You can connect higher numbers of devices if the electrical characteristics of the devices do not degrade signal quality below Low-Speed/Fault-Tolerant signal level specifications. PCI-8513 (in low-speed mode). You can use the PCI-8511. you can connect up to 32 devices to the bus. or PXI-8513 (in low-speed mode) to © National Instruments Corporation 3-9 NI-XNET Hardware and Software Manual . Determining the Necessary Termination Resistance for the Board Unlike High-Speed CAN. Refer to the NI-XNET Session Interface:CAN:Termination property for more information.Chapter 3 NI-XNET Hardware Overview Number of Devices The maximum number of devices depends on the electrical characteristics of the devices on the network. The termination requires two resistors: RTH for CAN_H and RTL for CAN_L. If all devices meet the requirements of typical Low-Speed/Fault-Tolerant CAN. Low-speed CAN Device RTL CAN_L RTH CAN_H RTL Low-speed CAN Device CAN_L RTH CAN_H RTL Low-speed CAN Device CAN_L RTH CAN_H CAN_H CAN_L Figure 3-3. Termination Every device on the Low-Speed CAN network requires a termination resistor for each CAN data line: RRTH for CAN_H and RRTL for CAN_L. This configuration allows the Philips fault-tolerant CAN transceiver to detect and recover from bus faults. Low-Speed CAN requires termination at the Low-Speed CAN transceiver instead of on the cable. PXI-8511.

allowing the user to adjust the overall network termination through an API call. NI-XNET Hardware and Software Manual 3-10 ni.com . before connecting it to a Low-Speed/ Fault-Tolerant port. PXI-8511. you should select the 1 KΩ termination option for your NI-XNET device. PCI-8511. In general.= ----------------------. It is important to determine the overall termination of the existing network. and PXI-8513 (in low-speed mode) hardware features software selectable bus termination resistors. Philips recommends an overall RTH and RTL termination of 100–500 Ω (each) for a properly terminated low-speed network. or the individual device termination. if the existing network has an overall network termination of 125 Ω or less.+ ----------------------.+ ----------------------R RTHoverall R RTHnode1 R RTHnode2 R RTHnode3 R RTHnoden Philips also recommends an individual device RTH and RTL termination of 500 Ω–16 KΩ.+ ----------------------.Chapter 3 NI-XNET Hardware Overview connect to a Low-Speed CAN network having from two to 32 nodes as specified by Philips (including the port on the CAN Low-Speed/ Fault-Tolerant interface). you can use the following formula to indicate which nearest value the termination property needs to be set to to produce the proper overall RTH and RTL termination of 100–500 Ω upon connection of the card: Low-speed CAN Device RTL CAN_L RTH CAN_H RTL Low-speed CAN Device CAN_L RTH CAN_H RTL Low-speed CAN Device CAN_L RTH CAN_H CAN_H CAN_L where RRTH overall should be 100–500 Ω. After determining the existing network or device termination. You also can use the Low-Speed/Fault-Tolerant interface to communicate with individual Low-Speed CAN devices. you should select the 5 KΩ option for your NI-XNET device. For existing overall network termination above 125 Ω. You can determine the overall network termination as follows: 1 1 1 1 1 ------------------------. PCI-8513 (in low-speed mode).

A power supply of 12 VDC is recommended. and assumes bus loading as per SAE J2411. This is because some modes require higher signal levels than the internal DC/DC converter on board can provide. Each Single Wire CAN port has a local bus load resistance of 9. The AU5790 supports baud rates up to 33.3 kbps in High-Speed transmission mode.09 kΩ between the CAN_H and RTH pins of the transceiver to provide protection against the loss of ground. refer to the Philips AU5790 data sheet.Chapter 3 NI-XNET Hardware Overview Single Wire Physical Layer The Single Wire physical layer is powered internally (from the card) through a DC–DC converter. The power supply should be a DC power supply with an output of 8 to 18 V. The achievable baud rate is primarily a function of the network characteristics (termination and number of nodes on the bus). © National Instruments Corporation 3-11 NI-XNET Hardware and Software Manual . You must supply power on the CAN V+ signal. For detailed AU5790 specifications. Transceiver Single Wire hardware uses the Philips AU5790 Single Wire CAN transceiver. It is therefore the system designer’s responsibility to factor in all the above parameters when designing a Single Wire CAN network. total system cable length. Cabling Requirements for Single Wire CAN The number of nodes on the network. You should take these requirements into account when determining requirements of the bus power supply for the system. Bus Power Requirements The Single Wire physical layer requires external bus power to provide the signal levels necessary to fully use all AU5790 operating modes. The physical layer is Galvanically isolated up to 500 VDC (2 s max withstand) channel-to-bus. The AU5790 also supports advanced power management through low-power sleep and wake up modes. bus loading of each node. and clock tolerance are all interrelated.3 kbps in normal transmission mode and 83. However. This isolation protects the NI CAN hardware and the PC it is installed in from being damaged by high-voltage spikes on the CAN bus. the Single Wire CAN transceiver does require bus power whenever the XS hardware is configured in Single-Wire mode. The SAE J2411 standard includes some recommended specifications that can help in making these decisions.

These signals are not electrically isolated from the backplane.com . as specified by J2411. Refer to the XNET API documentation for more details.Chapter 3 NI-XNET Hardware Overview Cable Length There can be no more than 60 m between any two network system ECU nodes. and Motion. between 2 and 32 devices may be networked together. and you can synchronize multiple cards by connecting a RTSI ribbon cable between the cards that need to share timing and triggering signals. IMAQ. RTSI With the RTSI bus. These ports are TTL tolerant user-configurable for inputting and outputting timebases and triggers. you can synchronize multiple NI-XNET cards with other National Instruments hardware products such as DAQ. All bus ports are Galvanically isolated up to 500 VDC (2 s max withstand) channel-to-channel and channel-to-bus. the maximum number of Single Wire CAN nodes allowed on the network depends on the device and cable electrical characteristics. PXI hardware uses a dedicated RTSI bus integrated into the backplane.09 kΩ load resistor. the RTSI bus interface is a connector at the top of the card. Termination (Bus Loading) All NI Single Wire CAN hardware includes a built-in 9. For PCI hardware. NI-XNET Hardware and Software Manual 3-12 ni. CAN/XS and FlexRay XNET products also feature two configurable timing and triggering ports on the device front panel. The RTSI bus consists of a flexible interconnect scheme for sharing timing and triggering signals in a system. If all devices and cables meet the requirements of J2411. Number of Devices As stated previously. Isolation All NI-XNET products protect your equipment from being damaged by high-voltage spikes on the target bus.

NI-XNET examples. Getting Started This section helps you get started using NI-XNET for LabVIEW. © National Instruments Corporation 4-1 NI-XNET Hardware and Software Manual . a LabVIEW project is an excellent introduction to NI-XNET concepts. LabVIEW Project Within a LabVIEW project. this organization helps you to find examples for your specific hardware product. you can create NI-XNET sessions used within a VI to read or write network data. The examples are grouped by protocol in CAN and FlexRay folders. When you browse examples by task. The examples build on the basic concepts to demonstrate more in-depth use cases. select Find Examples.NI-XNET API for LabVIEW 4 This chapter explains how to use the NI-XNET API for LabVIEW and describes the NI-XNET LabVIEW VIs and properties. To get started.. and using the NI-XNET palettes to create your own VI. NI-XNET examples are under Hardware Input and Output. Most of the examples create a session at run time rather than a LabVIEW project. Using LabVIEW project sessions is best suited for static applications.. To view the NI-XNET examples. the window on the left provides an introduction to the NI-XNET session in the LabVIEW project. Even if your application is more dynamic. and select New»NI-XNET Session. from the LabVIEW Help menu. The introduction links to help topics that describe how to create a session in the project. right-click My Computer. and each folder contains shared examples. in that the network data does not change from one execution to the next. In the resulting dialog. It includes information about using NI-XNET within a LabVIEW project. Examples NI-XNET includes LabVIEW examples that demonstrate a wide variety of use cases. Although you can write NI-XNET applications for either protocol. including a description of the session modes. open a new LabVIEW project.

For FlexRay (at Hardware Input and Output»FlexRay»Basic): • • • FlexRay Signal Input Single Point.vi. Open an example VI by double-clicking its name. To view help for each node in the NI-XNET functions palette.vi. NI-XNET Hardware and Software Manual 4-2 ni. then read the instructions on the front panel to run the examples. You view help for these controls in the same manner as on the functions palette. CAN Frame Input Stream. As you hover over each node or subpalette.vi with CAN Signal Output Single Point. open the context help window by selecting Show Context Help from the LabVIEW Help menu (or pressing <Ctrl-H>). FlexRay Frame Input Stream.vi with CAN Signal Output Waveform.vi with any output example. you can begin to write your own application.Chapter 4 NI-XNET API for LabVIEW — Getting Started A few examples are suggested to get started with NI-XNET.vi with FlexRay Signal Output Waveform.vi with any output example. CAN Signal Input Waveform. click the Detailed help link in the summary. select values using the front panel controls. When your VI block diagram is open. this palette is in the Measurement I/O»XNET functions palette. The NI-XNET controls palette includes I/O name controls that you drag to the your VI front panel. FlexRay Signal Input Waveform.vi with FlexRay Signal Output Single Point. a brief summary appears. To open the complete help. Palettes After learning the fundamentals of NI-XNET with a LabVIEW project and the examples.com . For CAN (at Hardware Input and Output»CAN»NI-XNET»Basic): • • • CAN Signal Input Single Point.vi. These controls enable the VI end user to select NI-XNET objects from the front panel. The NI-XNET functions palette includes nodes that you drag to your VI block diagram. To run the example.vi.

Create an NI-XNET session in a LabVIEW project. Right-click the loop condition (the stop sign) and create a control (stop button). Figure 4-1. 3. 2.Chapter 4 NI-XNET API for LabVIEW — Basic Programming Model Basic Programming Model The LabVIEW block diagram in the following figure shows the basic NI-XNET programming model. and the mode is Signal Input Single-Point. Create a new VI in the project and open the block diagram. Drag a while loop to the block diagram. The session name is MyInputSession. Basic Programming Model for NI-XNET for LabVIEW Complete the following steps to create this block diagram: 1. © National Instruments Corporation 4-3 NI-XNET Hardware and Software Manual .

NI-XNET enables you to create sessions for multiple hardware interfaces. you have created a fully functional NI-XNET application. 6. Right-click the data output from XNET Read. Drag the NI-XNET session from a LabVIEW project to the while loop. Browsing and selecting a hardware interface. For each interface. NI-XNET creates a constant for data and wires that constant to XNET Write. Within NI-XNET. you can use a Signal Input Single-Point Mode session at the same time you use a Frame Input Stream Mode session.Chapter 4 NI-XNET API for LabVIEW — Interfaces 4. or to change the data at run time. Managing and browsing database files. The sessions can use different modes. You can create sessions for other input or output modes using the same technique. For example. 5. The following sections describe the fundamental concepts used within NI-XNET. The NI-XNET functions palette includes nodes that extend this programming model to perform tasks such as: • • • • • Creating a session at run time (instead of a LabVIEW project). This creates the XNET session wired to the corresponding XNET Read. the interface is the object used to communicate with external hardware described in the database. Interfaces What Is an Interface? The interface represents a single CAN or FlexRay connector on an NI hardware device.vi and create an indicator. Each interface name uses the following syntax: <protocol><n> The <protocol> is either CAN for a CAN interface or FlexRay for a FlexRay interface. View the received signal values. When you drag an output session to the diagram. Stop the VI when you are done. Controlling the configuration and state of a session. Each section explains how to perform extended programming tasks. When you complete the preceding steps. you can use multiple input sessions and multiple output sessions simultaneously.vi.vi. NI-XNET Hardware and Software Manual 4-4 ni. Creating frames or signals at run time (instead of using a database file). right-click the constant and select Change to Control. Run the VI. You can enter constant values to write.com .

Later on. Therefore. Each port is listed with the current interface name assignment. Each NI-XNET device is listed with the hardware product name. and your system always uses a single two-port CAN device. and FlexRay2. When you select a port. FlexRay1. the typical practice is to allow NI-XNET to select the number automatically. For example. Select each NI-XNET device to view its physical ports. the CAN port labeled Port 1 is assigned as interface CAN1. select Devices and Interfaces under My System. Although the physical port is in a different place. If you do not change the number in MAX. the right window shows a picture of the device with the port circled and the port LED blinking. you can assign a different interface name than the default. you can change the interface for physical port 2 of a PCI-8517 to FlexRay1 instead of FlexRay2. even if you add new CAN cards. CAN2. including all devices and interfaces. Although you can change the interface number <n> within Measurement & Automation Explorer (MAX). © National Instruments Corporation 4-5 NI-XNET Hardware and Software Manual . The difference between the terms is that port refers to the hardware object (physical). so that your application does not need to change when your hardware configuration changes. To view hardware in your local Windows system. such as NI PCI-8517 FlexRay. you can write all your applications to assume CAN1 and CAN2. In the selected port’s window on the right. For as long as that CAN card exists in your system. a chassis with five CAN devices). if you have a two-port CAN device and a two-port FlexRay device in your system. the CAN port on the USB device is assigned as interface CAN1. if you have a PXI chassis with a single CAN PXI device in slot 3. The numbering starts at 1. The benefit of this separation is that you can use the interface name as an alias to any port. For example. VIs written to use CAN1 work with either hardware configuration without change. For example. you can change one property: the interface name. The blinking LED assists in identifying a specific port when your system contains multiple instances of the same hardware product (for example. NI-XNET uses the same interface numbers for that device.Chapter 4 NI-XNET API for LabVIEW — Interfaces The number <n> identifies the specific interface within the <protocol> scope. the interface names are CAN1. such as FlexRay1. How Do I View Available Interfaces? Measurement and Automation Explorer (MAX) Use MAX to view your available NI-XNET hardware. and interface refers to the software object (logical). NI-XNET always starts at 1 and increments for each new interface found. NI-XNET also uses the term port to refer to the connector on an NI hardware device. if you remove the CAN PXI card and connect a USB device for CAN.

You select a specific interface from the list for use with XNET Create Session.vi. By right-clicking the XNET Create Session. NI-XNET Hardware and Software Manual 4-6 ni. You typically use a constant when you have only a single NI-XNET device. if you distribute your LabVIEW application to end users who are not familiar with MAX. you enter the interface in the session dialog. in a manner similar to the XNET Interface I/O name. The XNET Interface I/O name has a drop-down list of all available NI-XNET interfaces. I/O Name When you create a session at run time. you can type an interface name such as CAN1 in the dialog. The constant is placed on your block diagram. This enables you to create sessions and program VIs prior to installing the hardware. NI-XNET provides property nodes to query for available hardware. to use fixed names such as CAN1 and CAN2.vi interface input.com . System Node In some cases. you pass the desired interface to XNET Create Session.vi. This list matches the list of interfaces shown in MAX. The interface uses the XNET Interface I/O Name type. If you are creating a session in a LabVIEW project and do not yet have NI-XNET hardware in your system. The control is placed on your front panel. find the desired system under Remote Systems and select Devices and Interfaces under that system. This dialog has a list of available interfaces. you may need to display a similar view within the application itself. you can create a constant or control for the XNET Interface I/O name. The features of NI-XNET devices and interfaces are the same as the local system. LabVIEW Project When you create a session in a LabVIEW project.Chapter 4 NI-XNET API for LabVIEW — Interfaces To view hardware in a remote LabVIEW Real-Time system. For example. you may need to provide features similar to MAX within your own application. Within the NI-XNET functions palette Advanced subpalette. You typically use a control when you have a large number of NI-XNET devices and want the VI end user to select from available interfaces.

you get the list of devices from the XNET System node. another CAN cluster Powertrain. in a manner similar to MAX. Although XNET Create Session. you get its name and add that name to the tree (with the device as the parent). this file is referred to as a database. • • Database: Each database is represented as a distinct instance in NI-XNET. LabVIEW can cast a string to that I/O name automatically. the database may describe a single vehicle. For each XNET Device. such as the vehicle. © National Instruments Corporation 4-7 NI-XNET Hardware and Software Manual . each of which describes a distinct entity in the embedded system.dbc) for CAN or FIBEX (. Cluster: Each database contains one or more clusters. The database contains many object classes. and one FlexRay cluster Chassis.vi. Advanced System Example Using Property Nodes The block diagram in the figure above shows how to populate a LabVIEW tree control with NI-XNET devices and interfaces.xml) for FlexRay. such as CANdb (. This embedded communication is described within a standardized file. NI-XNET must understand the communication in the actual embedded system.vi uses the XNET Interface I/O name as an input. For example.Chapter 4 NI-XNET API for LabVIEW — Databases Figure 4-2. you also can create the database at run time (in memory). Databases What Is a Database? For the NI-XNET interface to communicate with hardware products on the external CAN/FlexRay network. where the cluster represents a collection of hardware products connected over a shared cabling harness. you get its name and add that name to the tree. Although the database typically is a file. Within NI-XNET. For each XNET interface (port) in the device. If you use this tree control to select an interface for session creation. In other words. where the vehicle contains one CAN cluster Body. First. each cluster represents a single CAN network or FlexRay network. you can pass the interface name from the tree directly to XNET Create Session.

but merely the association within NI-XNET. length of the raw bits in the frame. for the file path C:\Documents and Settings\All Users\Documents\Vehicle5\ MyDatabase. position. For example. The alias provides a shorter. After you create an alias. In addition to improving readability. easier-to-read name for use within your application. you can specify the file path or an alias to the file. the large text file is compressed to an optimized binary NI-XNET Hardware and Software Manual 4-8 ni. the alias concept isolates your LabVIEW application from the specific file path. and so on.DBC you can add an alias named MyDatabase. viewing existing aliases. the aliases from the previous use remain. If you uninstall and reinstall NI-XNET. Only one ECU in the cluster transmits (sends) each frame. Within the database. If you exit and relaunch LabVIEW. Frame: Each frame represents a unique unit of data transfer over the cluster cable. The cluster contains one or more ECUs connected over a CAN or FlexRay cable. You also can perform these tasks at run time. using the VIs available in the NI-XNET functions palette Database»File Mgt subpalette. For example. in which case it behaves as a gateway between the clusters. The physical unit uses a LabVIEW double-precision floating-point numeric type. and one or more ECUs receive each frame. Deleting an alias does not delete the database file itself. each of which is called a signal. The frame bits contain payload data and an identifier that specifies the data (signal) content. the aliases from the previous installation remain. deleting an alias. • • What Is an Alias? When using a database file with NI-XNET. It is possible for a single ECU to be contained in multiple clusters.com . and a scaling formula to convert raw bits to/from a physical unit. it exists until you explicitly delete it. each signal specifies its name. Signal: Each frame contains zero or more values. An alias is required for deploying databases to LabVIEW Real-Time (RT) targets. When you deploy to a LabVIEW RT target.DBC your LabVIEW application continues to run without change. The alias concept is used in most NI-XNET features for the database classes. The XNET I/O Names for database classes include features for adding a new alias.Chapter 4 NI-XNET API for LabVIEW — Databases • ECU: Each Electronic Control Unit (ECU) represents a single hardware product in the embedded system. if your application uses the alias MyDatabase and you change its file path to C:\Embedded\Vehicle5\MyDatabase.

This file likely would be in CANdb or FIBEX format. Can Use File As Is? Is the file up to date with respect to your ECU(s)? If you do not know the answer to this question. the vehicle maker (or the maker’s supplier) already may have provided a database file. and that binary file is transferred to the target.Chapter 4 NI-XNET API for LabVIEW — Databases format. Database Programming The NI-XNET software provides various methods for creating your application database configuration. A description of each step in the process follows the flowchart. The following figure shows a process for deciding the database source. you can use the techniques discussed in Edit and Select to update your application without significant redesign. using NI-XNET is relatively straightforward. Yes Already Have File? No Yes Can I use file as is? No Yes Want to Use a File? No Select From File Edit and Select Create New File Using Editor Create in Memory Figure 4-3. For more information about databases with LabVIEW RT. If you encounter problems. the best choice is to assume Yes and begin using NI-XNET with the file. © National Instruments Corporation 4-9 NI-XNET Hardware and Software Manual . refer to Using LabVIEW Real-Time. Decision Process for Choosing Database Source Already Have File? If you are testing an ECU used within a vehicle. When you have this file.

Property Nodes If you create a session at run time. you can click the drop-down list for each array element to select from available signals in the file. Change the VI selector to Signal Input Single-Point. I/O names. For example. The easiest way to do this is to use I/O names for the objects that you need. the NI-XNET example VIs use an example database file installed with NI-XNET. I/O Names If you create sessions at run time. you need to wire objects from the database file to XNET Create Session. you may want to implement your own front panel controls to select objects from the database. After you browse to the file and select a cluster.Chapter 4 NI-XNET API for LabVIEW — Databases Select from File There are three options for selecting the database objects to use for NI-XNET sessions: a LabVIEW project. you enter the database and cluster to use. These property nodes are found in the NI-XNET functions palette Database subpalette. and property nodes. Right-click the signal list control and select Browse for Database File to find the database file. right-click signal list and Select Database to select a specific cluster within the file. For example. select a cluster to use. and select a list of frames or signals.com . then click the drop-down list to select signals. For example. First. NI-XNET Hardware and Software Manual 4-10 ni. You can change this file to a different file using the previous steps. then select one or more signals to read. The VI user selects signals from this tree control. For a CANdb file. This creates an array of XNET Signal I/O names on your front panel. that information is saved with the VI. The tree shows the frames and signals within a selected cluster. you can do this using property nodes for the database classes. Most NI-XNET examples use I/O names to select objects (frames or signals). rather than use I/O names. LabVIEW Project The NI-XNET session in a LabVIEW project assumes that you have a database file. if you create a Signal Input Single-Point session.vi. Right-click the signal list input and select Create»Control. assume that you want to create a Signal Input Single-Point session and want the VI end user to select signals from the front panel. As a default. The tree control block diagram uses a programming model similar to the Advanced System Example Using Property Nodes. so you need to select only signal names from that point onward. assume you want a tree control on the VI front panel. drag XNET Create Session.vi from the NI-XNET functions palette. For a FIBEX file. Although the programming is more advanced than I/O names. The configuration dialog includes controls to browse to your database file.

you get its name and add that name to the tree (with the frame as the parent). the changes in memory (not the original file) are used. you wire the selected objects to the corresponding property node and set properties to change the value.vi and XNET Database Close. you select the frames or signals for the NI-XNET session using one of the options described in Select from File. The block diagram for LabVIEW 8. When you edit the object using its property node. If you use this tree control to select signals for session creation.Chapter 4 NI-XNET API for LabVIEW — Databases Figure 4-4.6 is more complex. you can use names from the tree to form the signal names that you wire to XNET Create Session. Advanced Database Example Using Property Nodes The block diagram in the figure above shows how to populate a LabVIEW tree control with the frames and signals for a specific cluster. Next. Because a cluster represents a single network connected to your NI-XNET interface. because XNET Database Open.vi. Edit and Select There are two options for editing the database objects for the NI-XNET session: edit in memory and edit the file.vi are required (refer to XNET Cluster I/O Name). you get its name and add that name to the tree. Edit in Memory First. you get the list of frames from the XNET Cluster node. refer to XNET Signal I/O Name. This block diagram is for LabVIEW 2009 or later. For each XNET Signal in the frame. For each XNET Frame. this changes the representation in memory.5 or 8. First. © National Instruments Corporation 4-11 NI-XNET Hardware and Software Manual . For information about signal name syntax. but does not save the change to the file.vi. you do not need to show multiple clusters. When you pass the object into XNET Create Session.

Once you have a file. and storage in a file makes this easier to manage. FlexRay communication configuration requires a large number of complex properties. For example.com . Using this tool. for FlexRay applications. Using this technique. and save those changes. As a general rule. You can save the changes to the existing file or a new file. The NI-XNET Database Editor has features that facilitate this configuration.vi to create new database objects in memory. NI-XNET Hardware and Software Manual 4-12 ni. edit the objects. you open an existing file. you can create a session to transmit a CAN frame with only two objects. When you have a file with the changes you need.Chapter 4 NI-XNET API for LabVIEW — Databases Edit the File The NI-XNET Database Editor is a tool for editing database files for use with NI-XNET. Create in Memory You can use XNET Database Create Object. Create New File Using the Database Editor You can use the NI-XNET Database Editor to create a new database file. Want to Use a File? If you do not have a usable database file. you can choose to create a file or avoid files altogether for a self-contained application. you select objects in your application as described in Select from File. it is easier to create a self-contained application. You configure each object you create using the property node. Each class of database object contains required properties that you must set (refer to Required Properties). you can avoid files entirely and make your application self contained. you select objects in your application as described in Select from File. using a FIBEX file is recommended. Because CAN is a more straightforward protocol.

The frame has several required properties. Create Cluster and Frame for CAN Figure 4-5 shows a sample diagram that creates a cluster and frame in memory.Chapter 4 NI-XNET API for LabVIEW — Sessions Figure 4-5. the only property required for the cluster is Baud Rate. After you create and configure objects in memory. © National Instruments Corporation 4-13 NI-XNET Hardware and Software Manual . The remaining properties configure the frame to use 8 bytes of payload data and CAN standard ID 5. or 10 ms).01. refer to Using CAN. The cluster name is myCluster. As discussed in Basic Programming Model. with Cyclic Data meaning to transmit every CAN:Transmit Time seconds (0. The database name is :memory:. This enables you to implement a database editor within your application. Database objects: These describe how external hardware communicates. For additional information on in-memory configurations for CAN. The XNET Frame CAN:Timing Type property specifies how to transmit the frame. you can use XNET Database Save. This special database name specifies a database that does not originate from a file. Mode: This specifies the direction and representation of I/O data. your application uses sessions to read and write I/O data. The cluster is wired to create a frame object named myFrame. Sessions What Is a Session? The NI-XNET session represents a connection between your National Instruments CAN/FlexRay hardware and hardware products on the external CAN/FlexRay network.vi to save the objects to a file. If the subsequent diagram passed the frame to XNET Create Session (Frame Output Queued). this would create a session you can use to write data for transmit. For CAN. Each session configuration includes: • • • Interface: This specifies the National Instruments hardware to use.vi.

you can use a Signal Input Single-Point session at the same time you use a Frame Input Stream session. if you create a Frame Output Queued session for frameA. For each interface. This mode typically is used for synchronizing XNET data with DAQmx analog/digital input channels. direction (input or output). you can use multiple input sessions and multiple output sessions simultaneously. The sessions can use different modes. The mode is an enumeration of the following: • Signal Input Single-Point Mode: Reads the most recent value received for each signal. For example. Session Modes The session mode specifies the data type (signals or frames). XNET Read. such as Hardware In the Loop (HIL). This is the recommended mode for writing a sequence of all signal values. For example. The limitations on sessions relate primarily to a specific frame or its signals. Signal Output Waveform Mode: Using the time when the signal frame is transmitted according to the database. This mode typically is used for synchronizing XNET data with DAQmx analog/digital output channels. Signal Output XY Mode: Provides a sequence of signal values for transmit using each frame’s timing as the database specifies. resamples the signal data from a waveform with a fixed sample rate.com . provides its signals as a value/ timestamp pair. then create a Signal Output Single-Point session for frameA. such as whether communication has stopped due to error detection defined by the protocol standard.signalB (a signal in frameA). This combination of sessions is not allowed. resamples the signal data to a waveform with a fixed sample rate. This is the recommended mode for reading a sequence of all signal values. such as Hardware In the Loop (HIL). you can use the session to interact with the network in other ways. This mode typically is used for control or simulation applications.Chapter 4 NI-XNET API for LabVIEW — Sessions In addition to read/write of I/O data. Signal Input Waveform Mode: Using the time when the signal frame is received. and how data is transferred between your application and the network. Signal Input XY Mode: For each frame received. You can use sessions for multiple hardware interfaces. This mode typically is used for control or simulation applications. • • • • • NI-XNET Hardware and Software Manual 4-14 ni. Signal Output Single-Point Mode: Writes signal values for the next frame transmit. For example.vi includes selections to read the state of communication. because writing data for the same frame with two sessions would result in inconsistent sequences of data on the network. NI-XNET returns an error.

This mode typically is used for analyzing and/or logging all frame traffic in the network. You specify only one frame for the session. If the session uses a CAN interface. This mode enables your application to read a sequence of data specific to a frame (for example.vi returns values for that frame only. The input data is returned as an array of frame values. one per frame. The values are not limited to a single frame in the database.vi is the recommended way to read data for this mode. © National Instruments Corporation 4-15 NI-XNET Hardware and Software Manual .vi. These values represent all values received for the frame since the previous call to XNET Read.vi is recommended. but can transmit any frame.Chapter 4 NI-XNET API for LabVIEW — Sessions • Frame Input Stream Mode: Reads all frames received from the network using a single stream. XNET Read (Frame FlexRay). Frame Output Stream Mode: Transmits an arbitrary sequence of frame values using a single stream. because it returns an array of LabVIEW clusters specific to the FlexRay protocol. and XNET Read. CAN identifier). Frame Output Queued Mode: Provides a sequence of values for a single frame. Frame Output Single-Point Mode: Writes frame values for the next transmit. Frame Input Queued Mode: Reads data from a dedicated queue per frame. For more advanced applications. for transmit using that frame’s timing as the database specifies. a CAN identifier). If you need sequential data for multiple frames. If the session uses a FlexRay interface. which returns frames in an optimized. • • • • • Frame Input Queued Mode This mode reads data from a dedicated queue per frame. It enables your application to read a sequence of data specific to a frame (for example. create multiple sessions. protocol-independent format.vi. Frame Input Single-Point Mode: Reads the most recent value received for each frame. This VI returns an array of frames. use XNET Read (Frame Raw). This mode typically is used for control or simulation applications that require lower level access to frames (not signals). This mode typically is used for control or simulation applications that require lower level access to frames (not signals). XNET Read (Frame CAN). where each frame is a LabVIEW cluster specific to the CAN protocol.

The following figure shows a timeline of a frame transfer on the CAN network.6 Time 0 ms 1 ms 2 ms 3 ms 4 ms 5 ms E1.2 6 ms 7 ms 8 ms NI-XNET Hardware and Software Manual 4-16 ni.2 C3.4 C5.8 E5. refer to the XNET Frame CAN:Timing Type and FlexRay:Timing Type properties. followed by two calls to XNET Read (Frame CAN). This example uses CAN. Read C1.com . Frame E is an event-driven frame. Each frame contains two signals. For information about cyclic and event-driven frames.Chapter 4 NI-XNET API for LabVIEW — Sessions Example In this example network.6 E7.vi (one for C and one for E). one in the first byte and another in the second byte.4 C3. frame C is a cyclic frame that transmits on the network once every 2 ms.

and the second call to XNET Read (Frame CAN). The first two payload bytes contain the signal data.vi returned an array of values for frame C. The example uses hexadecimal C and E as the identifier of each frame.Chapter 4 NI-XNET API for LabVIEW — Sessions The following figure shows the data returned from the two calls to XNET Read (Frame CAN). The timestamp represents the absolute time when the XNET interface received the frame (end of frame).vi returns an array for frame E. accurate to microseconds. Each frame is a LabVIEW cluster with CAN-specific elements. © National Instruments Corporation 4-17 NI-XNET Hardware and Software Manual . this mode effectively sorts received frames so you can process them on an individual basis. The first call to XNET Read (Frame CAN). Compared to the example for the Frame Input Stream Mode.vi (two different sessions).

vi. frame C is a cyclic frame that transmits on the network once every 2 ms. 1st Read 2nd Read 3rd Read C1.6 Time 0 ms 1 ms 2 ms 3 ms 4 ms 5 ms E1. It typically is used for control or simulation applications that require lower level access to frames (not signals). you can use XNET Read (Frame Raw). Each frame contains its name (C or E). The input data is returned as an array of frames. XNET Read (Frame FlexRay). followed by the value of its two signals. For information about cyclic and event-driven frames. which returns frames in an optimized. The example uses CAN. that read returns signals for the second frame. one in the first byte and another in the second byte.com .vi is recommended. Each frame contains two signals. refer to the XNET Frame CAN:Timing Type and FlexRay:Timing Type properties. protocol-independent format. If the session uses a CAN interface. where each frame is a LabVIEW cluster specific to the CAN protocol. If the interface receives two frames prior to calling XNET Read. If the session uses a FlexRay interface. Example In this example network. For more advanced applications.Chapter 4 NI-XNET API for LabVIEW — Sessions Frame Input Single-Point Mode This mode reads the most recent value received for each frame. followed by a single call to XNET Read (Frame CAN). This mode does not use queues to store each received frame. one for each frame specified for the session.6 E7. The following figure shows a timeline of a frame transfer on the CAN network.4 C5. This instance returns an array of frames.2 6 ms 7 ms 8 ms NI-XNET Hardware and Software Manual 4-18 ni.vi. Frame E is an event-driven frame.8 E5. because it returns an array of LabVIEW clusters specific to the FlexRay protocol.vi. XNET Read (Frame CAN).vi is the recommended way to read data for this mode.2 C3.

Time of 0 ms indicates the time at which the session started to receive frames. both frame C and frame E are received. It typically is used for analyzing and/or logging all frame traffic in the network. so both elements return new values. where each frame is a LabVIEW cluster specific to the CAN protocol.Chapter 4 NI-XNET API for LabVIEW — Sessions The following figure shows the data returned from each of the three calls to XNET Read (Frame CAN). because this mode returns the most recent values. For frame E. In the data returned from the second call to XNET Read (Frame CAN). The first reception of frame C values (1 and 2) were lost.vi. For this example we assume that the Default Payload is all 0. This instance returns an array of frames.vi. because it returns an array of LabVIEW © National Instruments Corporation 4-19 NI-XNET Hardware and Software Manual .vi In the data returned from the third call to XNET Read (Frame CAN). so the timestamp is invalid. The timestamp for frame C is the same as the first call to XNET Read (Frame CAN). Because all frames are returned. In the data returned from the first call to XNET Read (Frame CAN). If the session uses a FlexRay interface. Frame Input Stream Mode This mode reads all frames received from the network using a single stream. In the frame timeline. XNET Read (Frame CAN). payload values 3 and 4 are returned again for frame C. XNET Read (Frame FlexRay).vi is recommended. no frame is received prior to the first call to XNET Read (Frame CAN). If the session uses a CAN interface. because no new frame has been received since the previous call to XNET Read (Frame CAN).vi is the recommended way to read data for this mode.vi. The session contains frame data for two frames: C and E. and the payload is the Default Payload.vi. your application must evaluate identification in each frame (such as a CAN identifier or FlexRay slot/cycle/channel) to interpret the frame payload data.vi. frame C contains values 3 and 4 in its payload.vi. The input data is returned as an array of frames.

8 E5. you can use XNET Read (Frame Raw). Received frames are copied to the Frame Input Stream session in addition to any other applicable input session.vi. two frames are returned from XNET Read. one in the first byte and another in the second byte. This duplication of incoming frames enables you to analyze overall traffic while running a higher level application that uses specific frame or signal data. followed by a single call to XNET Read (Frame CAN).vi.2 C3.2 6 ms 7 ms 8 ms NI-XNET Hardware and Software Manual 4-20 ni. The example uses CAN. when FrameA is received. Each frame contains its name (C or E). Each frame contains two signals. You can use only one Frame Input Stream session for a given interface.4 C5.vi of both sessions. then create a Frame Input Stream session. its data is returned from the call to XNET Read. Example In this example network. refer to the XNET Frame CAN:Timing Type and FlexRay:Timing Type properties.6 Time 0 ms 1 ms 2 ms 3 ms 4 ms 5 ms E1.com . followed by the value of its two signals.6 E7. Frame E is an event-driven frame. Read C1. For example. you can use other sessions with different input modes. For more advanced applications. protocol-independent format. The following figure shows a timeline of a frame transfer on the CAN network.4 C3. frame C is a cyclic frame that transmits on the network once every 2 ms. if a frame is received in a static slot on both channel A and channel B. For example.vi. which returns frames in an optimized. When used with a FlexRay interface. if you create a Frame Input Single-Point session for FrameA. While using the one Frame Input Stream session.Chapter 4 NI-XNET API for LabVIEW — Sessions clusters specific to the FlexRay protocol. For information about cyclic and event-driven frames. frames from both channels are returned.

accurate to microseconds.Chapter 4 NI-XNET API for LabVIEW — Sessions The following figure shows the data returned from XNET Read (Frame CAN).vi. © National Instruments Corporation 4-21 NI-XNET Hardware and Software Manual . Frame C and frame E are returned in a single array of frames. The timestamp represents the absolute time when the XNET interface received the frame (end of frame). The signal data is contained in the first two payload bytes. Each frame is a LabVIEW cluster with CAN-specific elements. This example uses hexadecimal C and E as the identifier of each frame.

5 ms. Therefore. such that every value provided is transmitted. which provides frame values in an optimized. Each frame contains two signals. XNET Write (Frame CAN). so you can leave them uninitialized. one in the first byte and another in the second byte. NI-XNET transmits each frame according to its properties in the database. Examples In this example network. to be transmitted sequentially for the frame specified in the session. use a different Frame Output Queued session for each frame or use the Frame Output Stream Mode. For more advanced applications. one for frame C. For this mode. you will see unexpected results on the bus. protocol-independent format.vi. This instance provides an array of frame values. If the session uses a CAN interface. Each frame contains its name (C or E). To transmit sequential values for multiple frames.0 ms. the number of payload bytes in each frame value must match that frame’s Payload Length property. refer to the XNET Frame CAN:Timing Type and FlexRay:Timing Type properties. The example uses CAN.com . For information about cyclic and event-driven frames. when you call XNET Write.vi. you can use XNET Write (Frame Raw).vi is the recommended way to write data for this mode. where each value is a LabVIEW cluster specific to the CAN protocol. followed by the value of its two signals. frame C is a cyclic frame that transmits on the network once every 2.vi is recommended. The frame values for this mode are stored in a queue. This mode allows you to specify only one frame for the session. The other frame value elements are ignored. The following figure shows a timeline of a frame transfer on the CAN network. followed immediately by another call for frame E. Frame E is an event-driven frame that uses a transmit time (minimum interval) of 2. The output data is provided as an array of frame values. If the number of payload bytes you write is different than the frame’s payload. If the session uses a FlexRay interface.Chapter 4 NI-XNET API for LabVIEW — Sessions Frame Output Queued Mode This mode provides a sequence of values for a single frame. because it provides an array of LabVIEW clusters specific to the FlexRay protocol. for transmit using that frame’s timing as specified in the database. XNET Write (Frame FlexRay). The timeline begins with two calls to XNET Write (Frame CAN). NI-XNET Hardware and Software Manual 4-22 ni.vi.

© National Instruments Corporation 4-23 NI-XNET Hardware and Software Manual .8 Time 0 ms 1 ms 2 ms 3 ms E5.vi.4 C5.2 C3. The second array shows data for the session with frame E.6 C5.6 E7. The first array shows data for the session with frame C.Chapter 4 NI-XNET API for LabVIEW — Sessions Write C1.8 4 ms 5 ms 6 ms 7 ms 8 ms The following figure shows the data provided to each call to XNET Write (Frame CAN).

If the session uses a FlexRay interface. 4 is taken from index 1 of the frame C array and used for transmit of frame C. This mode does not use queues to store frame values. NI-XNET Hardware and Software Manual 4-24 ni. If XNET Write.0 ms. If the session uses a CAN interface. and every 2. 0 is taken from index 1 of frame E array and used for transmit of frame E. Frame C transmits followed by frame E. each session starts within the call to XNET Write (Frame CAN).5 ms have elapsed after acknowledgment of the previous transmit of frame E.0 ms in the timeline.Chapter 4 NI-XNET API for LabVIEW — Sessions Assuming the Auto Start? property uses the default of true. According to the database.0 ms in the timeline.5 ms. Because frame C is a cyclic frame.vi is recommended.vi.vi is called again. frame C transmits once every 2. For more advanced applications. XNET Write (Frame CAN). the frame value with bytes 3. the new frame value is used.vi is the recommended way to write data for this mode.vi. both using the frame values from the first element (index 0 of each array). At 4. Because there are no more frame values for frame E. which provides frame values in an optimized. the previous frame value is used again at 6. so new frame values are required for each transmit. the frame value with bytes 5. which provides an array of LabVIEW clusters specific to the FlexRay protocol. Although there are no more frame values for frame C. It typically is used for control or simulation applications that require lower level access to frames (not signals). where each value is a LabVIEW cluster specific to the CAN protocol. Frame Output Single-Point Mode This mode writes frame values for the next transmit. protocol-independent format. this frame no longer transmits. When 2. the transmitted frame uses the value from the second call to XNET Write.vi. If XNET Write (Frame CAN). 0. At 2.0 ms thereafter. 6 is taken from index 2 of the frame C array and used for transmit of frame C. XNET Write (Frame FlexRay). the frame value with bytes 5. you can use XNET Write (Frame Raw). one for each frame specified for the session. it transmits repeatedly.0 ms in the timeline. and frame E is limited to an event-driven transmit once every 2. Frame E is event-driven.com . The output data is provided as an array of frames. 8.vi is called twice before the next transmit. This instance provides an array of frame values.

Each frame contains two signals. The example uses CAN.8 Time 0 ms 1 ms 2 ms 3 ms E3.4 C5. Each frame contains its name (C or E). one in the first byte and another in the second byte. If the number of payload bytes you write is different than the frame payload. so you can leave them uninitialized. The timeline shows three calls to XNET Write (Frame CAN). Therefore.6 C5.0 ms.4 4 ms 5 ms 6 ms 7 ms 8 ms © National Instruments Corporation 4-25 NI-XNET Hardware and Software Manual . you will see unexpected results on the bus.2 C3. the number of payload bytes in each frame value must match that frame’s Payload Length property.6 E7. Frame E is an event-driven frame that uses a transmit time (minimum interval) of 2.vi. when you call XNET Write.Chapter 4 NI-XNET API for LabVIEW — Sessions For this mode. 1st Write 2nd Write 3rd Write C1. The other frame value elements are ignored. refer to the XNET Frame CAN:Timing Type and FlexRay:Timing Type properties. For information about cyclic and event-driven frames. NI-XNET transmits each frame according to its properties in the database. Example In this example network.vi. The following figure shows a timeline of a frame transfer on the CAN network.5 ms. followed by the value of its two signals. frame C is a cyclic frame that transmits on the network once every 2.

vi. The session contains frame values for two frames: C and E.vi.com . After the second call to XNET Write (Frame CAN). both using frame values from the first call to XNET Write (Frame CAN).5 ms has not elapsed since acknowledgment of the previous transmit. but frame E does not transmit.Chapter 4 NI-XNET API for LabVIEW — Sessions The following figure shows the data provided to each of the three calls to XNET Write (Frame CAN). the session starts within the first call to XNET Write (Frame CAN).vi. Assuming the Auto Start? property uses the default of true. frame C transmits using its value (bytes 3. because its minimal interval of 2. 4). Frame C transmits followed by frame E. NI-XNET Hardware and Software Manual 4-26 ni.vi.

vi is always used. the CAN frame payload length in the database is ignored. This mode is not supported for FlexRay.0 ms.vi is an array of frame values. The value for frame E in the second call to XNET Write (Frame CAN). XNET Write (Frame CAN). Frame C transmits the third time using the value from the third call to XNET Write (Frame CAN). and the payload provided to XNET Write. 6). Because frame C is cyclic. 0).vi is the recommended way to write data for this mode. it transmits again using the same value (bytes 5.vi is not used.vi.vi occurs before the minimum interval elapses for frame E. Each frame contains two signals. The data wired to XNET Write. but can transmit any frame. the first frame value transmits immediately. refer to the XNET Frame CAN:Timing Type property.Chapter 4 NI-XNET API for LabVIEW — Sessions Because the third call to XNET Write (Frame CAN).vi (bytes 5. For this mode. Frame Output Stream Mode This mode transmits an arbitrary sequence of frame values using a single stream. frame C is a cyclic frame that transmits on the network once every 2. © National Instruments Corporation 4-27 NI-XNET Hardware and Software Manual .5 ms. For more advanced applications. Example In this example CAN database. such that every value provided is transmitted. This instance provides an array of frame values.vi. where each value is a LabVIEW cluster specific to the CAN protocol. The timing of each frame as specified in the database is ignored. The values are not limited to a single frame in the database. 4.vi. one in the first byte and another in the second byte. each of which transmits as soon as possible. if you provide four frame values to XNET Write. 0. Frames transmit sequentially (one after another). For information about cyclic and event-driven CAN frames. followed by the next three values transmitted back to back. For example. The frame values for this mode are stored in a queue. frame values transmit on the network based entirely on the time when you call XNET Write. you can use XNET Write (Frame Raw). Frame E is an event-driven frame that uses a transmit time (minimum interval) of 2. its next transmit uses its value (bytes 3. For CAN. 6). which provides frame values in an optimized format.

com . followed by the value of its two signals.Chapter 4 NI-XNET API for LabVIEW — Sessions The following figure shows a timeline of a frame transfer on the CAN network. The array provides values for frames C and E.6 Time 0 ms 1 ms E3. Write C1.2 C3.4 E7.8 E5.vi.vi. NI-XNET Hardware and Software Manual 4-28 ni.4 2 ms 3 ms 4 ms 5 ms 6 ms 7 ms 8 ms The following figure shows the data provided to the single call to XNET Write (Frame CAN). The timeline begins with a single call to XNET Write (Frame CAN). Each frame contains its name (C or E).

refer to the XNET Frame CAN:Timing Type and FlexRay:Timing Type properties.vi. Unlike the Frame Output Queued Mode. because each frame value timestamp is ignored for this mode. This is acceptable. All frame values transmit immediately.vi. For more advanced applications. this example uses an invalid timestamp value (0). For information about cyclic and event-driven frames. Each frame contains two signals. Within each frame values. © National Instruments Corporation 4-29 NI-XNET Hardware and Software Manual . Frame E is an event-driven frame. the Frame Output Stream mode does not use CAN frame properties from the database. Example In this example network. the Frame Output Stream mode disregards this timing and transmits the frame values in quick succession.vi.vi returns signals for the second frame. You can use the additional timestamps to determine whether each value is new since the last read. you can use XNET Read (Signal XY).vi for this mode. each session starts within the call to XNET Write (Frame CAN). Signal Input Single-Point Mode This mode reads the most recent value received for each signal. one in the first byte and another in the second byte. Although frame C is specified in the database as a cyclic frame. such as Hardware In the Loop (HIL). If the interface receives two frames prior to calling XNET Read. Use XNET Read (Signal Single-Point). It typically is used for control or simulation applications. Although frame C and E specify a slower timing in the database. frame C is a cyclic frame that transmits on the network once every 2 ms. that call to XNET Read. this mode does not repeat its transmit.Chapter 4 NI-XNET API for LabVIEW — Sessions Assuming the Auto Start? property uses the default of true. This mode does not use queues to store each received frame. which returns a timestamp for each signal value. using the same sequence as the array.

vi. In the data returned from the first call to XNET Read (Signal Single-Point).vi. The session contains all four signals.Chapter 4 NI-XNET API for LabVIEW — Sessions The example uses CAN. In the data returned from the second call to XNET Read (Signal Single-Point). followed by the value of its two signals. Time of 0 ms indicates the time at which the session started to receive frames. The values of the first reception of frame C (1 and 2) were lost. The timelines shows three calls to XNET Read (Signal Single-Point).2 6 ms 7 ms 8 ms The following figure shows the data returned from each of the three calls to XNET Read (Signal Single-Point). so the last two values return the signal Default Values. For frame E. 1st Read 2nd Read 3rd Read C1.6 E7.vi.vi. NI-XNET Hardware and Software Manual 4-30 ni.com . values 3 and 4 are returned for the signals of frame C. For this example.vi.4 C5. New values are returned for frame E (5 and 6). The following figure shows a timeline of a frame transfer on the CAN network.0. because no new frame has been received since the previous call to XNET Read (Signal Single-Point). because this mode returns the most recent values. assume that the Default Value is 0.8 E5.2 C3. no frame is received prior to the first call to XNET Read (Signal Single-Point).6 Time 0 ms 1 ms 2 ms 3 ms 4 ms 5 ms E1. values 3 and 4 are returned again for the signals of frame C. Each frame contains its name (C or E).vi. In the frame timeline.

notice that the timestamps for frame E (last two signals) are invalid (all zero).vi. The signal values are the same. but an additional timestamp is provided for each signal. © National Instruments Corporation 4-31 NI-XNET Hardware and Software Manual . This indicates that frame C has not been received since the previous read. notice that the timestamps for frame C (first two signals) are the same as the first call to XNET Read (Signal XY). both frame C and frame E are received. This indicates that frame E has not been received since the session started.vi. and therefore the signal values are the default. so all signals return new values. The following figure shows the data for the same frame timing. and therefore the signal values are repeated.vi.vi. For the first call to XNET Read (Signal XY). For the second call to XNET Read (Signal XY). but using XNET Read (Signal XY).vi.Chapter 4 NI-XNET API for LabVIEW — Sessions In the data returned from the third call to XNET Read (Signal Single-Point).

Each frame contains its name (C or E). You specify the resample rate using the XNET Session Resample Rate property.com . followed by a single call to XNET Read (Signal Waveform). Each frame contains two signals. This mode typically is used for synchronizing XNET data with DAQmx analog/digital input channels.vi returns directly to a LabVIEW Waveform Graph or Waveform Chart. The example uses CAN.4 C5. You can wire the data XNET Read (Signal Waveform). The data consists of an array of waveforms.6 Time 0 ms 1 ms 2 ms 3 ms 4 ms 5 ms E1. followed by the value of its two signals. dt (time between samples in seconds). Example In this example network.2 C3. this mode resamples the signal data to a waveform with a fixed sample rate. refer to the XNET Frame CAN:Timing Type and FlexRay:Timing Type properties. Each waveform contains t0 (timestamp of first sample). one in the first byte and another in the second byte.8 E5.6 E7.vi. one for each signal specified for the session.2 6 ms 7 ms 8 ms NI-XNET Hardware and Software Manual 4-32 ni.Chapter 4 NI-XNET API for LabVIEW — Sessions Signal Input Waveform Mode Using the time when the signal frame is received. Use XNET Read (Signal Waveform).4 C3. and an array of resampled values for the signal. Frame E is an event-driven frame. The following figure shows a timeline of a frame transfer on the CAN network. frame C is a cyclic frame that transmits on the network once every 2 ms. For information about cyclic and event-driven frames.vi for this mode. Read C1.

then again with signals 5 and 6. In the waveform diagram.0.vi.vi. In the frame timeline. Therefore. Nevertheless. This tradeoff between accuracy and efficiency is a disadvantage of the Signal Input Waveform mode.vi is that values for the first frame (7 and 8) are lost. if the resample rate is 1000000.vi after starting the session. © National Instruments Corporation 4-33 NI-XNET Hardware and Software Manual . if you use a resample rate of 1000000 (1 MHz).0. The effect on the data from XNET Read (Signal Waveform). You can avoid the loss of signal data by setting the session resample rate to a high rate. frame E is received twice in fast succession. In the frame timeline. Assuming this is the first call to XNET Read (Signal Waveform).Chapter 4 NI-XNET API for LabVIEW — Sessions The following figure shows the data returned from XNET Read (Signal Waveform). using a high resample rate can result in a large amount of duplicated (redundant) values. At time 0 ms. each frame’s signal values are represented in the waveforms without loss of data. once with signal values 7 and 8. assume the default value is 0. you cannot distinguish this from receiving the frame only once. this t0 reflects that start of the session. For this example. frame C is received twice with signal values 3 and 4. a frame that occurs once per second results in one million duplicated signal values. the first sample of each waveform uses the signal default value. Therefore. because the time of each frame reception is resampled into the waveform timing. The session contains all four signals and uses the default resample rate of 1000. In the data returned from XNET Read (Signal Waveform). no frame has been received. NI-XNET timestamps receive frames to an accuracy of 100 ns. For example. These two frames are received within one sample of the waveform (within 1 ms). which corresponds to Time 0 ms in the frame timeline. t0 provides an absolute timestamp for the first sample.

This is the recommended mode for reading a sequence of all signal values. refer to the XNET Frame CAN:Timing Type and FlexRay:Timing Type properties. NI-XNET Hardware and Software Manual 4-34 ni. For information about cyclic and event-driven frames. Signal Input XY Mode provides the most efficient and accurate representation of a sequence of received signal values. Frame E is an event-driven frame. the array size may be different from one cluster (signal) to another. Use XNET Read (Signal XY).vi returns directly to a LabVIEW XY Graph. one for timestamp and one for value. For example. whereas XY Graph can plot only values from a single call to XNET Read. when reading a sequence of received signal values.Chapter 4 NI-XNET API for LabVIEW — Sessions The Signal Input XY Mode does not have the disadvantages mentioned previously. frame C is a cyclic frame that transmits on the network once every 2 ms. this mode provides the frame signals as a timestamp/value pair.vi for this mode. The signal value timing is a direct reflection of received frames.com . The timestamp represents the absolute time when the XNET interface received the frame (end of frame). for validation purposes.vi. such that it represents a single array of timestamp/value pairs. Each cluster contains two arrays. The data consists of an array of LabVIEW clusters.vi in a history. In summary. one for each signal specified for the session. The received frames for this mode are stored in queues to avoid signal data loss. the timestamp and value array size is always the same. Signal Input XY Mode For each frame received. Example In this example network. accurate to microseconds. Each timestamp/value pair represents a value from a received frame. Use Signal Input XY Mode when you need to analyze CAN/FlexRay data on the diagram. One of the disadvantages of Signal Input XY Mode is that the corresponding LabVIEW indicator (XY Graph) does not provide the same features as the indicator for Signal Input Waveform (Waveform Graph). and no resampling occurs. Each frame contains two signals. the Waveform Graph can plot consecutive calls to XNET Read. For each signal. When signals exist in different frames. use Signal Input Waveform mode when you need to synchronize CAN/FlexRay data with DAQmx analog/digital input waveforms or display CAN/FlexRay data on the front panel (without significant validation). You can wire the data XNET Read (Signal XY). one in the first byte and another in the second byte.

vi.2 C3. The timestamp represents the end of frame.6 Time 0 ms 1 ms 2 ms 3 ms 4 ms 5 ms E1. The session contains all four signals. resulting in arrays of size 4 in the first two clusters. Frame E was received 3 times. to microsecond accuracy. Each frame contains its name (C or E).vi. © National Instruments Corporation 4-35 NI-XNET Hardware and Software Manual . Read C1.6 E7.4 C5.8 E5.2 6 ms 7 ms 8 ms The following figure shows the data returned from XNET Read (Signal XY). resulting in arrays of size 3 in the first two clusters. followed by a single call to XNET Read (Signal XY). Frame C was received four times.Chapter 4 NI-XNET API for LabVIEW — Sessions The example uses CAN.4 C3. followed by the value of its two signals. The following figure shows a timeline of a frame transfer on the CAN network. The timestamp and value arrays are the same size for each signal.

4 4 ms 5 ms 6 ms 7 ms 8 ms NI-XNET Hardware and Software Manual 4-36 ni.Chapter 4 NI-XNET API for LabVIEW — Sessions The XY Graph displays the data from XNET Read (Signal XY).vi. Each frame contains its name (C or E). If XNET Write. one in the first byte and another in the second byte. refer to the XNET Frame CAN:Timing Type and FlexRay:Timing Type properties.6 E7.vi. Each frame contains two signals. It typically is used for control or simulation applications. the transmitted frame uses signal values from the second call to XNET Write.vi for this mode. Signal Output Single-Point Mode This mode writes signal values for the next frame transmit.2 C3.5 ms. The following figure shows a timeline of a frame transfer on the CAN network. The example uses CAN. followed by the value of its two signals. This display is an accurate representation of signal changes on the network. Frame E is an event-driven frame that uses a transmit time (minimum interval) of 2. For information about cyclic and event-driven frames.8 Time 0 ms 1 ms 2 ms 3 ms E3. Example In this example network. frame C is a cyclic frame that transmits on the network once every 2.vi. The timeline shows three calls to XNET Write (Signal Single-Point).0 ms.6 C5. Use XNET Write (Signal Single-Point). such as Hardware In the Loop (HIL).com . 1st Write 2nd Write 3rd Write C1.vi is called twice before the next transmit. This mode does not use queues to store signal values.4 C5.

those bits transmit the Default Payload. If a transmitted frame contains bits no signal uses.Chapter 4 NI-XNET API for LabVIEW — Sessions The following figure shows the data provided to each of the three calls to XNET Write (Signal Single-Point).vi for this mode. After the second call to XNET Write (Signal Single-Point).5 ms has not elapsed since acknowledgment of the previous transmit.vi directly from a LabVIEW Waveform Graph or © National Instruments Corporation 4-37 NI-XNET Hardware and Software Manual . Frame C transmits followed by frame E. You can wire the data provided to XNET Write (Signal Waveform). frame C transmits using its values (3 and 4). this mode resamples the signal data from a waveform with a fixed sample rate. Use XNET Write (Signal Waveform). its next transmit uses its values (3 and 4).vi. the session starts within the first call to XNET Write (Signal Single-Point).vi are not used. both using signal values from the first call to XNET Write (Signal Single-Point). The session contains all four signals. Because frame C is cyclic. but frame E does not transmit. Assuming the Auto Start? property uses the default of true.vi. The values for frame E in the second call to XNET Write (Signal Single-Point). This mode typically is used for synchronizing XNET data with DAQmx analog/digital output channels. The resampling translates from the waveform timing to each frame’s transmit timing.vi. Signal Output Waveform Mode Using the time when the signal frame is transmitted according to the database. because its minimal interval of 2.vi. Frame C transmits the third time using values from the third call to XNET Write (Signal Single-Point). Because the third call to XNET Write (Signal Single-Point).vi occurs before the minimum interval elapses for frame E. it uses the most recent signal values in the waveform that correspond to that time. When the time for the frame to transmit occurs.vi (5 and 6). it transmits again using the same values (5 and 6). that signal transmits its Default Value. If a transmitted frame contains a signal not included in the output session.

0 ms.6 E5. The data consists of an array of waveforms. The example uses CAN. refer to the XNET Frame CAN:Timing Type and FlexRay:Timing Type properties. The following figure shows a timeline of a frame transfer on the CAN network.2 C5.6 E5.Chapter 4 NI-XNET API for LabVIEW — Sessions Waveform Chart. The timeline begins with a single call to XNET Write (Signal Waveform). Example In this example network. one in the first byte and another in the second byte.com .6 C7. The frames for this mode are stored in queues.6 Time 0 ms 1 ms 2 ms 3 ms E5.vi. Each frame contains two signals.5 ms.8 C5. Each waveform contains an array of resampled values for the signal.vi.0 samples per second. For information about cyclic and event-driven frames. Each frame contains its name (C or E). The session contains all four signals and uses the default resample rate of 1000. Frame E is an event-driven frame that uses a transmit time (minimum interval) of 2. NI-XNET Hardware and Software Manual 4-38 ni. Write C1. one for each signal specified for the session. frame C is a cyclic frame that transmits on the network once every 2. followed by the value of its two signals.6 4 ms 5 ms 6 ms 7 ms 8 ms The following figure shows the data provided to the call to XNET Write (Signal Waveform). You specify the resample rate using the XNET Session Resample Rate property.

Frame C transmits followed by frame E. The session resample rate property determines the time between waveform samples. Frame E still has not reached its transmit time of 2. The waveform elements t0 (timestamp of first sample) and dt (time between samples in seconds) are ignored for the call to XNET Write (Signal Waveform).0 ms in the frame timeline. © National Instruments Corporation 4-39 NI-XNET Hardware and Software Manual . the sample at index 1 cannot be resampled to a transmitted frame and is discarded. every sample is interpreted as an event.0 ms. The frame properties in the database determine each frame’s transmit time. so signal values 5 and 6 are taken from the last two Y arrays and used for transmit of frame E. frame E is allowed to transmit again. frame C transmits once every 2.0 ms in the frame timeline. According to the database.vi. Index 2 in the waveforms occurs at 2. such that every third sample is used to transmit. Therefore. This behavior continues for Y array indices 4 through 7.5 ms.5 ms from the previous acknowledgment. the session starts within the call to XNET Write (Signal Waveform).Chapter 4 NI-XNET API for LabVIEW — Sessions Assuming the Auto Start? property uses the default of true.vi. so signal values 1 and 2 are discarded. At index 3. the sample at index 1 occurs at 1. For the cyclic frame C. For the event-driven frame E. so signal values 7 and 8 are discarded. every second sample is used to transmit. Transmit of frames starts as soon as the XNET session starts. so signal values 5 and 6 are taken from the first two Y arrays and used for transmit of frame C. and frame E is limited to an event-driven transmit with interval 2. Frame C is not ready for its next transmit. both using signal values from the first sample (index 0 of all four Y arrays). In the waveforms. Frame C is ready for its next transmit at that time.

Therefore. When signals exist in the same frame.vi.0 ms and every 2. one for each signal specified for the session.5 ms. you cannot use it to represent events in the data.vi are mapped directly to transmitted frames. signals at the same index in the arrays are mapped to the same frame. Because frame E is event driven. followed by the value of its two signals. Each signal value is mapped to a frame for transmit. Use XNET Write (Signal XY). The timeline begins with a single call to XNET Write (Signal XY). Signal Output XY Mode is the recommended mode for writing a sequence of signal values. The timestamp array is unused (reserved). The example uses CAN. the array of signal values is mapped to an array of frames to transmit. This is the recommended mode for writing a sequence of all signal values. This mismatch between frame timing and waveform timing is a disadvantage of the Signal Output Waveform mode. one for timestamp and one for value. The following figure shows a timeline of a frame transfer on the CAN network. Each frame contains two signals. one in the first byte and another in the second byte. it does not transmit after the timeline shown. NI-XNET Hardware and Software Manual 4-40 ni. Each cluster contains two arrays.vi. because no new event has occurred.Chapter 4 NI-XNET API for LabVIEW — Sessions Although not shown in the frame timeline. For information about cyclic and event-driven frames. When used for event driven frames. such that every signal provided is transmitted in a frame. Signal Output XY Mode This mode provides a sequence of signal values for transmit using each frame’s timing as specified in the database. When signals exist in different frames.com . The data consists of an array of LabVIEW clusters. refer to the XNET Frame CAN:Timing Type and FlexRay:Timing Type properties.0 ms thereafter. Examples In this example network.0 ms. Because the waveform timing is fixed. Frame E is an event-driven frame that uses a transmit time (minimum interval) of 2. The frames for this mode are stored in queues. Each frame contains its name (C or E). Unless your application requires correlation of output data with DAQmx waveforms. frame C transmits again at 8. Frame C repeats signal values 5 and 6 until the next call to XNET Write (Signal Waveform). the frame transmits as if each sample was an event. the array size may be different from one cluster (signal) to another. the signal values provided to XNET Write (Signal XY). When you use the Signal Output XY Mode.vi for this mode. frame C is a cyclic frame that transmits on the network once every 2. and no resampling occurs.

8 4 ms 5 ms 6 ms 7 ms 8 ms The following figure shows the data provided to XNET Write (Signal XY).4 C5.6 E7. the session starts within a call to XNET Write (Signal XY). © National Instruments Corporation 4-41 NI-XNET Hardware and Software Manual . Frame C transmits followed by frame E.vi.Chapter 4 NI-XNET API for LabVIEW — Sessions Write C1. Assuming the Auto Start? property uses the default of true.vi.8 Time 0 ms 1 ms 2 ms 3 ms E5. This occurs at 0 ms in the timeline. both using signal values from the first sample (index 0 of all four Y arrays).2 C3. The session contains all four signals.6 C5.

so new signal values are required for each transmit. At 4. Frame X is a cyclic frame that transmits on the network once every 1. signal value 5 is taken from index 1 of the third Y array. the new signal values are used.0 ms in the timeline and every 2.vi is called again. Each frame contains two signals. signal values 5 and 6 are taken from index 2 of the first two Y arrays and used for transmit of frame C. At 3.2 X1.6 C7. Because there are no more signal values for frame E. it represents a new event.8 Time 0 ms 1 ms X5.0 ms in the timeline. At 2. this frame no longer transmits.2 2 ms 3 ms 4 ms 5 ms 6 ms 7 ms 8 ms NI-XNET Hardware and Software Manual 4-42 ni.vi.com . signal values 3 and 4 are taken from index 1 of the first two Y arrays and used for transmit of frame C.0 ms.6 X3.5 ms. In this example network. and frame E is limited to an event-driven interval of 2. Although there are no more signal values for frame C.2 X1. the values of the previous frame are used again at 6. frame C transmits once every 2.0 ms in the timeline. one in the first byte and another in the second byte. Because this is a new value for frame E. If XNET Write (Signal XY). it transmits repeatedly.4 C5. Because no new signal value was provided at index 1 in the fourth array.0 ms.0 ms.2 X1.0 ms thereafter. so the frame transmits again.2 C3. frame C is a cyclic frame that transmits on the network once every 2. The timeline begins with a single call to XNET Write (Signal XY).8 X7. Because frame C is a cyclic frame.2 X1. Frame E is event driven.5 ms in the timeline. the second signal of frame E uses the value 8 from the previous transmit.4 X1.Chapter 4 NI-XNET API for LabVIEW — Sessions According to the database. The next example network demonstrates a potential problem that can occur with Signal Output XY Mode. Write C1.

0 ms timeline for both frames.Chapter 4 NI-XNET API for LabVIEW — Sessions The following figure shows the data provided to XNET Write (Signal XY). Although you need to resolve this sort of timeline for cyclic frames. If the previous call to XNET Write (Signal XY). such that the number of elements corresponds to the timeline for the corresponding frame.vi. The best way to resolve this issue is to provide a different number of values for each signal. this would have created a complete 8. The four elements of the arrays are mapped to four frames. The number of signal values in all four Y arrays is the same. the frames for the last two arrays transmit twice as fast as the frames for the first two arrays. each call to © National Instruments Corporation 4-43 NI-XNET Hardware and Software Manual . For an event-driven frame. The session contains all four signals. This sort of behavior usually is unintended. The result is that the last pair of signals for frame X (1 and 2) transmit over and over.vi. you may decide simply to pass either zero or one set of signal values to XNET Write (Signal XY). The problem is that because frame X transmits twice as fast as frame C.vi provided eight elements for frame X (last two Y arrays) instead of just four elements. When you do this. The Signal Output XY Mode goal is to provide a complete sequence of signal values for each frame. until the timeline has completed for frame C. this is not necessarily true for event-driven frames.

mode. mode.vi You can use XNET Create Session. You select the interface using techniques described in How Do I View Available Interfaces?. The database objects (cluster. NI-XNET Hardware and Software Manual 4-44 ni. a LabVIEW project provides the easiest programming model. Signal Input Waveform requires an array of signals). If you do not already have a database file.Chapter 4 NI-XNET API for LabVIEW — Sessions XNET Write (Signal XY). You select the database objects using techniques described in Database Programming.vi is the best method to use for NI-XNET sessions. XNET Create Session.vi takes inputs for the interface. The database objects depend on the mode (for example. This run-time creation has advantages over a LabVIEW project. you select the interface. When you configure the session in a LabVIEW project. in that the network data does not change from one execution to the next.vi to create NI-XNET sessions at run time. a LabVIEW project is the best method to use for NI-XNET sessions.com . How Do I Create a Session? There are two methods for creating a session: a LabVIEW project and XNET Create Session. the application end user can provide a database file and select the specific frames or signals to read and/or write. On the front panel. a test system for an engine in any make/model/year car). If your application is used for a specific product (for example.vi. which you can launch from NI-XNET user interface. an instrument panel for a specific make/model/year car). LabVIEW Project Using LabVIEW project sessions is best suited for applications that are static. You typically use only one method to create all sessions for your application. and signals) must exist in a file. Because the configuration does not change. frames. XNET Create Session. you can create one using the NI-XNET Database Editor. and database objects. If your application is used for many different products (for example. and database objects with the NI-XNET user interface. and the front panel must be simple (for example. Refer to Getting Started for a description of creating a session in a LabVIEW project. The disadvantage is that the VI diagram is more complex. a test button with a pass/fail LED).vi can generate a single event. XNET Create Session. and the overall timeline is not a major consideration. because the end user of your application can configure sessions from the front panel.

you can read or write arbitrary frames. no database object is required (no cluster). Configure CAN Frame Input Stream © National Instruments Corporation 4-45 NI-XNET Hardware and Software Manual . To understand how the CAN frame timing properties apply to NI-XNET sessions. The following figure shows an example diagram that creates a Frame Input Stream session and sets the baud rate to 500 kbps.vi and then set the baud rate using the session property node. you typically need to specify database objects when creating an NI-XNET session. Configuring Frame I/O Stream Sessions As described in Database Programming. You simply can call XNET Create Session. If your application uses only Frame I/O Stream sessions. Although the CAN baud rate applies to all hardware on the bus (cluster). In sessions with Frame Input Stream or Frame Output Stream mode. Because these modes do not use specific frames. the properties of each CAN frame specify the CAN data transfer timing. the only required cluster property is the baud rate. Figure 4-6. The CAN protocol supports an exception that makes some applications easier to program. You can set this interface property using the session property node. refer to CAN Timing Type and Session Mode. only the database cluster properties apply.Chapter 4 NI-XNET API for LabVIEW — Using CAN Using CAN This section summarizes some useful NI-XNET features specific to the CAN protocol. Understanding CAN Frame Timing When you use an NI-XNET database for CAN. NI-XNET also provides the baud rate as an interface property. For CAN.

the NI-XNET interface should not transmit a startup frame. such as the NI-XNET examples. Slots of time for that clock determine when each frame transmits. Test single ECU that is coldstart: If you connect to a single ECU (and nothing else). you need to connect two NI-XNET FlexRay interfaces to the ECU. In this scenario. which means that all hardware products on the network share a synchronized clock. a single FlexRay interface can transmit only one startup frame. and that ECU is not a coldstart node. Connect to existing cluster: If you connect your NI-XNET FlexRay interface to an existing cluster (for example. The NI-XNET interface must transmit a startup frame that is different than the startup frame the ECU transmits. Starting Communication FlexRay is a Time Division Multiple Access (TDMA) protocol.com . According to the FlexRay specification.Chapter 4 NI-XNET API for LabVIEW — Using FlexRay Using FlexRay This section summarizes some useful NI-XNET features specific to the FlexRay protocol. To start communication on FlexRay. your NI-XNET FlexRay interface may need to act as a coldstart node. The ECU cannot communicate without two coldstart nodes (two clocks). In the FlexRay database. The properties of each startup frame (including the time slot used) are specified in the FlexRay database. Because this is a cluster with two nodes. and that ECU is a coldstart node. Each coldstart node uses the startup frame to contribute its local clock as part of the shared network clock. that cluster already must contain coldstart nodes. The following scenarios apply to FlexRay startup frames: • Port to port: When you get started with your NI-XNET FlexRay hardware. the first step is to start the synchronized network clock. Because at least two coldstart nodes are required to start FlexRay communication. • • • NI-XNET Hardware and Software Manual 4-46 ni. Therefore. Test single ECU that is not coldstart: If you connect to a single ECU (and nothing else). and each NI-XNET interface must transmit a different startup frame. each NI-XNET interface must transmit a different startup frame. you can connect two FlexRay interfaces (ports) to run simple programs. the NI-XNET interface must transmit a startup frame. two or more hardware products are designated to transmit a special startup frame. you must connect two NI-XNET interfaces. a FlexRay network within a vehicle). These products (nodes) are called coldstart nodes. and therefore transmit a special startup frame.

Chapter 4 NI-XNET API for LabVIEW — Using LabVIEW Real-Time NI-XNET has two options to transmit a startup frame: • Key Slot Identifier: The NI-XNET session property node includes a property called Interface:FlexRay:Key Slot Identifier. and then write outputs. When selecting a startup frame. and the startup frame is not required in the session’s list of frames/signals. and the session’s list of frames/signals uses a startup frame. This property specifies the static slot that the session interface uses to transmit a startup frame. such as 500 µs (2 kHz). • To find startup frames in the database. Output Startup Frame: If you create an NI-XNET output session. High Priority Loops Many real-time applications contain at least one loop that must execute at the highest priority.vi provide fast and consistent execution time. or frame. The startup frame transmits automatically when the interface starts.vi and XNET Write. output. This applies to all four single-point modes: input. the session modes for single-point I/O are designed for use within high-priority loops. To ensure that the loop diagram executes within the period. the properties of each FlexRay frame specify the FlexRay data transfer timing. Within NI-XNET. the NI-XNET interface acts as a coldstart node. Understanding FlexRay Frame Timing When you use an NI-XNET database for FlexRay. XNET Read. and they avoid access to shared resources such as the memory manager. To understand how the FlexRay frame timing properties apply to NI-XNET sessions. refer to FlexRay Timing Type and Session Mode. © National Instruments Corporation 4-47 NI-XNET Hardware and Software Manual . The session can be input or output. the average execution time (cost) of read and write VIs must be low. You can use that frame name for an output session or use its identifier as the key slot. signal. and its payload is null (no data). This high-priority loop typically contains code to read inputs. avoid selecting one that the ECUs you connect to already transmit. NI-XNET provides features and performance specifically designed for LabVIEW RT. meaning that no startup frame transmits. enabling you to build real-time applications. execute a control algorithm. The execution time also must be consistent from one loop iteration to another (low jitter). The high-priority loop executes at a fast period. The property is zero by default. Using LabVIEW Real-Time The LabVIEW Real-Time (RT) module combines LabVIEW graphical programming with the power of a real-time operating system. If you set this property. look for a frame with the FlexRay:Startup? property true. the value specifies the static slot (identifier) to transmit as a coldstart node.

which can introduce jitter to the loop. measure the performance of your code within the loop to ensure that it meets your requirements even when bus traffic is variable. you must assume it is not designed for use within high priority loops. When using the queued modes. you must assign an alias to your database file. and that binary file is transferred to the target. When you open a VI front panel on an RT target.Chapter 4 NI-XNET API for LabVIEW — Using LabVIEW Real-Time The session modes other than single-point all use queues to store data. When you deploy to the RT target. NI-XNET Hardware and Software Manual 4-48 ni. This requires a variable amount of time to process the data.vi. each I/O name displays the text (target disconnected) in its drop-down list. If the RT target is disconnected in a LabVIEW project. the drop-down list of an XNET Interface provides all CAN and FlexRay interfaces on the RT target (for example. allocation of internal memory. When you use an XNET I/O name on a VI front panel on LabVIEW RT. those modes use a variable amount of data for each read/write. For another VI or property node (not XNET Read. When XNET Read. These tasks result in high cost for the first iteration compared to any subsequent iteration. discard the first iteration from the measurement. When you measure performance of XNET Read. and so on. and the user interface of I/O names is operational. the text database file is compressed to an optimized binary format. To connect the target. For example. Refer to the help for the specific features you want to use within a high priority loop.com . Nevertheless.vi and XNET Write. there are exceptions for which certain properties and VIs support high-priority use. The target shows a green LED in project. you must connect the LabVIEW RT target using a LabVIEW project.vi or XNET Write. The property nodes are designed for configuration purposes.vi and XNET Write. right-click the target in a LabVIEW project and select Connect.vi execute for the very first loop iteration.vi) require time for hardware/software configuration. VIs that change state (for example. a PXI chassis). XNET Start. they often perform tasks such as auto-start of the session. For the remote access to operate properly. XNET I/O Names You can use a LabVIEW project to program RT targets. Although you can use the queued session modes within a high priority loop. the remote access provides the user interface features of that I/O name. that front panel accesses the target remotely (over TCP/IP). Deploying Databases When you create an NI-XNET application for LabVIEW RT. This help may specify an exception.vi).

Because the length of time for each FlexRay cycle is a few milliseconds. There are two options for this deployment: • XNET I/O Names: If you are using I/O names for database objects. Create the real-time application by right-clicking Build Specifications under the RT target. You wire this timing source to a LabvIEW timed loop to execute LabVIEW code synchronized to the FlexRay cycle. which means it enables ECUs to synchronize code execution and data exchange. © National Instruments Corporation 4-49 NI-XNET Hardware and Software Manual . Deployment of databases for a real-time application is the same as running a VI. • To delete the database file from the RT target after execution of a test. NI-XNET automatically deploys the database file to the target. those sessions are deployed to the RT target in the same manner as running a VI. For example. you must read that frame every FlexRay cycle. This opens a dialog you can use to assign new aliases and deploy them to the RT target. you perform this undeploy using either option described above. When you create NI-XNET sessions at run time. LabVIEW RT provides the required real-time execution. NI-XNET provides XNET Create Timing Source (FlexRay Cycle). which you can set to run automatically when you power on the RT target. then run that VI. When you drag the session to a VI under the RT target. Browse for Database File).Chapter 4 NI-XNET API for LabVIEW — Using LabVIEW Real-Time When you create NI-XNET sessions using a LabVIEW project. you typically need to synchronize the LabVIEW VI to the FlexRay communication cycle. FlexRay Timing Source FlexRay is a deterministic protocol. If you created NI-XNET sessions in a LabVIEW project. use VIs in the NI-XNET File Management palette.vi to create a LabVIEW timing source. File Management Subpalette VIs: To manage database deployment from a VI running on the host (Windows computer). you can click on an I/O name and select Manage Database Deployment. When you use LabVIEW to test an ECU that uses these deterministic features. to validate that the ECU transmits a different value each FlexRay cycle. then selecting New»Real-Time Application. This palette includes VIs to add an alias and deploy the database to the RT target. you must explicitly deploy the database to the RT target. Creating a Built Real-Time Application NI-XNET supports creation of a real-time application. you assign the alias within the session dialog (for example.

For a complete description. XNET Session Constant This constant provides the constant form of the XNET Session I/O name. refer to XNET Session I/O Name.com .Chapter 4 NI-XNET API for LabVIEW — NI-XNET API for LabVIEW Reference NI-XNET API for LabVIEW Reference This section describes the NI-XNET LabVIEW APIs and properties. then select a session. prior to running the VI. You drag a constant to the block diagram of your VI. You can change constants only during configuration. NI-XNET Hardware and Software Manual 4-50 ni.

For more information about NI-XNET concepts and object classes.vi XNET Create Session (Frame Input Queued).vi Purpose Creates an XNET session to read/write data on the CAN or FlexRay network. refer to Appendix D.vi XNET Create Session (Signal Input Waveform).vi XNET Create Session (Generic). LabVIEW Project Provider. Run-time creation is useful when the session configuration must be selected using the front panel. refer to Interfaces. The instances of this polymorphic VI specify the session mode to create: • • • • • • • • • • • • • XNET Create Session (Signal Input Single-Point).vi XNET Create Session (Frame Input Single-Point).vi XNET Create Session (Signal Output XY). Description The XNET session specifies a relationship between National Instruments interface hardware and frames or signals to access on the external network (cluster).vi XNET Create Session. Use this VI to create a session at run time. The XNET session also specifies the input/output direction and how data is transferred between your application and the network.vi XNET Create Session (Signal Input XY).vi XNET Create Session (Frame Output Stream). and Sessions.vi XNET Create Session (Signal Output Single-Point).vi XNET Create Session (Signal Output Waveform).vi XNET Create Session (Frame Input Stream). If you prefer to create a session at edit time (static configuration).vi XNET Create Session (Frame Output Single-Point).Chapter 4 NI-XNET API for LabVIEW — XNET Create Session. Databases.vi: (This instance is used for advanced applications.) © National Instruments Corporation 4-51 NI-XNET Hardware and Software Manual . when you need to specify the configuration as strings.vi XNET Create Session (Frame Output Queued).

Your database specifies this frame. Outputs session out is the created session. NI-XNET Hardware and Software Manual 4-52 ni. This mode supports only one frame per session. Format Inputs frame is the XNET Frame to read.vi Purpose Creates an XNET session at run time for the Frame Input Queued Mode.vi XNET Create Session (Frame Input Queued). interface is the XNET Interface to use for this session. error out is the error cluster output (refer to Error Handling).Chapter 4 NI-XNET API for LabVIEW — XNET Create Session (Frame Input Queued). error in is the error cluster input (refer to Error Handling).com .

vi Purpose Creates an XNET session at run time for the Frame Input Single-Point Mode. Format Inputs frame list is the array of XNET Frames to read. Your database specifies these frames.Chapter 4 NI-XNET API for LabVIEW — XNET Create Session (Frame Input Single-Point). Outputs session out is the created session. error out is the error cluster output (refer to Error Handling). interface is the XNET Interface to use for this session. error in is the error cluster input (refer to Error Handling). © National Instruments Corporation 4-53 NI-XNET Hardware and Software Manual .vi XNET Create Session (Frame Input Single-Point).

vi Purpose Creates an XNET session at run time for the Frame Input Stream Mode. and the in-memory database is empty (XNET Database Create Object. meaning it does not configure or start the interface. you must set the XNET Session Interface:Baud Rate property using a Session node. although the file itself does not specify a CAN baud rate. For CANdb files. but that application does not specify a database. cluster. There are four options: • Empty in-memory database: cluster is unwired. The cluster within the FIBEX database file contains all required properties to configure the interface.vi XNET Create Session (Frame Input Stream). You must set the baud rate prior to starting the session. You also have a second application with which you want to log all received frames (input stream). The default value is :memory:. A subordinate session uses the cluster and interface configuration from other sessions. you may have a test application with which the end user specifies the database file.vi is not used). and signals to read/write. This is the most common option used with FlexRay. then wire from the Cluster node to this cluster. the in-memory database. After you create the session. Nonempty in-memory database: Call XNET Database Create Object. you provide this when you add an alias to the file within NI-XNET.com . Cluster within database file: cluster specifies a cluster within a database file.Chapter 4 NI-XNET API for LabVIEW — XNET Create Session (Frame Input Stream). For example.vi to create a cluster within the in-memory database. Subordinate: Wire in cluster of :subordinate:. This option is supported for CAN only (not FlexRay). You run this second application using a subordinate session. but depends on the primary • • • NI-XNET Hardware and Software Manual 4-54 ni. Format Inputs cluster is the XNET Cluster to use for interface configuration. use the XNET Cluster property node to set properties (such as baud rate).

error out is the error cluster output (refer to Error Handling).Chapter 4 NI-XNET API for LabVIEW — XNET Create Session (Frame Input Stream). For a subordinate session. error in is the error cluster input (refer to Error Handling). interface is the XNET Interface to use for this session. © National Instruments Corporation 4-55 NI-XNET Hardware and Software Manual . start and stop of the interface (using XNET Start. The subordinate session reads frames only when another nonsubordinate session starts the interface. Outputs session out is the created session.vi) is ignored.vi test application.

Your database specifies this frame. Outputs session out is the created session.vi XNET Create Session (Frame Output Queued). This mode supports only one frame per session.vi Purpose Creates an XNET session at run time for the Frame Output Queued Mode. error in is the error cluster input (refer to Error Handling). error out is the error cluster output (refer to Error Handling). interface is the XNET Interface to use for this session.Chapter 4 NI-XNET API for LabVIEW — XNET Create Session (Frame Output Queued). NI-XNET Hardware and Software Manual 4-56 ni. Format Inputs frame is the XNET Frame to write.com .

error out is the error cluster output (refer to Error Handling). Your database specifies these frames. interface is the XNET Interface to use for this session. © National Instruments Corporation 4-57 NI-XNET Hardware and Software Manual . Format Inputs frame list is the array of XNET Frames to write. error in is the error cluster input (refer to Error Handling).vi Purpose Creates an XNET session at run time for the Frame Output Single-Point Mode.vi XNET Create Session (Frame Output Single-Point). Outputs session out is the created session.Chapter 4 NI-XNET API for LabVIEW — XNET Create Session (Frame Output Single-Point).

The default value is :memory:. • • interface is the XNET Interface to use for this session.com .Chapter 4 NI-XNET API for LabVIEW — XNET Create Session (Frame Output Stream).vi Purpose Creates an XNET session at run time for the Frame Output Stream Mode. Cluster within database file: cluster specifies a cluster within a database file. you must set the XNET Session Interface:Baud Rate property using a Session node. For CANdb files. Outputs session out is the created session.vi is not used). NI-XNET Hardware and Software Manual 4-58 ni. You must set the CAN baud rate prior to starting the session. the in-memory database. use the Cluster node to set properties (such as baud rate). Nonempty in-memory database: Call XNET Database Create Object. error in is the error cluster input (refer to Error Handling). then wire from the Cluster node to this cluster. Format Inputs cluster is the XNET Cluster I/O Name to use for interface configuration.vi to create a cluster within the in-memory database. After you create the session.vi XNET Create Session (Frame Output Stream). Note This instance is supported for CAN only (not FlexRay). although the file itself does not specify a CAN baud rate. and the in-memory database is empty (XNET Database Create Object. you provide this when you add an alias to the file within NI-XNET. error out is the error cluster output (refer to Error Handling). There are three options: • Empty in-memory database: cluster is unwired.

list contains one or more XNET Signal names. Format Inputs list provides the list of signals or frames for the session. Each name must use the <signal> or <frame. a comma must separate each name.vi Purpose Creates an XNET session at run time using strings instead of XNET I/O Names.signal> syntax as specified for the I/O name (new line and <dbSelection> not included).Chapter 4 NI-XNET API for LabVIEW — XNET Create Session (Generic). Signal Output Waveform © National Instruments Corporation 4-59 NI-XNET Hardware and Software Manual . Each name must use the <signal> or <frame. This VI is for advanced applications. If more than one name is provided. Signal Input Waveform. If more than one name is provided. when you need to store the configuration as strings (such as within a text file). a comma must separate each name. Signal Output Single-Point list Syntax list contains one or more XNET Signal names.vi XNET Create Session (Generic).signal> syntax as specified for the I/O name (new line and <dbSelection> not included). The list syntax depends on the mode: Mode Signal Input Single-Point.

com . Outputs session out is the created session. Frame Output Stream Frame Input Queued. Frame Output Queued Frame Input Single-Point.vi Mode Signal Input XY. If more than one name is provided. list contains one or more XNET Frame names. The database name must use the <alias> or <filepath> syntax specified for the I/O name. a comma must separate each name. error in is the error cluster input (refer to Error Handling). a comma must separate each name.signal> syntax as specified for the I/O name (new line and <dbSelection> not included). The default value is :memory:. mode is the session mode. NI-XNET Hardware and Software Manual 4-60 ni.Chapter 4 NI-XNET API for LabVIEW — XNET Create Session (Generic). The frame name must use the <frame> syntax as specified for the I/O name (new line and <dbSelection> not included). prefix not included). cluster is the XNET Cluster to use for interface configuration. Frame Input Stream. list is empty (unwired). interface is the XNET Interface to use for this session. The frame name must use the <frame> syntax as specified for the I/O name (new line and <dbSelection> not included). database is the XNET Database to use for interface configuration. Each name must use the <signal> or <frame. If more than one name is provided. Only one name is supported. Signal Output XY list Syntax list contains one or more XNET Signal names. The cluster name must use the <cluster> syntax specified for the I/O name (<alias>. error out is the error cluster output (refer to Error Handling). Frame Output Single-Point list contains only one XNET Frame name. the in-memory database.

error out is the error cluster output (refer to Error Handling).Chapter 4 NI-XNET API for LabVIEW — XNET Create Session (Signal Input Single-Point).vi Purpose Creates an XNET session at run time for the Signal Input Single-Point Mode. © National Instruments Corporation 4-61 NI-XNET Hardware and Software Manual . Format Inputs signal list is the array of XNET Signals to read. Outputs session out is the created session.vi XNET Create Session (Signal Input Single-Point). These signals are specified in your database and describe the values encoded in one or more frames. interface is the XNET Interface to use for this session. error in is the error cluster input (refer to Error Handling).

interface is the XNET Interface to use for this session.com . NI-XNET Hardware and Software Manual 4-62 ni. Format Inputs signal list is the array of XNET Signals to read. Outputs session out is the created session. These signals are specified in your database and describe the values encoded in one or more frames. error out is the error cluster output (refer to Error Handling).vi XNET Create Session (Signal Input Waveform). error in is the error cluster input (refer to Error Handling).Chapter 4 NI-XNET API for LabVIEW — XNET Create Session (Signal Input Waveform).vi Purpose Creates an XNET session at run time for the Signal Input Waveform Mode.

Chapter 4 NI-XNET API for LabVIEW — XNET Create Session (Signal Input XY).vi Purpose Creates an XNET session at run time for the Signal Input XY Mode.vi XNET Create Session (Signal Input XY). Format Inputs signal list is the array of XNET Signals to read. These signals are specified in your database and describe the values encoded in one or more frames. error in is the error cluster input (refer to Error Handling). © National Instruments Corporation 4-63 NI-XNET Hardware and Software Manual . interface is the XNET Interface to use for this session. Outputs session out is the created session. error out is the error cluster output (refer to Error Handling).

interface is the XNET Interface to use for this session.vi XNET Create Session (Signal Output Single-Point).vi Purpose Creates an XNET session at run time for the Signal Output Single-Point Mode. Outputs session out is the created session. These signals are specified in your database and describe the values encoded in one or more frames. error in is the error cluster input (refer to Error Handling). Format Inputs signal list is the array of XNET Signals to write. error out is the error cluster output (refer to Error Handling).com .Chapter 4 NI-XNET API for LabVIEW — XNET Create Session (Signal Output Single-Point). NI-XNET Hardware and Software Manual 4-64 ni.

vi XNET Create Session (Signal Output Waveform).vi Purpose Creates an XNET session at run time for the Signal Output Waveform Mode. Format Inputs signal list is the array of XNET Signals to write.Chapter 4 NI-XNET API for LabVIEW — XNET Create Session (Signal Output Waveform). © National Instruments Corporation 4-65 NI-XNET Hardware and Software Manual . Outputs session out is the created session. error in is the error cluster input (refer to Error Handling). interface is the XNET Interface to use for this session. error out is the error cluster output (refer to Error Handling). These signals are specified in your database and describe the values encoded in one or more frames.

error in is the error cluster input (refer to Error Handling). NI-XNET Hardware and Software Manual 4-66 ni. Outputs session out is the created session. These signals are specified in your database and describe the values encoded in one or more frames.vi XNET Create Session (Signal Output XY).com . error out is the error cluster output (refer to Error Handling). interface is the XNET Interface to use for this session. Format Inputs signal list is the array of XNET Signals to write.vi Purpose Creates an XNET session at run time for the Signal Output XY Mode.Chapter 4 NI-XNET API for LabVIEW — XNET Create Session (Signal Output XY).

Pull down this node to add properties. For help on a specific property. open the main LabVIEW help (select Search the LabVIEW Help from the Help menu) and look for the Property Nodes topic in the index. open the LabVIEW context help window (<Ctrl-H>) and move your cursor over the property name.Chapter 4 NI-XNET API for LabVIEW — XNET Session Property Node XNET Session Property Node Format Description Property node used to read/write properties for an XNET Session I/O Name. © National Instruments Corporation 4-67 NI-XNET Hardware and Software Manual . Right-click to change direction between read and write. or indicator. control. Right-click each property name to create a constant. For more information about LabVIEW property nodes.

the interface can transmit CAN frames and acknowledge received CAN frames. When this property is true.LstnOnly? Description Note You can modify this property only when the interface is stopped. which can be useful for debugging scenarios when you do not want to interfere with a communicating network cluster.CAN. When this property is false. CAN Interface Properties This category includes CAN-specific interface properties.com .Chapter 4 NI-XNET API for LabVIEW — Interface Properties Interface Properties Properties in the Interface category apply to the interface and not the session. changing an interface property affects all the sessions. Interface:CAN:Listen Only? Data Type Direction Read/Write Required? Default No False Property Class XNET Session Short Name Intf. NI-XNET Hardware and Software Manual 4-68 ni. The Listen Only? property configures whether the CAN interface transmits any information to the CAN bus. the interface can neither transmit CAN frames nor acknowledge a received CAN frame. If more than one session exists for the interface. The true value enables passive monitoring of network traffic.

Chapter 4 NI-XNET API for LabVIEW — Interface Properties Interface:CAN:Single Shot Transmit? Data Type Direction Read/Write Required? Default No False Property Class XNET Session Short Name Intf. When this property is true. The Single Shot Transmit? property configures whether the CAN interface retries failed transmissions.11 Automatic Retransmission). This retransmit process continues until the frame is successfully transmitted.CAN. the interface attempts to retransmit the frame as soon as the bus is idle again. If a CAN frame is not transmitted successfully. If a CAN frame is not transmitted successfully. failed transmissions do not retry. 6.SingShot? Description Note You can modify this property only when the interface is stopped. © National Instruments Corporation 4-69 NI-XNET Hardware and Software Manual . failed transmissions retry as specified by the CAN protocol (ISO 11898–1. no further transmissions are attempted. When this property is false.

The enumeration is generic and supports two values: Off and On.Chapter 4 NI-XNET API for LabVIEW — Interface Properties Interface:CAN:Termination Data Type Direction Read/Write Required? Default No Off (0) Property Class XNET Session Short Name Intf.Term Description The Termination property configures the onboard termination of the NI-XNET interface CAN connector (port). NI-XNET allows you to configure termination within the node to simplify testing. However. Termination (120 Ω) is enabled.11 kΩ option.com . you should select the default 1. as described below. leave this property in the default state of Off. Value Off On Meaning Disabled Enabled Description Termination is disabled. In general. and the Off and On values have different meanings. NI-XNET Hardware and Software Manual 4-70 ni. if you require termination. Refer to Termination for more information about low-speed termination. High-Speed CAN High-Speed CAN networks are typically terminated on the bus itself instead of within a node. different CAN hardware has different termination requirements. if the existing network has an overall network termination of 125 Ω or less. However. If your bus already has the correct amount of termination.CAN. This configuration allows the Low-Speed/Fault-Tolerant CAN port to provide fault detection and recovery. Otherwise. turn on termination to enable the 4. set this property to On. However. Low-Speed/Fault-Tolerant CAN Every node on a Low-Speed CAN network requires termination for each CAN data line (CAN_H and CAN_L).99 kΩ option.

11 kΩ 4.99 kΩ Description Termination is set to 1. and no additional configuration is supported. Single-Wire CAN The ISO standard requires Single-Wire transceivers to have a 9.11 kΩ.99 kΩ. Termination is set to 4.Chapter 4 NI-XNET API for LabVIEW — Interface Properties Value Off On Meaning 1.09 kΩ resistor. © National Instruments Corporation 4-71 NI-XNET Hardware and Software Manual .

NI-XNET Hardware and Software Manual 4-72 ni. Sleep This state sets the transceiver and CAN controller chip to Sleep (or standby) mode. setting the transceiver to Sleep mode returns an error.com . this performs a local wakeup of the transceiver and CAN controller chip. If the transceiver is in the Sleep mode. The following table lists the accepted values. The transceiver and CAN controller wake from Sleep mode when either a local wakeup or remote wakeup occurs. as well as configuring other special modes.Chapter 4 NI-XNET API for LabVIEW — Interface Properties Interface:CAN:Transceiver State Data Type Direction Read/Write Required? Default No Normal (0) Property Class XNET Session Short Name Intf. further communication is not possible until a wakeup occurs.CAN. Enumeration Normal Sleep Single Wire Wakeup Single Wire High-Speed Value 0 1 2 3 Normal This state sets the transceiver to normal communication mode.TcvrState Description The Transceiver State property configures the CAN transceiver and CAN controller modes. If the interface has not been started. Once all pending frames have been transmitted. You can set the interface to Sleep mode only while the interface is communicating. Once the interface enters Sleep mode. all pending transmissions are transmitted onto the CAN bus. Before going to sleep. the interface and transceiver go into Sleep (or standby) mode. The transceiver state controls whether the transceiver is asleep or communicating.

setting this mode returns an error because you are not allowed to wake up the bus in high-speed mode. Single Wire High-Speed This state sets a Single Wire transceiver into Single Wire High-Speed Communication mode. If you are not using a Single Wire transceiver. allowing the SAE J2411 High Speed baud rate of 83. Single Wire High-Speed Communication mode disables the transceiver’s internal waveshaping function. is degraded EMC performance. You can use XNET Read (State CAN Comm). Single Wire Wakeup For a remote wakeup to occur for Single Wire transceivers. To suspend the application while waiting for the remote wakeup. The CAN controller chip does not receive or acknowledge the wakeup frame. © National Instruments Corporation 4-73 NI-XNET Hardware and Software Manual . the CAN interface enters Normal mode. the node that transmits the wakeup frame first must place the network into the Single Wire Wakeup Transmission mode by asserting a higher voltage.333 kbytes/s. If your current mode is Single Wire High-Speed.333 kbytes/s to be used. When the local or remote wakeup occurs. Other than the disabled waveshaping. setting this state returns an error. A remote wakeup occurs when a remote node transmits a CAN frame (referred to as the wakeup frame). use XNET Wait (CAN Remote Wakeup). frame transmissions resume from the point at which the original Sleep mode was set. Other than this higher voltage. this mode is similar to Normal mode. which forces the Single Wire transceiver to drive a higher voltage level on the network to wake up all sleeping nodes. If you are not using a Single Wire transceiver. which only allows the SAE J2411 baud rate of 33. transmits a single wakeup frame. After detecting the wakeup frame and idle bus.vi to detect when a wakeup occurs.Chapter 4 NI-XNET API for LabVIEW — Interface Properties A local wakeup occurs when the application sets the transceiver state to either Normal or Single Wire Wakeup. The application typically changes to Single Wire Wakeup mode. CAN frames can be received and transmitted normally. The disadvantage versus Single Wire Normal Communication mode. This state sets a Single Wire transceiver into the Single Wire Wakeup Transmission mode. and then returns to Normal mode. CAN frames can be received and transmitted normally. The application controls the timing of how long the wakeup voltage is driven. this mode is similar to Normal mode.vi. The wakeup frame wakes up the NI-XNET interface transceiver and CAN controller chip. setting this state returns an error.

setting the mode to Sleep from Single Wire High-Speed mode returns an error. It is merely a higher speed mode of the Single Wire transceiver. Therefore. NI-XNET Hardware and Software Manual 4-74 ni. typically used to download data when the onboard network is attached to an offboard tester ECU. For example. a remote wakeup cannot transition from sleep to this Single Wire High-Speed mode. The Single Wire transceiver does not support use of this mode in conjunction with Sleep mode.com .Chapter 4 NI-XNET API for LabVIEW — Interface Properties This mode has no relationship to High-Speed transceivers.

Low-Speed (1) for Low-Speed Hardware Property Class XNET Session Short Name Intf. If you have fixed-personality hardware. You also can use this property to determine the currently configured transceiver type. If you have hardware that supports software-selectable transceivers. The following table lists the accepted values: Enumeration High-Speed (HS) Low-Speed (LS) Single Wire (SW) Value 0 1 2 The default value for this property depends on your type of hardware.Transceiver Capability property to determine whether your hardware supports a software-selectable transceiver. the default is High-Speed.CAN. the default value is the hardware value. the Transceiver Type property allows you to set the transceiver type. Use the XNET Interface CAN.Chapter 4 NI-XNET API for LabVIEW — Interface Properties Interface:CAN:Transceiver Type Data Type Direction Read/Write Required? Default No High-Speed (0) for High-Speed and XS Hardware. © National Instruments Corporation 4-75 NI-XNET Hardware and Software Manual .TcvrType Description Notes You can modify this property only when the interface is stopped. This property does not take effect until the interface is started. For XNET hardware that provides a software-selectable transceiver.

333 kbaud.com .333 kbaud and 83.Chapter 4 NI-XNET API for LabVIEW — Interface Properties This attribute uses the following values: High-Speed This configuration enables the High-Speed transceiver. This transceiver supports baud rates of 33. This transceiver supports baud rates of 40 kbaud to 1 Mbaud. Single Wire This configuration enables the Single Wire transceiver. This transceiver supports baud rates of 40–125 kbaud. NI-XNET Hardware and Software Manual 4-76 ni. Low-Speed/Fault-Tolerant This configuration enables the Low-Speed/Fault-Tolerant transceiver.

Note Changing the interface properties can affect the integration and communication of the XNET FlexRay interface with the cluster. the constraints use cluster settings and knowledge of the oscillator that the FlexRay interface uses. © National Instruments Corporation 4-77 NI-XNET Hardware and Software Manual .Chapter 4 NI-XNET API for LabVIEW — Interface Properties FlexRay Interface Properties These properties are calculated based on constraints in the FlexRay Protocol Specification. you can use the XNET property node to change these settings. the XNET driver automatically calculates these properties.FlexRay. and they are passed down to the hardware. The range for this property is 0–1875 MT. This property corresponds to the pdAcceptedStartupRange node parameter in the FlexRay Protocol Specification. Interface:FlexRay:Accepted Startup Range Data Type Direction Read/Write Required? Default No Calculated from Cluster Settings Property Class XNET Session Short Name Intf. You can overwrite the default value by writing a value within the specified range to this property prior to starting the FlexRay interface (refer to Session States for more information). At Create Session time. However. To calculate these properties.AccStartRng Description Range of measure clock deviation allowed for startup frames during node integration.

Refer to XNET Read (State FlexRay Comm).Chapter 4 NI-XNET API for LabVIEW — Interface Properties Interface:FlexRay:Allow Halt Due To Clock? Data Type Direction Read/Write Required? Default No False Property Class XNET Session Short Name Intf. the node can transition to the POC: halt state. NI-XNET Hardware and Software Manual 4-78 ni. If set to true. the node does not transition to the POC: halt state and remains in the POC: normal passive state. If set to false. The default value of this property is false. This property corresponds to the pAllowHaltDueToClock node parameter in the FlexRay Protocol Specification.FlexRay.com . The property is a Boolean flag. You can overwrite the default value by writing a value within the specified range to this property prior to starting the FlexRay interface (refer to Session States for more information).vi for more information about the POC: halt and POC: normal passive states. allowing for self recovery.AlwHltClk? Description Controls the FlexRay interface transition to the POC: halt state due to clock synchronization errors.

the node cannot transition from POC: normal-passive to POC: normal-active. You can overwrite the default value by writing a value within the specified range to this property prior to starting the FlexRay interface (refer to Session States for more information). © National Instruments Corporation 4-79 NI-XNET Hardware and Software Manual .vi for more information about the POC: normal-active and POC: normal-passive states. Refer to XNET Read (State FlexRay Comm).AlwPassAct Description Number of consecutive even/odd cycle pairs that must have valid clock correction terms before the FlexRay node can transition from the POC: normal-passive to the POC: normal-active state. with values of 0–31. The property is expressed as the number of even/odd cycle pairs. This property corresponds to the pAllowPassiveToActive node parameter in the FlexRay Protocol Specification.Chapter 4 NI-XNET API for LabVIEW — Interface Properties Interface:FlexRay:Allow Passive to Active Data Type Direction Read/Write Required? Default No 0 Property Class XNET Session Short Name Intf. If set to zero. The default value of this property is zero.FlexRay.

ClstDriftDmp Description Local cluster drift damping factor used for rate correction.Chapter 4 NI-XNET API for LabVIEW — Interface Properties Interface:FlexRay:Cluster Drift Damping Data Type Direction Read/Write Required? Default No Calculated from Cluster Settings Property Class XNET Session Short Name Intf.com . NI-XNET Hardware and Software Manual 4-80 ni.FlexRay. The range for the property is 0–20 MT. This property corresponds to the pAllowPassiveToActive node parameter in the FlexRay Protocol Specification. The cluster drift damping property should be configured in such a way that the damping values in all nodes within the same cluster have approximately the same duration. You can overwrite the default value by writing a value within the specified range to this property prior to starting the FlexRay interface (refer to Session States for more information).

The default value of this property is false. and the Coldstart? property is true.FlexRay.Coldstart? Description This property specifies whether the FlexRay interface operates as a coldstart node on the cluster. and this property is false. the XNET FlexRay interface transmits a startup frame from that slot. the XNET FlexRay interface does not act as a coldstart node. This property returns a Boolean flag (true/false). If the KeySlot Identifier is 0 (invalid slot identifier). This property is read only and calculated from the XNET Session Interface:FlexRay:Key Slot Identifier property. © National Instruments Corporation 4-81 NI-XNET Hardware and Software Manual .Chapter 4 NI-XNET API for LabVIEW — Interface Properties Interface:FlexRay:Coldstart? Data Type Direction Read Required? Default No False Property Class XNET Session Short Name Intf. If the KeySlot Identifier is 1 or more.

FlexRay. This property corresponds to the pDecodingCorrection node parameter in the FlexRay Protocol Specification. The range for the property is 14–143 MT. You can overwrite the default value by writing a value within the specified range to this property prior to starting the FlexRay interface (refer to Session States for more information).DecCorr Description This property specifies the value that the receiving FlexRay node uses to calculate the difference between the primary time reference point and secondary reference point. The clock synchronization algorithm uses the primary time reference and the sync frame’s expected arrival time to calculate and compensate for the node’s local clock deviation.com .Chapter 4 NI-XNET API for LabVIEW — Interface Properties Interface:FlexRay:Decoding Correction Data Type Direction Read/Write Required? Default No Calculated from Cluster Settings Property Class XNET Session Short Name Intf. NI-XNET Hardware and Software Manual 4-82 ni.

This property corresponds to the pDelayCompensation[A] node parameter in the FlexRay Protocol Specification.05 range.Chapter 4 NI-XNET API for LabVIEW — Interface Properties Interface:FlexRay:Delay Compensation Ch A Data Type Direction Read/Write Required? Default No Calculated from Cluster Settings Property Class XNET Session Short Name Intf. This takes into account the assumed propagation delay up to the maximum allowed propagation delay (cPropagationDelayMax) for microticks in the 0.FlexRay. You can overwrite the default value by writing a value within the specified range to this property prior to starting the FlexRay interface (refer to Session States for more information).0125–0. In practice. © National Instruments Corporation 4-83 NI-XNET Hardware and Software Manual .DelayCompA Description This property specifies the value that the XNET FlexRay interface (node) uses to compensate for reception delays on channel A. The property range is 0–200 MT. you should apply the minimum of the propagation delays of all sync nodes.

Chapter 4 NI-XNET API for LabVIEW — Interface Properties Interface:FlexRay:Delay Compensation Ch B Data Type Direction Read/Write Required? Default No Calculated from Cluster Settings Property Class XNET Session Short Name Intf. you should apply the minimum of the propagation delays of all sync nodes. The property range is 0–200 MT.DelayCompB Description This property specifies the value that the XNET FlexRay interface (node) uses to compensate for reception delays on channel B.com .0125–0.FlexRay. You can overwrite the default value by writing a value within the specified range to this property prior to starting the FlexRay interface (refer to Session States for more information). NI-XNET Hardware and Software Manual 4-84 ni.05 range. This property corresponds to the pDelayCompensation[B] node parameter in the FlexRay Protocol Specification. This takes into account the assumed propagation delay up to the maximum allowed propagation delay (Propagation Delay Max) for microticks in the 0. In practice.

the data you write to the session transmits in the frame. There are two methods for configuring the XNET FlexRay interface as a coldstart node (transmit startup frame). this Key Slot Identifier property contains the identifier property of that startup frame. If the one external ECU does not transmit a startup frame itself. the interface transmits a null frame for startup purposes. If you do not create an output session that contains the startup frame. with the same identifier as that specified in the Key Slot Identifier property. at least two nodes must transmit startup frames. Note If you create an output session that contains the startup frame. If you use this method.FlexRay. The XNET Frame FlexRay:Startup? property is true for a startup frame. during the process of integration with other cluster nodes.KeySlotID Description This property specifies the FlexRay slot number from which the XNET FlexRay interface transmits a startup frame. © National Instruments Corporation 4-85 NI-XNET Hardware and Software Manual . you must use two XNET FlexRay interfaces for the test. an error is returned. For a network (cluster) of FlexRay nodes to start up for communication. If you create an output session that contains a startup frame with an identifier that does not match the Key Slot Identifier property. You do not write this property.Chapter 4 NI-XNET API for LabVIEW — Interface Properties Interface:FlexRay:Key Slot Identifier Data Type Direction Read/Write Required? Default No 0 Property Class XNET Session Short Name Intf. Write this Key Slot Identifier Property This interface uses the identifier (slot) you write to transmit a startup frame using that slot. each of which must transmit a startup frame. you must configure the XNET FlexRay interface to transmit a startup frame. Output Session with Startup Frame Create an output session that contains a startup frame (or one of its signals). If your application is designed to test only one external ECU.

NI-XNET Hardware and Software Manual 4-86 ni.com . You can overwrite the default value by writing an identifier that corresponds to the identifier of a startup frame prior to starting the FlexRay interface (refer to Session States for more information).Chapter 4 NI-XNET API for LabVIEW — Interface Properties The default value of this property is 0 (no startup frame).

This is a read-only property. This property corresponds to the pLatestTx node parameter in the FlexRay Protocol Specification. This property can be read any time prior to closing the FlexRay interface. The range of values for this property is 0–7981 minislots. © National Instruments Corporation 4-87 NI-XNET Hardware and Software Manual .Chapter 4 NI-XNET API for LabVIEW — Interface Properties Interface:FlexRay:Latest Tx Data Type Direction Read Required? Default No 0 Property Class XNET Session Short Name Intf.LatestTx Description This property specifies the number of the last minislot in which a frame transmission can start in the dynamic segment. as the FlexRay controller evaluates it based on the configuration of the frames in the dynamic segment.FlexRay.

You can overwrite the default value by writing a value within the specified range to this property prior to starting the FlexRay interface (refer to Session States for more information).Chapter 4 NI-XNET API for LabVIEW — Interface Properties Interface:FlexRay:Listen Timeout Data Type Direction Read/Write Required? Default No Calculated from Cluster Settings Property Class XNET Session Short Name Intf.FlexRay. Refer to Summary of the FlexRay Standard for more information about startup and wakeup procedures within the FlexRay protocol. The range of values for this property is 1284–1283846 MT.com . NI-XNET Hardware and Software Manual 4-88 ni.ListTimo Description This property specifies the upper limit for the startup listen timeout and wakeup listen timeout. This property corresponds to the pdListenTimeout node parameter in the FlexRay Protocol Specification.

You can overwrite the default value by writing a value within the specified range to this property prior to starting the FlexRay interface (refer to Session States for more information).Chapter 4 NI-XNET API for LabVIEW — Interface Properties Interface:FlexRay:Macro Initial Offset Ch A Data Type Direction Read/Write Required? Default No Calculated from Cluster Settings Property Class XNET Session Short Name Intf.MacInitOffA Description This property specifies the integer number of macroticks between the static slot boundary and the following macrotick boundary of the secondary time reference point based on the nominal macrotick duration. The range of values for this property is 2–72 MT.FlexRay. This property corresponds to the pMacroInitialOffset[A] node parameter in the FlexRay Protocol Specification. This property applies only to Channel A. © National Instruments Corporation 4-89 NI-XNET Hardware and Software Manual .

Chapter 4 NI-XNET API for LabVIEW — Interface Properties Interface:FlexRay:Macro Initial Offset Ch B Data Type Direction Read/Write Required? Default No Calculated from Cluster Settings Property Class XNET Session Short Name Intf.com . You can overwrite the default value by writing a value within the specified range to this property prior to starting the FlexRay interface (refer to Session States for more information).FlexRay. NI-XNET Hardware and Software Manual 4-90 ni. This property applies only to Channel B. This property corresponds to the pMacroInitialOffset[B] node parameter in the FlexRay Protocol Specification.MacInitOffB Description This property specifies the integer number of macroticks between the static slot boundary and the following macrotick boundary of the secondary time reference point based on the nominal macrotick duration. The range of values for this property is 2–72 MT.

This property corresponds to the pdMaxDrift node parameter in the FlexRay Protocol Specification. © National Instruments Corporation 4-91 NI-XNET Hardware and Software Manual .FlexRay. You can overwrite the default value by writing a value within the specified range to this property prior to starting the FlexRay interface (refer to Session States for more information). The range of values for this property is 2–1923 MT.Chapter 4 NI-XNET API for LabVIEW — Interface Properties Interface:FlexRay:Max Drift Data Type Direction Read/Write Required? Default No Calculated from Cluster Settings Property Class XNET Session Short Name Intf.MaxDrift Description This property specifies the maximum drift offset between two nodes that operate with unsynchronized clocks over one communication cycle.

MicInitOffA Description This property specifies the number of microticks between the closest macrotick boundary described by the Macro Initial Offset Ch A property and the secondary time reference point.Chapter 4 NI-XNET API for LabVIEW — Interface Properties Interface:FlexRay:Micro Initial Offset Ch A Data Type Direction Read/Write Required? Default No Calculated from Cluster Settings Property Class XNET Session Short Name Intf. You can overwrite the default value by writing a value within the specified range to this property prior to starting the FlexRay interface (refer to Session States for more information). NI-XNET Hardware and Software Manual 4-92 ni. This property corresponds to the pMicroInitialOffset[A] node parameter in the FlexRay Protocol Specification.FlexRay. The range of values for this property is 0–240 MT.com . This parameter depends on the Delay Compensation property for Channel A. and therefore you must set it independently for each channel.

The range of values for this property is 0–240 MT. This property corresponds to the pMicroInitialOffset[B] node parameter in the FlexRay Protocol Specification.MicInitOffB Description This property specifies the number of microticks between the closest macrotick boundary described by the Macro Initial Offset Ch B property and the secondary time reference point.Chapter 4 NI-XNET API for LabVIEW — Interface Properties Interface:FlexRay:Micro Initial Offset Ch B Data Type Direction Read/Write Required? Default No Calculated from Cluster Settings Property Class XNET Session Short Name Intf. © National Instruments Corporation 4-93 NI-XNET Hardware and Software Manual . You can overwrite the default value by writing a value within the specified range to this property prior to starting the FlexRay interface (refer to Session States for more information). and therefore you must set it independently for each channel.FlexRay. This parameter depends on the Delay Compensation property for Channel B.

This property is calculated based on the product of the Samples per Microtick interface property and the BaudRate cluster.Chapter 4 NI-XNET API for LabVIEW — Interface Properties Interface:FlexRay:Microtick Data Type Direction Read Required? Default No Calculated from Cluster Settings Property Class XNET Session Short Name Intf. This is a read-only property. NI-XNET Hardware and Software Manual 4-94 ni.Microtick Description This property specifies the duration of a microtick.FlexRay. This property can be read any time prior to closing the FlexRay interface.com . This property corresponds to the pdMicrotick node parameter in the FlexRay Protocol Specification.

vi returns all FlexRay null frames that are received by the interface. XNET Read.FlexRay. which never return FlexRay null frames from XNET Read.vi instance of XNET Read.vi. When this property uses the default value of false. regardless of whether new payload is available or not. This behavior is consistent with the other two frame input modes (Frame Input Single-Point Mode and Frame Input Queued Mode).NullToInStrm? Description This property indicates whether the Frame Input Stream Mode session should return FlexRay null frames from XNET Read.vi. You can overwrite the default value prior to starting the FlexRay interface (refer to Session States for more information). each frame’s type field indicates a null frame. This feature is used to monitor all frames that occur on the network. FlexRay null frames are not returned for a Frame Input Stream Mode session. When you set this property to true for a Frame Input Stream Mode session. When you use XNET Read (Frame FlexRay).vi.Chapter 4 NI-XNET API for LabVIEW — Interface Properties Interface:FlexRay:Null Frames To Input Stream? Data Type Direction Read/Write Required? Default No False Property Class XNET Session Short Name Intf. © National Instruments Corporation 4-95 NI-XNET Hardware and Software Manual .

com . The offset correction synchronizes the cycle start time. but the correction is applied only at the end of odd cycles. to synchronize the interface to the FlexRay network. This is a read-only property. expressed in microticks. This property can be read anytime prior to closing the FlexRay interface. NI-XNET Hardware and Software Manual 4-96 ni.Chapter 4 NI-XNET API for LabVIEW — Interface Properties Interface:FlexRay:Offset Correction Data Type Direction Read Required? Default No N/A Property Class XNET Session Short Name Intf. The value indicates the number of microticks added or subtracted to the offset correction portion of the network idle time. The offset correction value calculation takes place every cycle.OffCorr Description This property provides the maximum permissible offset correction value.FlexRay. The value is returned as a signed 32-bit integer (I32).

Chapter 4 NI-XNET API for LabVIEW — Interface Properties Interface:FlexRay:Offset Correction Out Data Type Direction Read/Write Required? Default No Calculated from Cluster Settings Property Class XNET Session Short Name Intf. © National Instruments Corporation 4-97 NI-XNET Hardware and Software Manual . This node parameter is based on the value of the maximum offset correction for the specific cluster. You can overwrite the default value by writing a value within the specified range to this property prior to starting the FlexRay interface (refer to Session States for more information). The value range for this property is 5–15266 MT.FlexRay.OffCorrOut Description This property specifies the magnitude of the maximum permissible offset correction value. This property corresponds to the pOffsetCorrectionOut node parameter in the FlexRay Protocol Specification.

The rate correction value calculation takes place in the static segment of an odd cycle. based on values measured in an even-odd double cycle. The value is returned as a signed 32-bit integer (I32). The value indicates the number of microticks added to or subtracted from the configured number of microticks in a cycle. to synchronize the interface to the FlexRay network. This property can be read prior to closing the FlexRay interface. The rate correction synchronizes frequency.RateCorr Description Read-only property that provides the rate correction value.com . expressed in microticks.Chapter 4 NI-XNET API for LabVIEW — Interface Properties Interface:FlexRay:Rate Correction Data Type Direction Read Required? Default No N/A Property Class XNET Session Short Name Intf.FlexRay. NI-XNET Hardware and Software Manual 4-98 ni.

Chapter 4 NI-XNET API for LabVIEW — Interface Properties Interface:FlexRay:Rate Correction Out Data Type Direction Read/Write Required? Default No Calculated from Cluster Settings Property Class XNET Session Short Name Intf. This property corresponds to the pRateCorrectionOut node parameter in the FlexRay Protocol Specification.RateCorrOut Description This property specifies the magnitude of the maximum permissible rate correction value. This node parameter is based on the value of the maximum rate correction for the specific cluster. This property is calculated from the microticks per cycle and clock accuracy. © National Instruments Corporation 4-99 NI-XNET Hardware and Software Manual . The range of values for this property is 2–1923 MT.FlexRay. You can overwrite the default value by writing a value within the specified range to this property prior to starting the FlexRay interface (refer to Session States for more information).

Chapter 4 NI-XNET API for LabVIEW — Interface Properties Interface:FlexRay:Samples Per Microtick Data Type Direction Read/Write Required? Default No Calculated from Cluster Settings Property Class XNET Session Short Name Intf. a microtick consists of an integral number of samples. Specifically. You can overwrite the default value by writing a value within the specified range to this property prior to starting the FlexRay interface (refer to Session States for more information). There is a defined relationship between the “ticks” of the microtick timebase and the sample ticks of bit sampling. 2. and 4 samples. This property corresponds to the pSamplesPerMicrotick node parameter in the FlexRay Protocol Specification.com . there is a fixed phase relationship between the microtick timebase and the sample clock ticks.FlexRay. As a result. The supported values for this property are 1. NI-XNET Hardware and Software Manual 4-100 ni.SampPerMicro Description This property specifies the number of samples per microtick.

Chapter 4 NI-XNET API for LabVIEW — Interface Properties Interface:FlexRay:Single Slot Enabled? Data Type Direction Read/Write Required? Default No False Property Class XNET Session Short Name Intf. This property corresponds to the pSingleSlotEnabled node parameter in the FlexRay Protocol Specification.FlexRay. After the interface is communicating. all configured output frames transmit. If you leave this property false prior to start (default). only the key slot transmits. © National Instruments Corporation 4-101 NI-XNET Hardware and Software Manual .SingSlotEn Description This property serves as a flag to indicate whether the FlexRay interface (node) should enter single slot mode following startup. You can overwrite the default value prior to starting the FlexRay interface (refer to Session States for more information). you cannot set this property from false to true. you can set this property to false at runtime to enable the remaining transmissions (the protocol’s ALL_SLOTS command). If you set this property to true prior to start. This Boolean property supports a strategy to limit frame transmissions following startup to a single frame (designated by the XNET Session Interface:FlexRay:Key Slot Identifier property). After the interface is communicating (integrated).

calls to XNET Read (State FlexRay Statistics). You can overwrite the default value prior to starting the FlexRay interface (refer to Session States for more information). To enable FlexRay statistics.StatisticsEn? Description This XNET Boolean property enables reporting FlexRay error statistics. NI-XNET Hardware and Software Manual 4-102 ni. When this property is false (default).com .Chapter 4 NI-XNET API for LabVIEW — Interface Properties Interface:FlexRay:Statistics Enabled? Data Type Direction Read/Write Required? Default No False Property Class XNET Session Short Name Intf.vi always return zero for each statistic.FlexRay. set this property to true in your application.

this returns an empty array. for more information about the FlexRay protocol startup procedure. This read-only property returns an array in which each element holds the slot ID of a sync frame.FlexRay. If the interface is not started.SyncChAEven Description This property returns an array of sync frames (slot IDs) transmitted or received on channel A during the last even cycle. If you start the interface.Chapter 4 NI-XNET API for LabVIEW — Interface Properties Interface:FlexRay:Sync Frames Channel A Even Data Type Direction Read Required? Default No N/A Property Class XNET Session Short Name Intf. Refer to Appendix B. but it fails to communicate (integrate). this property may be helpful in diagnosing the problem. © National Instruments Corporation 4-103 NI-XNET Hardware and Software Manual . Summary of the FlexRay Standard. This property can be read any time prior to closing the FlexRay interface.

com . Summary of the FlexRay Standard. NI-XNET Hardware and Software Manual 4-104 ni. this property may be helpful in diagnosing the problem. This read-only property returns an array in which each element holds the slot ID of a sync frame. This property can be read any time prior to closing the FlexRay interface.SyncChAOdd Description This property returns an array of sync frames (slot IDs) transmitted or received on channel A during the last odd cycle. If you start the interface. but it fails to communicate (integrate). If the interface is not started.Chapter 4 NI-XNET API for LabVIEW — Interface Properties Interface:FlexRay:Sync Frames Channel A Odd Data Type Direction Read Required? Default No N/A Property Class XNET Session Short Name Intf.FlexRay. for more information about the FlexRay protocol startup procedure. Refer to Appendix B. this returns an empty array.

but it fails to communicate (integrate). If you start the interface.FlexRay. this property may be helpful in diagnosing the problem. Summary of the FlexRay Standard. this returns an empty array. Refer to Appendix B. If the interface is not started.SyncChBEven Description This property returns an array of sync frames (slot IDs) transmitted or received on channel B during the last even cycle. © National Instruments Corporation 4-105 NI-XNET Hardware and Software Manual .Chapter 4 NI-XNET API for LabVIEW — Interface Properties Interface:FlexRay:Sync Frames Channel B Even Data Type Direction Read Required? Default No N/A Property Class XNET Session Short Name Intf. for more information about the FlexRay protocol startup procedure. This read-only property returns an array in which each element holds the slot ID of a sync frame. This property can be read any time prior to closing the FlexRay interface.

If you start the interface. This read-only property returns an array in which each element holds the slot ID of a sync frame. for more information about the FlexRay protocol startup procedure. If the interface is not started. This property can be read any time prior to closing the FlexRay interface. this returns an empty array.Chapter 4 NI-XNET API for LabVIEW — Interface Properties Interface:FlexRay:Sync Frames Channel B Odd Data Type Direction Read Required? Default No N/A Property Class XNET Session Short Name Intf. NI-XNET Hardware and Software Manual 4-106 ni.FlexRay. this property may be helpful in diagnosing the problem. but it fails to communicate (integrate).SyncChBOdd Description This property returns an array of sync frames (slot IDs) transmitted or received on channel B during the last odd cycle. Summary of the FlexRay Standard. Refer toAppendix B.com .

Overflow means that in at least one cycle. the number of sync frames was above the limit set by the XNET Cluster FlexRay:Sync Node Max property. this property returns Within Limits. Within Limits means the number of sync frames is within the protocol’s limits since the interface start.SyncStatus Description This property returns the status of sync frames since the interface (enumeration) start. This property can be read any time prior to closing the FlexRay interface. Below Minimum means that in at least one cycle. © National Instruments Corporation 4-107 NI-XNET Hardware and Software Manual . Summary of the FlexRay Standard.FlexRay. for more information about the FlexRay protocol startup and cluster integration procedure. If you start the interface. Both Min and Max means that both minimum and overflow errors have occurred (this is unlikely). If the interface is not started.Chapter 4 NI-XNET API for LabVIEW — Interface Properties Interface:FlexRay:Sync Frame Status Data Type Direction Read Required? Default No N/A Property Class XNET Session Short Name Intf. but it fails to communicate (integrate). depending on number of nodes). this property may be helpful in diagnosing the problem. the number of sync frames was below the limit the protocol requires (2 or 3. Refer to Appendix B.

This applies to both channels (A and B) on each FlexRay interface. NI-XNET Hardware and Software Manual 4-108 ni.com .Term Description This property controls termination at the NI-XNET interface (enumeration) connector (port). You can overwrite the default value by writing this property prior to starting the FlexRay interface (refer to Session States for more information).vi with scope set to either Normal or Interface Only on the session.Chapter 4 NI-XNET API for LabVIEW — Interface Properties Interface:FlexRay:Termination Data Type Direction Read/Write Required? Default No False Property Class XNET Session Short Name Intf.FlexRay. You can start the FlexRay interface by calling XNET Start. False means the interface is not terminated (default). True means the interface is terminated.

Chapter 4 NI-XNET API for LabVIEW — Interface Properties Interface:FlexRay:Wakeup Channel Data Type Direction Read/Write Required? Default No A Property Class XNET Session Short Name Intf. This property is used only when the XNET Session Interface:FlexRay:Coldstart? property is true.WakeupCh Description This property specifies the channel the FlexRay interface (node) uses to send a wakeup pattern. © National Instruments Corporation 4-109 NI-XNET Hardware and Software Manual . The values supported for this property (enumeration) are A = 0 and B = 1. You can overwrite the default value by writing this property prior to starting the FlexRay interface (refer to Session States for more information). This property corresponds to the pWakeupChannel node parameter in the FlexRay Protocol Specification.FlexRay.

The POC:wakeup send state is one of the FlexRay controller state transitions during the wakeup process. The supported values for this property are 2–63.Chapter 4 NI-XNET API for LabVIEW — Interface Properties Interface:FlexRay:Wakeup Pattern Data Type Direction Read/Write Required? Default No 2 Property Class XNET Session Short Name Intf. the controller sends the wakeup pattern on the specified Wakeup Channel and checks for collisions on the bus.FlexRay. This property is used only when the XNET Session Interface:FlexRay:Coldstart? property is true.WakeupPtrn Description This property specifies the number of repetitions of the wakeup symbol that are combined to form a wakeup pattern when the FlexRay interface (node) enters the POC:wakeup-send state. This property corresponds to the pWakeupPattern node parameter in the FlexRay Protocol Specification. NI-XNET Hardware and Software Manual 4-110 ni.com . You can overwrite the default value by writing a value within the specified range to this property prior to starting the FlexRay interface (refer to Session States for more information). In this state.

The actual hardware interpretation of this value is one more than the programmed value. the remaining bits provide fields for more advanced CAN communication baud rate programming. 500000). or when no database is used.1 Bit Encoding/Decoding. where A. This is the Phase_Seg2 time from ISO 11898–1. – – – © National Instruments Corporation 4-111 NI-XNET Hardware and Software Manual . The actual hardware interpretation of this value is one more than the programmed value. CAN When the upper bit (0x80000000) is clear.BaudRate Description Note You can modify this property only when the interface is stopped. B is the Time Segment 2 (TSEG2). 12.4. and DDDD are defined as follows: • A is the (Re-)Synchronization Jump Width (SJW). which is the time segment after the sample point. The baud rate format in advanced mode is 0x8ABCDDDD. this is a numeric baud rate (for example. When the upper bit is set. B. The default value for this interface property is the same as the cluster’s baud rate in the database.Chapter 4 NI-XNET API for LabVIEW — Interface Properties Interface:Baud Rate Data Type Direction Read/Write Required? Yes (If Not in Database) Default 0 (If Not in Database) Property Class XNET Session Short Name Intf. The Interface:Baud Rate property sets the CAN or FlexRay interface baud rate. – – • Valid programmed values are 0–3. Your application can set this interface baud rate to override the value in the database. C. Valid programmed values are 0–7.

and D values: • • • • A = SJW = 0x0 (0x01 in hardware. C. This is used to program the baud rate prescaler. the nominal time segments length is Sync_Seg(Fixed at 1) + (Prop_Seg + Phase_Seg1)(B) + Phase_Seg2(C) = 1 + 2 + 5 = 8. in increments of 0x7D (125 decimal) ns.1 Bit Encoding/Decoding.Chapter 4 NI-XNET API for LabVIEW — Interface Properties • C is the Time Segment 1 (TSEG1). Valid programmed values are 0–0xFA00.4. 12. So. From IS0 11898–1.4. A 1 μs bit time is equivalent to a 1 MHz baud rate. 12.4. the total time for a bit in this example is 8 * 125 ns = 1000 ns = 1 μs. due to the + 1) B = TSEG2 = 0x1 (0x02 in hardware. – – – Valid programmed values are 1–0xF (1–15 decimal). • DDDD is the bit time quantum. B. This example breaks down into the following A. This is the combination of the Prop_Seg and Phase_Seg1 time from ISO 11898–1. NI-XNET Hardware and Software Manual 4-112 ni. 12. The actual hardware interpretation of this value is one more than the programmed value.2 Programming of Bit Time. which is the time segment before the sample point. due to the + 1) D = tq = 0x7D (125 ns in hardware) Each time quanta is 125 ns.1. – – An advanced baud rate example is 0x8014007D.com . due to the + 1) C = TSEG 1 = 0x4 (0x05 in hardware.1 Bit Encoding/Decoding. This is the time quantum from ISO 11898–1.

© National Instruments Corporation 4-113 NI-XNET Hardware and Software Manual . no listener) such that the frame did not transmit.EchoTx? Description The Interface:Echo Transmit? property determines whether Frame Input or Signal Input sessions contain frames that the interface transmits.vi. the frame is echoed to the Input session. If there are bus problems (for example.Chapter 4 NI-XNET API for LabVIEW — Interface Properties Interface:Echo Transmit? Data Type Direction Read/Write Required? Default No False Property Class XNET Session Short Name Intf. When using XNET Read (Frame Raw). the frame is not received. and a frame transmit is complete for an Output session. Note Echoed frames are placed into the input sessions only after the frame transmit is complete. the Flags field is parsed into an echo? Boolean in the frame cluster. When this property is true. When using XNET Read (Frame CAN). Frame Input sessions can use the Flags field to differentiate frames received from the bus and frames the interface transmits.vi or XNET Read (Frame FlexRay). you can parse the Flags manually by reviewing the Raw Frame Format section.vi. Signal Input sessions cannot differentiate the origin of the incoming data.

such as the name and serial number. You can pass this I/O name into an XNET Interface property node to retrieve hardware information for the interface. Provide a refnum you can wire to a property node to read information for the interface. which is used to read information for all XNET hardware in the system. NI-XNET Hardware and Software Manual 4-114 ni. You can use this property on the diagram to: • • Display a string that contains the name of the interface as shown in Measurement and Automation Explorer (MAX). The I/O Name is the same reference available from the XNET System property node.IOName Description The I/O Name property returns a reference to the interface used to create the session.Chapter 4 NI-XNET API for LabVIEW — Interface Properties Interface:I/O Name Data Type Direction Read/Write Required? Default No False Property Class XNET Session Short Name Intf.com .

you can set this property to false.vi as desired. For output sessions. This is done because there is no known use case for reading a stopped input session. you can leave this property at its default value of true.vi multiple times prior to starting the session. and if the interface is not already started. you can call XNET Start. © National Instruments Corporation 4-115 NI-XNET Hardware and Software Manual .Chapter 4 NI-XNET API for LabVIEW — Auto Start? Auto Start? Data Type Direction Read/Write Required? Default No True Property Class XNET Session Short Name AutoStart? Description Automatically starts the output session on the first call to XNET Write.vi). This starts the session itself. start always is performed within the first call to XNET Read. it starts the interface also. After calling XNET Write.vi contains valid data.vi (if not already started using XNET Start. or if you are starting multiple sessions simultaneously. When automatic start is performed.vi to start the session(s). If you need to call XNET Write.vi with scope set to Normal.vi. For input sessions. it is equivalent to XNET Start. as long as the first call to XNET Write.

Chapter 4

NI-XNET API for LabVIEW — Cluster

Cluster
Data Type Direction Read Only Required? Default N/A N/A

Property Class
XNET Session

Short Name
Cluster

Description
This property returns the cluster (network) used with XNET Create Session.vi. Use this property on the block diagram as follows: • • As a refnum wired to a property node to access information for the cluster and its objects (frames, signals, etc.). As a string containing the cluster name. This name typically is the database alias followed by the cluster name.
Caution When using this property as a refnum on the diagram (wired to a property node), the NI-XNET driver must open the database on disk and maintain a binary image of the database data in memory. This can have adverse effects on memory consumption. Use XNET Database Close.vi to close the database prior to performing memory-sensitive tasks, such as a control loop on LabVIEW Real-Time.

NI-XNET Hardware and Software Manual

4-116

ni.com

Chapter 4

NI-XNET API for LabVIEW — Database

Database
Data Type Direction Read Only Required? Default N/A N/A

Property Class
XNET Session

Short Name
Database

Description
This property returns the database used with XNET Create Session.vi. Use this property on the block diagram as follows: • • As a refnum wired to a property node to access information for the database and its objects (frames, signals, etc.). As a string containing the database name. This name is typically a database alias, but it also can be a complete file path.
Caution When using this property as a refnum on the diagram (wired to a property node), the NI-XNET driver must open the database on disk and maintain a binary image of the database data in memory. This can have adverse effects on memory consumption. Use XNET Database Close.vi to close the database prior to performing memory-sensitive tasks, such as a control loop on LabVIEW Real-Time.

© National Instruments Corporation

4-117

NI-XNET Hardware and Software Manual

Chapter 4

NI-XNET API for LabVIEW — List of Frames

List of Frames
Data Type Direction Read Only Required? Default N/A N/A

Property Class
XNET Session

Short Name
ListFrms

Description
This property returns the list of frames in the session. This property is valid only for sessions of Frame Input or Frame Output mode. For a Signal Input/Output session, use the List of Signals property. Use each array element on the block diagram as follows: • • As a refnum wired to a property node to access information for the frame. As a string containing the frame name. The name is the one used to create the session.
Caution Each frame refers to the object contained in the database. When using the frame as a refnum on the diagram (wired to a property node), the NI-XNET driver must open the database on disk and maintain a binary image of the database data in memory. This can have adverse effects on memory consumption. Use XNET Database Close.vi to close the database prior to performing memory-sensitive tasks, such as a control loop on LabVIEW Real-Time.

NI-XNET Hardware and Software Manual

4-118

ni.com

Chapter 4

NI-XNET API for LabVIEW — List of Signals

List of Signals
Data Type Direction Read Only Required? Default N/A N/A

Property Class
XNET Session

Short Name
ListSigs

Description
This property returns the list of signals in the session. This property is valid only for sessions of Signal Input or Signal Output mode. For a Frame Input/Output session, use the List of Frames property. Use each array element on the block diagram as follows: • • As a refnum wired to a property node to access information for the signal. As a string containing the signal name. The name is the one used to create the session.
Caution Each signal refers to the object contained in the database. When using the signal as a refnum on the diagram (wired to a property node), the NI-XNET driver must open the database on disk and maintain a binary image of the database data in memory. This can have adverse effects on memory consumption. Use XNET Database Close.vi to close the database prior to performing memory-sensitive tasks, such as a control loop on LabVIEW Real-Time.

© National Instruments Corporation

4-119

NI-XNET Hardware and Software Manual

Chapter 4

NI-XNET API for LabVIEW — Mode

Mode
Data Type Direction Read Only Required? Default N/A N/A

Property Class
XNET Session

Short Name
Mode

Description
This property returns the session mode (ring). You provided this mode when you created the session. For more information, refer to Session Modes.

Number in List
Data Type Direction Read Only Required? Default N/A N/A

Property Class
XNET Session

Short Name
NumInList

Description
This property returns the number of frames or signals in the session’s list. This is a quick way to get the size of the List of Frames or List of Signals property.

NI-XNET Hardware and Software Manual

4-120

ni.com

Chapter 4

NI-XNET API for LabVIEW — Number of Values Pending

Number of Values Pending
Data Type Direction Read Only Required? Default N/A N/A

Property Class
XNET Session

Short Name
NumPend

Description
This property returns the number of values (frames or signals) pending for the session. For input sessions, this is the number of frame/signal values available to XNET Read.vi. If you call XNET Read.vi with number to read of this number and timeout of 0.0, XNET Read.vi should return this number of values successfully. For output sessions, this is the number of frames/signal values provided to XNET Write.vi but not yet transmitted onto the network. The execution time to read this property is sufficient for use in a high-priority loop on LabVIEW Real-Time (RT) (refer to High Priority Loops for more information).

© National Instruments Corporation

4-121

NI-XNET Hardware and Software Manual

Chapter 4

NI-XNET API for LabVIEW — Number of Values Unused

Number of Values Unused
Data Type Direction Read Only Required? Default N/A N/A

Property Class
XNET Session

Short Name
NumUnused

Description
This property returns the number of values (frames or signals) unused for the session. If you get this property prior to starting the session, it provides the size of the underlying queue(s). Contrary to the Queue Size property, this value is in number of frames for Frame I/O, not number of bytes; for Signal I/O, it is the number of signal values in both cases. After start, this property returns the queue size minus the Number of Values Pending property. For input sessions, this is the number of frame/signal values unused in the underlying queue(s). For output sessions, this is the number of frame/signal values you can provide to a subsequent call to XNET Write.vi. If you call XNET Write.vi with this number of values and timeout of 0.0, XNET Write.vi should return success. The execution time to read this property is sufficient for use in a high-priority loop on LabVIEW Real-Time (RT) (refer to High Priority Loops for more information).

NI-XNET Hardware and Software Manual

4-122

ni.com

Chapter 4

NI-XNET API for LabVIEW — Payload Length Maximum

Payload Length Maximum
Data Type Direction Read Only Required? Default N/A N/A

Property Class
XNET Session

Short Name
PayldLenMax

Description
This property returns the maximum payload length of all frames in this session, expressed as bytes (0–254). This property does not apply to Signal sessions (only Frame sessions). For CAN Stream (Input and Output), this property is always 8 bytes. For FlexRay Stream (Input and Output), this property is the same as the XNET Cluster FlexRay:Payload Length Maximum property value. For Queued and Single-Point (Input and Output), this is the maximum payload of all frames specified in the List of Frames property.

© National Instruments Corporation

4-123

NI-XNET Hardware and Software Manual

Chapter 4

NI-XNET API for LabVIEW — Protocol

Protocol
Data Type Direction Read Only Required? Default N/A N/A

Property Class
XNET Session

Short Name
Protocol

Description
This property returns the protocol that the interface in the session uses. The values (enumeration) for this property are: 0 1 CAN FlexRay

NI-XNET Hardware and Software Manual

4-124

ni.com

Chapter 4

NI-XNET API for LabVIEW — Queue Size

Queue Size
Data Type Direction Read/Write Required? Default No Refer to Description

Property Class
XNET Session

Short Name
QueueSize

Description
For output sessions, queues store data passed to XNET Write.vi and not yet transmitted onto the network. For input sessions, queues store data received from the network and not yet obtained using XNET Read.vi. For most applications, the default queue sizes are sufficient. You can write to this property to override the default. When you write (set) this property, you must do so prior to the first session start. You cannot set this property again after calling XNET Stop.vi. For signal I/O sessions, this property is the number of signal values stored. This is analogous to the number of values you use with XNET Read.vi or XNET Write.vi. For frame I/O sessions, this property is the number of bytes of frame data stored. For CAN frame I/O sessions, each frame uses exactly 24 bytes. You can use this number to convert the Queue Size (in bytes) to/from the number of CAN frame values. For FlexRay frame I/O sessions, each frame value size can vary depending on the payload length. For more information, refer to Raw Frame Format. For Signal I/O XY sessions, you can use signals from more than one frame. Within the implementation, each frame uses a dedicated queue. According to the formulas below, the default queue sizes can be different for each frame. If you read the default Queue Size property for a Signal Input XY session, the largest queue size is returned, so that a call to XNET Read.vi of that size can empty all queues. If you read the default Queue Size property for a Signal Output XY session, the smallest queue size is returned, so that a call to XNET Write.vi of that size can succeed when all queues are empty. If you write the Queue Size property for a Signal I/O XY session, that size is used for all frames, so you must ensure that it is sufficient for the frame with the fastest transmit time. For Signal I/O Waveform sessions, you can use signals from more than one frame. Within the implementation, each frame uses a dedicated queue. The Queue Size property does not

© National Instruments Corporation

4-125

NI-XNET Hardware and Software Manual

Chapter 4

NI-XNET API for LabVIEW — Queue Size

represent the memory in these queues, but rather the amount of time stored. The default queue allocations store Application Time worth of resampled signal values. If you read the default Queue Size property for a Signal I/O Waveform session, it returns Application Time multiplied by the time Resample Rate. If you write the Queue Size property for a Signal I/O Waveform session, that value is translated from a number of samples to a time, and that time is used to allocate memory for each queue. For Single-Point sessions (signal or frame), this property is ignored. Single-Point sessions always use a value of 1 as the effective queue size.

Default Value
You calculate the default queue size based on the following assumptions: • • Application Time: The time between calls to XNET Read.vi/XNET Write.vi in your application. Frame Time: The time between frames on the network for this session.

The following pseudo code describes the default queue size formula:
if (session is Signal I/O Waveform) Queue_Size = (Application_Time * Resample_Rate); else Queue_Size = (Application_Time / Frame_Time); if (Queue_Size < 64) Queue_Size = 64; if (session mode is Frame I/O) Queue_Size = Queue_Size * Frame_Size;

For Signal I/O Waveform sessions, the initial formula calculates the number of resampled values that occur within the Application Time. This is done by multiplying Application Time by the XNET Session Resample Rate property. For all other session modes, the initial formula divides Application Time by Frame Time. The minimum for this formula is 64. This minimum ensures that you can read or write at least 64 elements. If you need to read or write more elements for a slow frame, you can set the Queue Size property to a larger number than the default. If you set a large Queue Size, this may limit the maximum number of frames you can use in all sessions. For Frame I/O sessions, this formula result is multiplied by each frame value size to obtain a queue size in bytes. For Signal I/O sessions, this formula result is used directly for the queue size property to provide the number of signal values for XNET Read.vi or XNET Write.vi. Within the Signal I/O session, the memory allocated for the queue incorporates frame sizes, because the signal values are mapped to/from frame values internally.
NI-XNET Hardware and Software Manual 4-126 ni.com

Chapter 4

NI-XNET API for LabVIEW — Queue Size

Application Time
The LabVIEW target in which your application runs determines the Application Time: • • Windows: 400 ms (0.4 s) LabVIEW Real-Time (RT): 100 ms (0.1 s)

This works under the assumption that for Windows, more memory is available for input queues, and you have limited control over the application timing. LabVIEW RT targets typically have less available memory, but your application has better control over application timing.

Frame Time
Frame Time is calculated differently for Frame I/O Stream sessions compared to other modes. For Frame I/O Stream, you access all frames in the network (cluster), so the Frame Time is related to the average bus load on your network. For other modes, you access specific frames only, so the Frame Time is obtained from database properties for those frames. The Frame Time used for the default varies by session mode and protocol, as described below.

CAN, Frame I/O Stream
Frame Time is 100 μs (0.0001 s). This time assumes a baud rate of 1 Mbps, with frames back to back (100 percent busload). For all CAN sessions, Frame Size is 24 bytes. When you create an application to stress test NI-XNET performance, it is possible to generate CAN frames faster than 100 μs. For this application, you must set the queue size to larger than the default.

FlexRay, Frame I/O Stream
Frame Time is 20 μs (0.00002 s). This time assumes a baud rate of 10 Mbps, with a cycle containing static slots only (no minislots or NIT), and frames on channel A only. Small frames at a fast rate require a larger queue size than large frames at a slow rate. Therefore, this default assumes static slots with 4 bytes, for a Frame Size of 24 bytes. When you create an application to stress test NI-XNET performance, it is possible to generate FlexRay frames faster than 20 μs. For this application, you must set the queue size to larger than the default.

© National Instruments Corporation

4-127

NI-XNET Hardware and Software Manual

Chapter 4

NI-XNET API for LabVIEW — Queue Size

CAN, Other Modes
For Frame I/O Queued, Signal I/O XY, and Signal I/O Waveform, the Frame Time is different for each frame in the session (or frame within which signals are contained). For CAN frames, Frame Time is the frame property CAN:Transmit Time, which specifies the time between successive frames (in floating-point seconds). If the frame’s CAN Transmit Time is 0, this implies the possibility of back-to-back frames on the network. Nevertheless, this back-to-back traffic typically occurs in bursts, and the average rate over a long period of time is relatively slow. To keep the default queue size to a reasonable value, when CAN Transmit Time is 0, the formula uses a Frame Time of 50 ms (0.05 s). For all CAN sessions, Frame Size is 24 bytes.

FlexRay, Other Modes
For Frame I/O Queued, Signal I/O XY, and Signal I/O Waveform, the Frame Time is different for each frame in the session (or frame within which signals are contained). For FlexRay frames, Frame Time is the time between successive frames (in floating-point seconds), calculated from cluster and frame properties. For example, if a cluster Cycle (cycle duration) is 10000 μs, and the frame Base Cycle is 0 and Cycle Repetition is 1, the frame’s Transmit Time is 0.01 (10 ms). For these session modes, the Frame Size is different for each frame in the session. Each Frame Size is obtained from its XNET Frame Payload Length property in the database.

Examples
The following table lists example session configurations and the resulting default queue sizes. Session Configuration Frame Input Stream, CAN, Windows Frame Output Stream, CAN, Windows Frame Input Stream, FlexRay, Windows Frame Input Stream, CAN, LabVIEW RT Frame Input Stream, FlexRay, LabVIEW RT Default Queue Size 96000 96000 480000 24000 120000 Formula (0.4 / 0.0001) = 4000; 4000 × 24 bytes (0.4 / 0.0001) = 4000; 4000 × 24 bytes; output is always same as input (0.4 / 0.00002) = 20000; 20000 × 24 bytes (0.1 / 0.0001) = 1000; 1000 × 24 bytes (0.1 / 0.00002) = 5000; 5000 × 24 bytes

NI-XNET Hardware and Software Manual

4-128

ni.com

Chapter 4

NI-XNET API for LabVIEW — Queue Size

Session Configuration Frame Input Queued, CAN, Transmit Time 0.0, Windows Frame Input Queued, CAN, Transmit Time 0.0005, Windows Frame Input Queued, CAN, Transmit Time 1.0 (1 s), Windows Frame Input Queued, FlexRay, every 2 ms cycle, payload length 4, Windows Frame Input Queued, FlexRay, every 2 ms cycle, payload length 16, LabVIEW RT Signal Input XY, two CAN frames, Transmit Time 0.0 and 0.0005, Windows Signal Output XY, two CAN frames, Transmit Time 0.0 and 0.0005, Windows Signal Output Waveform, two CAN frames, 1 ms and 400 ms, resample rate 1000 Hz, Windows Signal Output Waveform, two CAN frames, 1 ms and 400 ms, resample rate 1000 Hz, Windows

Default Queue Size 1536

Formula (0.4 / 0.05) = 8; Transmit Time 0 uses Frame Time 50 ms; use minimum of 64 frames (64 × 24) (0.4 / 0.0005) = 800; 800 × 24 bytes

19200

1536

(0.4 / 1.0) = 0.4; use minimum of 64 frames (64 × 24) (0.4 / 0.002) = 200; 200 × 24 bytes

4800

2048

(0.1 / 0.002) = 50, use minimum of 64; payload length 16 requires 32 bytes; 64 × 32 bytes (0.4 / 0.05) = 8, use minimum of 64; (0.4 / 0.0005) = 800; expressed as signal values (0.4 / 0.05) = 8, use minimum of 64; (0.4 / 0.0005) = 800; expressed as signal values Memory allocation is 400 and 64 frames to provide 0.4 sec of storage, queue size represents number of samples, or (0.4 × 1000.0) Memory allocation is 400 and 64 frames to provide 0.4 sec of storage, queue size represents number of samples, or (0.4 × 1000.0)

64 and 800 (read as 800) 64 and 800 (read as 64) 400

400

© National Instruments Corporation

4-129

NI-XNET Hardware and Software Manual

Chapter 4

NI-XNET API for LabVIEW — Resample Rate

Resample Rate
Data Type Direction Read/Write Required? Default No 1000.0 (Sample Every Millisecond)

Property Class
XNET Session

Short Name
ResampRate

Description
Rate used to resample frame data to/from signal data in waveforms. This property applies only when the session mode is Signal Input Waveform or Signal Output Waveform. This property is ignored for all other modes. The data type is 64-bit floating point (DBL). The units are in Hertz (samples per second).

NI-XNET Hardware and Software Manual

4-130

ni.com

Chapter 4

NI-XNET API for LabVIEW — XNET Read.vi

XNET Read.vi
Purpose
Reads data from the network using an XNET session.

Description
The instances of this polymorphic VI specify the type of data returned. XNET Read.vi and XNET Write.vi are optimized for real-time performance. XNET Read.vi executes quickly and avoids access to shared resources that can induce jitter on other VI priorities. There are three categories of XNET Read instance VIs: • Signal: Use when the session mode is Signal Input. The XNET Read.vi instance must match the mode exactly (for example, the Signal Waveform instance when mode is Signal Input Waveform). Frame: Use when the session mode is Frame Input. The XNET Read.vi instance specifies the desired data type for frames and is not related to the mode. For an easy-to-use data type, use the CAN or FlexRay instance. State: Use to read state, status, and time information for the session interface. You can use these instances in addition to Signal or Frame instances, and they are not related to the mode. The data these instances return is optimized for performance. Although property nodes may return similar runtime data, those properties are not necessarily optimized for real-time loops.

The XNET Read instance VIs are: • • • • XNET Read (Signal Single-Point).vi: The session mode is Signal Input Single-Point. XNET Read (Signal Waveform).vi: The session mode is Signal Input Waveform. XNET Read (Signal XY).vi: The session mode is Signal Input XY. XNET Read (Frame CAN).vi: The session uses a CAN interface, and the mode is Frame Input Stream Mode, Frame Output Queued Mode, or Frame Output Single-Point Mode. XNET Read (Frame FlexRay).vi: The session uses a FlexRay interface, and the mode is Frame Input Stream Mode, Frame Output Queued Mode, or Frame Output Single-Point Mode. XNET Read (Frame Raw).vi: A data type for frame input that is protocol independent and more efficient than the CAN and FlexRay instances. XNET Read (State CAN Comm).vi: Returns the session CAN interface communicate state.

• •

© National Instruments Corporation

4-131

NI-XNET Hardware and Software Manual

XNET Read (State Time Start).Chapter 4 NI-XNET API for LabVIEW — XNET Read.vi: Returns the LabVIEW timestamp at which communication started for the session interface.com . This time always precedes the Communication time. XNET Read (State Time Current).vi: Returns the communication statistics for the session FlexRay interface. XNET Read (State Time Comm).vi: Returns the session interface current time as a LabVIEW timestamp.vi • • • • • • XNET Read (State FlexRay Comm).vi: Returns the current global time of the session FlexRay interface.vi: Returns the LabVIEW timestamp at which communication began for the session interface. XNET Read (State FlexRay Statistics).vi: Returns the session FlexRay interface communicate state. XNET Read (State FlexRay Cycle Macrotick). NI-XNET Hardware and Software Manual 4-132 ni. represented as cycle and macrotick.

If the values do not arrive prior to the timeout. If timeout is positive. The timeout is a LabVIEW relative time.vi Purpose Reads data from a session as an array of CAN frames. then returns that number. you must use timeout of 0. The session must use a CAN interface and Frame Input Stream Mode. This input is optional. If number to read is negative.vi waits for number to read frame values. an error is returned. the XNET Read (Frame CAN). If number to read is negative (typically –1). This session is selected from the LabVIEW project or returned from XNET Create Session. or Frame Input Single-Point Mode. timeout is the time to wait for number to read frame values to become available. the data array size is no greater than this number. If the session mode is Frame Input Single-Point. Frame Input Queued Mode. Format Inputs session in is the session to read. © National Instruments Corporation 4-133 NI-XNET Hardware and Software Manual . or Frame Input Single-Point. The session mode must be Frame Input Stream.vi XNET Read (Frame CAN). This ensures that the XNET Read (Frame CAN).vi. set number to read to either –1 or the number of frames in the sessions list.Chapter 4 NI-XNET API for LabVIEW — XNET Read (Frame CAN). all available frame values are returned. The default value is –1.vi can return the current value of all session frames. represented as 64-bit floating-point in units of seconds. If number to read is positive. number to read is the number of frame values desired. Frame Input Queued.

Summary of the CAN Standard. The default value is 0. the identifier uses extended format. error in is the error cluster input (refer to Error Handling). For more information. echo? is a Boolean value that determines whether the frame was an echo of a successful transmit (true). If extended? Is false. provided for use with subsequent VIs. or the CAN protocol specification.Chapter 4 NI-XNET API for LabVIEW — XNET Read (Frame CAN). Outputs session out is the same as session in.0). refer to Appendix A. If the session mode is Frame Input Single-Point. This input is optional. the identifier uses standard format.vi waits indefinitely for number to read frame values. timeout does not apply. The cluster elements are: identifier is the CAN frame arbitration identifier. the XNET Read (Frame CAN). NI-XNET Hardware and Software Manual 4-134 ni. you must leave timeout unwired (0. If timeout is zero. the XNET Read (Frame CAN). the order of frames in the array corresponds to the order in the session list. Each array element corresponds to a frame the session receives. If extended? Is true. or received from the network (false). extended? is a Boolean value that determines whether the identifier uses extended format (true) or standard format (false). so 29 bits of this identifier are valid.0. This value is true only when you enable echo of transmitted frames by setting the XNET Session Interface:Echo Transmit? property to True. Because this mode reads the most recent value of each frame.com . The elements of each cluster are specific to the CAN protocol. so 11 bits of this identifier are valid.vi does not wait and immediately returns all available frame values up to the limit number to read specifies. For a Frame Input Single-Point session mode. data returns an array of LabVIEW clusters.vi If timeout is negative.

one for each frame specified in the list. The array size indicates the received frame value payload length. Frame Input Queued Mode: Array of frame values received for the single frame specified in the list. The CAN frames are associated to the session’s list of frames as follows: • • • Frame Input Stream Mode: Array of all frame values received (list ignored). Each CAN frame uses a LabVIEW cluster with CAN-specific elements. The timestamp uses the LabVIEW absolute timestamp type. this payload length range is 0–8. According to the CAN protocol. error out is the error cluster output (refer to Error Handling). Your application can respond by writing a CAN data frame for the identifier.vi type is the frame type (decimal value in parentheses): CAN Data (0) The CAN data frame contains payload data. but you must ignore the actual values in the payload bytes. Frame Input Queued Mode. For an example of how this data applies to network traffic. © National Instruments Corporation 4-135 NI-XNET Hardware and Software Manual . This payload length is provided to your application by filling payload with the requested number of bytes. Your application can use the payload array size. timestamp represents the absolute time when the XNET interface received the frame (end of frame). CAN Remote (1) A CAN remote frame. An ECU transmits a CAN remote frame to request data for the corresponding identifier. the payload length in the frame value specifies the number of payload bytes requested. accurate to microseconds. Frame Input Single-Point Mode: Array of single frame values. or Frame Input Single-Point Mode. Description The data represents an array of CAN frames. payload is the array of data bytes for the CAN data frame.Chapter 4 NI-XNET API for LabVIEW — XNET Read (Frame CAN). This is the most commonly used frame type for CAN. For a received remote frame (type of CAN Remote). refer to Frame Input Stream Mode.

vi instance provides optimal performance for high-priority loops.Chapter 4 NI-XNET API for LabVIEW — XNET Read (Frame CAN). The XNET Read (Frame Raw).vi instance can introduce jitter to a high-priority loop on LabVIEW Real-Time (RT) (refer to High Priority Loops for more information).com .vi Due to issues with LabVIEW memory allocation for clusters with an array. NI-XNET Hardware and Software Manual 4-136 ni. this XNET Read.

vi XNET Read (Frame FlexRay). then returns that number. If the values do not arrive prior to the timeout. If number to read is negative. an error is returned. timeout is the time to wait for number to read frame values to become available.vi can return the current value of all session frames. The session must use a FlexRay interface and Frame Input Stream Mode. © National Instruments Corporation 4-137 NI-XNET Hardware and Software Manual . The timeout is a LabVIEW relative time. the data array size is no greater than this number.vi. set number to read to either –1 or the number of frames in the session list. or Frame Input Single-Point Mode. This input is optional. The default value is –1. Frame Input Queued Mode.vi Purpose Reads data from a session as an array of FlexRay frames. This session is selected from the LabVIEW project or returned from XNET Create Session. represented as 64-bit floating-point in units of seconds. all available frame values are returned. Frame Input Queued. If timeout is positive. or Frame Input Single-Point. If the session mode is Frame Input Single-Point. If number to read is negative (typically –1).vi waits for number to read frame values. XNET Read (Frame FlexRay). you must use a timeout of 0.Chapter 4 NI-XNET API for LabVIEW — XNET Read (Frame FlexRay). If number to read is positive. The session mode must be Frame Input Stream. Format Inputs session in is the session to read. number to read is the number of frame values desired. This ensures that XNET Read (Frame FlexRay).

cycle count specifies the cycle number.0). For more information. preamble? is a Boolean value that specifies the value of the payload preamble indicator in the frame header. timeout does not apply. refer to Appendix B. The cluster elements are: slot specifies the slot number within the FlexRay cycle. or the FlexRay Protocol Specification. The FlexRay cycle count increments from 0 to 63. provided for use with subsequent VIs. For a Frame Input Single-Point session mode. you must leave timeout unwired (0. If the session mode is Frame Input Single-Point. Summary of the FlexRay Standard.vi waits indefinitely for number to read frame values. XNET Read (Frame FlexRay). Each array element corresponds to a frame the session receives.vi If timeout is negative. The elements of each cluster are specific to the FlexRay protocol. sync? is a Boolean value that specifies whether the frame is a sync frame (true) or not (false). Because this mode reads the most recent value of each frame. XNET Read (Frame FlexRay).Chapter 4 NI-XNET API for LabVIEW — XNET Read (Frame FlexRay).vi does not wait and immediately returns all available frame values up to the limit number to read specifies. The default value is 0.com . the order of frames in the array corresponds to the order in the session list. then rolls over back to 0. error in is the error cluster input (refer to Error Handling). This input is optional. preamble? being true indicates the presence of a network management vector at the NI-XNET Hardware and Software Manual 4-138 ni. If the frame is in the static segment. If timeout is zero. Outputs session out is the same as session in. startup? is a Boolean value that specifies whether the frame is a startup frame (true) or not (false).0. data returns an array of LabVIEW clusters.

Null frames occur in the static segment only.Chapter 4 NI-XNET API for LabVIEW — XNET Read (Frame FlexRay).vi beginning of the payload. chB is a Boolean value that specifies whether the frame was received on channel B (true) or not (false). When a FlexRay null frame is received. The XNET Cluster FlexRay:Network Management Vector Length property specifies the number of bytes at the beginning. This frame type does not apply to frames in the dynamic segment. it indicates that the transmitting ECU did not have new data for the current cycle. the payload does not contain a network management vector or a message ID. If preamble? is false. preamble? being true indicates the presence of a message ID at the beginning of the payload. All elements in the frame are applicable. chA is a Boolean value that specifies whether the frame was received on channel A (true) or not (false). If the frame is in the dynamic segment. FlexRay null frame. The frame contains payload data. This is the most commonly used frame type for FlexRay. This value is true only when you enable echo of transmitted frames by setting the XNET Session Interface:Echo Transmit? property to true. echo? Is a Boolean value that determines whether the frame was an echo of a successful transmit (true) or received from the network (false). This frame type occurs only when you set the XNET Session Interface:FlexRay:Null Frames To Input Stream? property to true. type is the frame type (decimal value in parentheses): FlexRay Data (32) FlexRay data frame. Frames are echoed only to a session with the Frame Input Stream Mode. This property enables logging of received null frames to a session with the Frame FlexRay Null (33) © National Instruments Corporation 4-139 NI-XNET Hardware and Software Manual . The message ID is always 2 bytes in length.

The timestamp uses the LabVIEW absolute timestamp type. For this frame type.vi to change the source of the Master Timebase terminal. and preamble? and echo? are false. this timestamp is normally derived from FlexRay global time. The array size indicates the received frame value payload length. If you prefer to synchronize this timestamp to other sources. the FlexRay network timebase. but it may drift relative to other NI hardware products and the LabVIEW absolute timebase. this length range is 0–254. error out is the error cluster output (refer to Error Handling). accurate to microseconds. NI-XNET Hardware and Software Manual 4-140 ni. payload is the array of data bytes for FlexRay frames of type FlexRay Data or FlexRay Null. Other sessions are not affected. the payload array is empty (size 0).vi). refer to Frame Input Stream Mode.vi Input Stream Mode. timestamp represents the absolute time when the XNET interface received the frame (end of frame). you can use XNET Connect Terminals. For an example of how this data applies to network traffic. or Frame Input Single-Point Mode. While the NI-XNET FlexRay interface is communicating (integrated). Frame Input Queued Mode.Chapter 4 NI-XNET API for LabVIEW — XNET Read (Frame FlexRay). Under this configuration.com . According to the FlexRay protocol. The remaining elements in the frame reflect the data in the received null frame and the timestamp when it was received. the timestamp does not drift as compared to the FlexRay global time (XNET Read (State FlexRay Cycle Macrotick).

The XNET Read (Frame Raw). © National Instruments Corporation 4-141 NI-XNET Hardware and Software Manual .vi Description The data represents an array of FlexRay frames. Frame Input Queued Mode: Array of frame values received for the single frame specified in the list.vi instance provides optimal performance for high-priority loops.Chapter 4 NI-XNET API for LabVIEW — XNET Read (Frame FlexRay). The FlexRay frames are associated to the session list of frames as follows: • • • Frame Input Stream Mode: Array of all frame values received (list ignored).vi instance can introduce jitter to a high-priority loop on LabVIEW Real-Time (RT) (refer to High Priority Loops for more information). Each FlexRay frame uses a LabVIEW cluster with FlexRay-specific elements. Frame Input Single-Point Mode: Array of single frame values. this XNET Read. Due to issues with LabVIEW memory allocation for clusters with an array. one for each frame specified in the list.

For example. the data might return 80 bytes. number to read is the number of bytes (U8) desired. If number to read is negative (typically –1). you must use a timeout of 0. This ensures that XNET Read (Frame Raw). the data array size is no greater than this number. If number to read is positive. Format Inputs session in is the session to read. each frame can vary in length. FlexRay frames vary in length. Frame Input Queued Mode. The minimum size for a single frame is 24 bytes. so you must use at least that number. As encoded in raw data. NI-XNET Hardware and Software Manual 4-142 ni. the number represents the maximum raw bytes to read. The default value is –1.com .vi XNET Read (Frame Raw). within which the first 24 bytes encode the first frame. CAN frames are always 24 bytes in length. If you want to read a specific number of CAN frames.vi.vi can return the current value of all session frames. multiply that number by 24. and the next 56 bytes encode the second frame.vi Purpose Reads data from a session as an array of raw bytes. This number does not represent the number of frames to read. if you pass number to read of 91. The session mode must be Frame Input Stream Mode. not the number of frames. or Frame Input Single-Point Mode. This input is optional. all available raw data is returned. Therefore. If number to read is negative.Chapter 4 NI-XNET API for LabVIEW — XNET Read (Frame Raw). If the session mode is Frame Input Single-Point. set number to read to –1. This session is selected from the LabVIEW project or returned from XNET Create Session.

and the second 56 bytes in size. The read returns after the two frames are received. Outputs session out is the same as session in. If the bytes do not arrive prior to the timeout.vi waits for number to read frame bytes to be received.vi does not wait and immediately returns all available frame bytes up to the limit number to read specifies.Chapter 4 NI-XNET API for LabVIEW — XNET Read (Frame Raw). XNET Read (Frame Raw).0. If the session mode is Frame Input Single-Point. timeout does not apply. the first 24 bytes in size. XNET Read (Frame Raw). For example. The raw bytes encode one or more frames using the Raw Frame Format. you must leave timeout unwired (0.vi waits indefinitely for number to read frame bytes. then returns complete frames up to that number. If timeout is positive. XNET Read (Frame Raw).vi timeout is the time to wait for number to read frame bytes to become available. an error is returned. The default value is 0. and it is also used for log file examples. If timeout is negative. If the read copied 46 bytes of the second frame (up to the limit of 70). assume you pass number to read of 70 bytes and timeout of 10 seconds. that frame would be incomplete and therefore difficult to interpret. the read always returns complete frames in data. represented as 64-bit floating-point in units of seconds. data returns an array of bytes. this read may return fewer bytes in data. © National Instruments Corporation 4-143 NI-XNET Hardware and Software Manual . Because this mode reads the most recent value of each frame. To avoid this problem. but only the first frame is copied to data. error in is the error cluster input (refer to Error Handling). This input is optional. for a total of 80 bytes. To avoid returning a partial frame. two frames are received. The data always returns complete frames. The timeout is a LabVIEW relative time. If timeout is zero.0). This frame format is the same for read and write of raw data. provided for use with subsequent VIs. even when number to read bytes are available from the hardware. During the read.

The NI-XNET examples provide code to read the raw frame data from the log file and convert the raw data into protocol-specific LabVIEW clusters (CAN frames or FlexRay frames). For example. The raw frame format is protocol independent. the only frame type is FlexRay Data (other types apply to Frame Input Stream only). Because it is not converted to/from LabVIEW clusters for ease of use. Description The raw bytes encode one or more frames using the Raw Frame Format. This XNET Read. Frame Input Queued Mode. refer to Frame Input Stream Mode.Chapter 4 NI-XNET API for LabVIEW — XNET Read (Frame Raw).vi or XNET Read (Frame FlexRay). error out is the error cluster output (refer to Error Handling). Frame Input Single-Point Mode: Array of single frame values. The raw frame format matches the format of data transferred to/from the XNET hardware.vi). NI-XNET Hardware and Software Manual 4-144 ni. one for each frame specified in the list. or Frame Input Single-Point Mode.vi For information about which elements of the raw frame are applicable. For an example of how this data applies to network traffic. or Frame Input Single-Point Mode. so the session can use either a CAN or FlexRay interface. Frame Input Queued Mode: Array of frame values received for the single frame specified in the list. Frame Input Queued Mode. when you read FlexRay frames for a Frame Input Queued session.vi instance typically is used to read raw frame data from the interface and log the data to a file for later analysis. it is more efficient with regard to performance. The session must use Frame Input Stream Mode. refer to the frame read for the protocol in use (XNET Read (Frame CAN). The raw frames are associated to the session’s list of frames as follows: • • • Frame Input Stream Mode: Array of all frame values received (list ignored).com .

data returns a one-dimensional array of signal values.vi Purpose Reads data from a session of Signal Input Single-Point Mode. Outputs session out is the same as session in. For an example of how this data applies to network traffic. 64-bit floating point. refer to Signal Input Single-Point Mode. This session is selected from the LabVIEW project or returned from XNET Create Session.Chapter 4 NI-XNET API for LabVIEW — XNET Read (Signal Single-Point). Each signal value is scaled. only signal data from the most recent frame is returned. © National Instruments Corporation 4-145 NI-XNET Hardware and Software Manual . Each array element corresponds to a signal configured for the session. The data returns the most recent value received for each signal. If no frame is received for the corresponding signals since you started the session. provided for use with subsequent VIs. If multiple frames for a signal are received since the previous call to XNET Read (Signal Single-Point). error in is the error cluster input (refer to Error Handling). the XNET Signal Default Value is returned.vi. The session mode must be Signal Input Single-Point Mode. error out is the error cluster output (refer to Error Handling).vi XNET Read (Signal Single-Point). The order of signals in the array corresponds to the order in the session list.vi (or session start). Format Inputs session in is the session to read.

vi.vi waits for number to read samples. The data represents a waveform of resampled values for each signal in the session. This session is selected from the LabVIEW project or returned from XNET Create Session.com . If number to read is positive.vi Purpose Reads data from a session of Signal Input Waveform Mode. then returns that number. If the samples do not arrive prior to the timeout.Chapter 4 NI-XNET API for LabVIEW — XNET Read (Signal Waveform). NI-XNET Hardware and Software Manual 4-146 ni. You can wire the data directly to a LabVIEW Waveform Graph for display. If number to read is negative (typically –1). If timeout is positive. the number returned is exactly this number on success.vi XNET Read (Signal Waveform). Format Inputs session in is the session to read. The default value is –1. XNET Read (Signal Waveform). you must use a timeout of zero. an error is returned. XNET Read (Signal Waveform). the maximum number of samples is returned.vi waits indefinitely for number to read samples. number to read is the number of samples desired. represented as 64-bit floating-point in units of seconds. The timeout is a LabVIEW relative time. the number of samples returned (size of Y arrays) is no greater than this number. This input is optional. If number to read is negative. If timeout is nonzero. If timeout is negative. timeout is the time to wait for number to read samples to become available. The session mode must be Signal Input Waveform.

data returns a one-dimensional array of LabVIEW waveforms.vi does not wait and immediately returns all available samples up to the limit number to read specifies. provided for use with subsequent VIs.Chapter 4 NI-XNET API for LabVIEW — XNET Read (Signal Waveform). typical values for this timeout are 0 (return available) or a large positive value such as 100. LabVIEW relative time is represented as 64-bit floating point in units of seconds.vi If timeout is zero. error in is the error cluster input (refer to Error Handling). If no frame is received for the corresponding signals since you started the session. The default value is 0. XNET Read (Signal Waveform). refer to Signal Input Waveform Mode. 64-bit floating point. This is a LabVIEW relative time that specifies the time between each sample in the Y array. the XNET Signal Default Value is returned. The waveform elements are: t0 is the waveform start time. and not the number of frames received.0. The waveform dt always is the inverse of the XNET Session Resample Rate property. because it is determined based on time. Y is the array of resampled signal values. Each array element corresponds to a signal configured for the session. This is a LabVIEW absolute timestamp that specifies the time for the first sample in the Y array. Outputs session out is the same as session in. The order of signals in the array corresponds to the order in the session list. dt is the waveform delta time. © National Instruments Corporation 4-147 NI-XNET Hardware and Software Manual . For an example of how this data applies to network traffic. Because time determines sample availability. This input is optional.0 (wait for a specific number to read). The Y array size is the same for all waveforms returned. error out is the error cluster output (refer to Error Handling). Each signal value is scaled.

vi. even if the time limit has not occurred. XNET Read (Signal XY).Chapter 4 NI-XNET API for LabVIEW — XNET Read (Signal XY). number to read is the number of values desired. time limit is the timestamp to wait for before returning signal values. If number to read is positive. the maximum number of values is returned. This session is selected from the LabVIEW project or returned from XNET Create Session. If time limit is valid. leave number to read unwired (–1).vi returns immediately all available values up to the current time (up to number to read). then returns available values (up to number to read).vi Purpose Reads data from a session of Signal Input XY Mode.vi returns those values.vi waits for the timestamp to occur. Format Inputs session in is the session to read.com . you effectively obtain a moving window of signal values. If number to read is negative (typically –1). to read values up to the time limit. If time limit is unwired (invalid). If number to read values are received for any signal. Therefore. This input is optional. The session mode must be Signal Input XY.vi. the size of value arrays is no greater than this number.vi XNET Read (Signal XY). The default value is –1. If you increment time limit by a fixed number of seconds for each call to XNET Read (Signal XY). XNET Read (Signal XY). XNET Read (Signal XY). NI-XNET Hardware and Software Manual 4-148 ni.

Chapter 4 NI-XNET API for LabVIEW — XNET Read (Signal XY). When you use this instance with a session of Signal Input Single-Point Mode. 64-bit floating point. This effectively returns a single pair of timestamp and value for every signal. but rather a specific absolute timestamp to wait for. The time limit of XNET Read (Signal XY). © National Instruments Corporation 4-149 NI-XNET Hardware and Software Manual . The default value is an invalid timestamp. The timeout of other XNET Read. When signals exist in different frames. time limit and number to read are ignored. The value array size is the same as the timestamp array size. one for each frame received that contains the signal.vi instances specifies the maximum amount time to wait for a specific number to read values. The cluster elements are: timestamp is the array of LabVIEW timestamps. For an example of how this data applies to network traffic. accurate to microseconds. Each timestamp/value pair represents a value from a received frame. Each cluster contains two arrays. value is the array of signal values. Outputs session out is the same as session in. For each signal. refer to Signal Input XY Mode. one for timestamp and one for value.vi does not specify a worst-case timeout value. and the timestamp and value arrays always contain only one element per signal. Each timestamp represents the absolute time when the XNET interface received the frame (end of frame). one for each frame received that contains the signal. The order of signals in the array corresponds to the order in the session list. provided for use with subsequent VIs.vi This input is optional. error in is the error cluster input (refer to Error Handling). the size of the timestamp and value arrays always is the same. Each array element corresponds to a signal configured for the session. data returns an array of LabVIEW clusters. Each signal value is scaled. the array sizes may be different from one cluster (signal) to another. such that it represents a single array of timestamp/value pairs.

com . The data represents an XY plot of timestamp/value pairs for each signal in the session. NI-XNET Hardware and Software Manual 4-150 ni. although XNET Read (Signal Single-Point).vi error out is the error cluster output (refer to Error Handling). You can wire the data directly to a LabVIEW XY Graph for display.vi is more common for that mode. Description You also can use this instance to read data from a session of Signal Input Single-Point Mode.Chapter 4 NI-XNET API for LabVIEW — XNET Read (Signal XY).

the CAN interface transitions into this state. This session is selected from the LabVIEW project or returned from XNET Create Session. Error Passive (1) If either the receive error counter or transmit error counter increment above 127.vi. Although communication proceeds. When a CAN interface is in error passive state. the CAN device generally is assumed to have problems with receiving frames. The CAN interface remains in this state as long as receive error counter and transmit error counter are both below 128. CAN comm returns a LabVIEW cluster containing the communication elements.Chapter 4 NI-XNET API for LabVIEW — XNET Read (State CAN Comm). Format Inputs session in is the session to read. The elements are: communication state specifies the CAN interface state with respect to error confinement (decimal value in parentheses): Error Active (0) This is the CAN interface initial state.vi XNET Read (State CAN Comm). This state reflects normal communication. provided for use with subsequent VIs. acknowledgement errors do not © National Instruments Corporation 4-151 NI-XNET Hardware and Software Manual .vi Purpose Reads the state of CAN communication using an XNET session. with few errors detected. Outputs session out is the same as session in. error in is the error cluster input (refer to Error Handling).

When the interface stops due to a call to XNET Stop. The interface is essentially off. Therefore. Init (3) This is the CAN interface initial state on power-up. False indicates normal operation (no error).com . it transitions from the Init state to the Error Active state. it remains in that state until you restart. transceiver error? indicates whether an error condition exists on the physical transceiver. To restart the CAN interface and all its sessions. All NI-XNET sessions for the interface no longer receive or transmit frame values. and true indicates sleep. Bus Off (2) If the transmit error counter increments above 255. Communication immediately stops under the assumption that the CAN interface must be isolated from other devices. the CAN interface transitions into this state. in that it is not attempting to communicate with other nodes (ECUs). call XNET Start. This is typically referred to as the transceiver chip NERR pin. communication stops for the interface. NI-XNET Hardware and Software Manual 4-152 ni. if the CAN interface transmits a frame with no other device (ECU) connected. When the interface stops due to the Bus Off state.Chapter 4 NI-XNET API for LabVIEW — XNET Read (State CAN Comm). it eventually enters error passive state due to retransmissions.vi. False indicates normal operation (awake).vi. When the start trigger occurs for the CAN interface. sleep? indicates whether the transceiver and communication controller are in their sleep state. and true indicates an error.vi increment the transmit error counter. the CAN interface transitions from either Error Active or Error Passive to the Init state. When a CAN interface transitions to the bus off state. but does not enter bus off state.

which the CAN specification does not allow. but the monitored bus value was dominant (logical 0). the interface wanted to send a dominant bit (logical 0). The counter increments when an error is detected for a received frame and decrements when a frame is received successfully. you see this error repeatedly. Bit 1 (4) During a frame transmit (with the exception of the arbitration ID field). A fixed format part of the received frame used the wrong format. More than 5 equal bits have occurred in sequence. This ensures that the counter © National Instruments Corporation 4-153 NI-XNET Hardware and Software Manual .Chapter 4 NI-XNET API for LabVIEW — XNET Read (State CAN Comm). The counter increases more for an error than it is decreased for success. the interface wanted to send a recessive bit (logical 1). The CAN communication state eventually transitions to Error Passive.vi last error specifies the status of the last attempt to receive or transmit a frame (decimal value in parentheses): None (0) Stuff (1) Form (2) Ack (3) The last receive or transmit was successful. The CRC contained within a received frame does not match the CRC calculated for the incoming bits.vi and do not have a cable connected. and the frame transmit retries indefinitely. The transmit error counter begins at 0 when communication starts on the CAN interface. but the monitored bus value was recessive (logical 1). The counter increments when an error is detected for a transmitted frame and decrements when a frame transmits successfully. The counter increases more for an error than it is decreased for success. This ensures that the counter generally increases when a certain ratio of frames (roughly 1/8) encounter errors. or the cable is connected to a node that is not communicating. If you call XNET Write. Bit 0 (5) CRC (6) The receive error counter begins at 0 when communication starts on the CAN interface. During a frame transmit (with the exception of the arbitration ID field). Another node (ECU) did not acknowledge the frame transmit.

so that it does not introduce errors into the flow of your LabVIEW VIs. you do not want the error out of NI-XNET VIs to return errors. wire the fault code into the LabVIEW Simple Error Handler. fault code returns a numeric code you can use to obtain a description of the fault. To obtain a fault description. XNET Read (State CAN Comm). such as a fault in the onboard processor. the fault code is 0.com . Because the state reflects the CAN interface. you intentionally may introduce noise into the CAN cables to test how your ECU behaves under these conditions. as long as the session interface is CAN. When communication state transitions to Bus Off. and its code is available as fault code. For example. If fault? is false. Although faults are extremely rare. Your application can use XNET Read (State CAN Comm). You also can bundle the fault code into a LabVIEW error cluster as the code element and use front panel features to view the error description. fault? indicates that a fault occurred.vi to read the CAN network state quickly as data. yet easy to use alongside the common practice of checking the communication state.vi error code input and view the resulting message. but it also can be related to XNET hardware. it can apply to multiple sessions. The fault cause may be related to CAN communication. A fault is an error that occurs asynchronously to the NI-XNET VIs your application calls. Your application can use XNET Read (State CAN Comm). Description You can use XNET Read (State CAN Comm). error out is the error cluster output (refer to Error Handling). NI-XNET Hardware and Software Manual 4-154 ni.vi with any XNET session mode.vi to check for problems on the CAN network independently from other aspects of your application.vi provides a detection method distinct from the error out of NI-XNET VIs. the transmit error counter no longer is valid.vi generally increases when a certain ratio of frames (roughly 1/8) encounter errors. When you do this.Chapter 4 NI-XNET API for LabVIEW — XNET Read (State CAN Comm). because this may cause your application to stop.

it first enters Config state to validate the FlexRay cluster and interface properties. In the Ready state. the FlexRay interface attempts to integrate (synchronize) with other nodes in the network cluster. FlexRay comm returns a LabVIEW cluster containing the communication elements.Chapter 4 NI-XNET API for LabVIEW — XNET Read (State FlexRay Comm). The interface is essentially off. When the interface starts. The elements are: POC state specifies the FlexRay interface state (decimal value in parentheses): Default Config (0) This is the FlexRay interface initial state on power-up. This integration process can take several Ready (1) © National Instruments Corporation 4-155 NI-XNET Hardware and Software Manual . provided for use with subsequent VIs.vi Purpose Reads the state of FlexRay communication using an XNET session. the interface transitions to this Ready state.vi. in that it is not configured and is not attempting to communicate with other nodes (ECUs).vi XNET Read (State FlexRay Comm). Assuming the properties are valid. This session is selected from the LabVIEW project or returned from XNET Create Session. error in is the error cluster input (refer to Error Handling). Format Inputs session in is the session to read. Outputs session out is the same as session in.

Halt (4) Communication halted due to synchronization problems. Normal Passive (3) Frame reception is allowed. Config (15) This state is transitional when configuration is valid. it typically indicates a problem with the configuration. the interface can transition to Normal Active. If synchronization improves. but frame transmission is disabled due to degraded synchronization with the cluster remainder. and no frame values are received or transmitted.vi to read the time when the FlexRay interface entered Ready. If the integration succeeds.vi to read the time when the FlexRay entered Normal Active. If integration succeeds. the interface transitions to Normal Active. If you detect this state after starting the interface. the interface can transition from this state to Normal Passive. NI-XNET Hardware and Software Manual 4-156 ni. If synchronization continues to degrade. Normal Active (2) This is the normal operation state. you must restart the NI-XNET sessions. up to 200 ms. When the FlexRay interface is in Halt state.vi FlexRay cycles. it transitions from Halt to Default Config state. you can use XNET Read (State Time Comm). To restart the FlexRay interface. The NI-XNET interface is adequately synchronized to the cluster to allow continued frame transmission without disrupting the transmissions of other nodes (ECUs). If you clear (close) all NI-XNET sessions for the interface.com . If synchronization problems occur. You can use XNET Read (State Time Start). all NI-XNET sessions for the interface stop. the interface transitions to Halt.Chapter 4 NI-XNET API for LabVIEW — XNET Read (State FlexRay Comm).

fault? indicates that a fault occurred. In the FlexRay specification. For more information about the FlexRay POC state. If this count reaches the value in the XNET cluster FlexRay:Max Without Clock Correction Fatal property. This count increments while the FlexRay interface is in POC state Error Passive. In the FlexRay specification. In the FlexRay specification. check your FlexRay cluster and interface properties. the FlexRay interface POC state transitions from Normal Active to Normal Passive state. If no fault is returned. this value is referred to as vAllowPassiveToActive. You can check the validity of these properties using the NI-XNET Database Editor.vi Check the fault? output for a fault. and its code is available is fault code. clock correction failed returns the number of consecutive even/odd cycle pairs that have occurred without successful clock synchronization. this value is referred to as vClockCorrectionFailed. the interface POC state transitions to Normal Active. the fault code is 0. If this count reaches the value in the XNET Cluster FlexRay:Max Without Clock Correction Passive property. this value is referred to as the Protocol Operation Control (POC) state. refer to Appendix B. © National Instruments Corporation 4-157 NI-XNET Hardware and Software Manual . If fault? is false. which displays invalid configuration properties. passive to active count returns the number of consecutive even/odd cycle pairs that have occurred with successful clock synchronization.Chapter 4 NI-XNET API for LabVIEW — XNET Read (State FlexRay Comm). fault code returns a numeric code you can use to obtain a fault description. If the count reaches the value in the XNET Session Interface:FlexRay:Allow Passive to Active property. Summary of the FlexRay Standard. the FlexRay interface POC state transitions from Normal Passive to Halt state.

you intentionally may introduce noise into the FlexRay cables to test how your ECU behaves under these conditions. When you do this.vi error code input and view the resulting message. You also can bundle the fault code into a LabVIEW error cluster as the code element and use front panel features to view the error description. it can apply to multiple sessions. The fault cause may be related to FlexRay communication. For example. error out is the error cluster output (refer to Error Handling). To obtain a fault description fault. Your application can use XNET Read (State FlexRay Comm).Chapter 4 NI-XNET API for LabVIEW — XNET Read (State FlexRay Comm).vi to read the FlexRay network state quickly as data. you do not want the error out of NI-XNET VIs to return errors. XNET Read (State FlexRay Comm). Although faults are extremely rare. Description You can use XNET Read (State FlexRay Comm). Your application can use XNET Read (State FlexRay Comm). because this may cause your application to stop.vi with any XNET session mode. so that it does not introduce errors into the flow of your LabVIEW VIs.vi to check for problems on the FlexRay network independently from the other aspects of your application. NI-XNET Hardware and Software Manual 4-158 ni. Because the state reflects the FlexRay interface. but it also can be related to XNET hardware. wire the fault code into the LabVIEW Simple Error Handler.vi A fault is an error that occurs asynchronously to the NI-XNET VIs your application calls. such as a fault in the onboard processor.vi provides a detection method distinct from the error out of NI-XNET VIs.com . as long as the session interface is FlexRay. yet easy to use alongside the common practice of checking the communication state.

The XNET Cluster FlexRay:Cycle property returns the cycle length in microseconds. the current cycle counter is referred to as vCycleCounter.vi XNET Read (State FlexRay Cycle Macrotick).vi Purpose Reads the current FlexRay global time using an XNET session.vi. macrotick returns the current FlexRay macrotick. In the FlexRay specification. Format Inputs session in is the session to read. This session is selected from a LabVIEW project or returned from XNET Create Session.vi instance ranges from 0 to (FlexRay:Macro Per Cycle – 1). In the FlexRay specification. provided for use with subsequent VIs. error in is the error cluster input (refer to Error Handling). © National Instruments Corporation 4-159 NI-XNET Hardware and Software Manual . cycle returns the current FlexRay cycle counter. The XNET Cluster FlexRay:Macro Per Cycle property returns the number of macroticks in the cycle. the current macrotick is referred to as vMacrotick. Outputs session out is the same as session in.Chapter 4 NI-XNET API for LabVIEW — XNET Read (State FlexRay Cycle Macrotick). The cycle counter range is 0–63. The current macrotick returned from this XNET Read. error out is the error cluster output (refer to Error Handling). The XNET Cluster FlexRay:Macrotick property returns the macrotick length in floating-point seconds.

you must connect FlexRay global time as the FlexRay interface timebase source. To do this. Because the state reflects the FlexRay interface.vi instance with any XNET session mode. you can read the current FlexRay global time to measure performance or synchronize LabVIEW code to additional macroticks in the cycle.vi instance returns an error.vi Description Global time represents the timebase that all ECUs on the FlexRay network cluster share. The FlexRay Cycle timing source enables a LabVIEW timed loop to execute at a specific macrotick within the cycle. For this VI to operate properly. When using LabVIEW Real-Time. For more information about global time. You can use this XNET Read. Summary of the FlexRay Standard. Only one FlexRay Cycle timing source is allowed within the cycle. The global time components are the current cycle counter and macrotick within the cycle. this XNET Read.Chapter 4 NI-XNET API for LabVIEW — XNET Read (State FlexRay Cycle Macrotick). refer to Appendix B. as long as the session interface is FlexRay. If the terminals are not connected in this manner.vi with a source of FlexRay Macrotick and destination of Master Timebase.com . NI-XNET Hardware and Software Manual 4-160 ni.vi. You use sync frames to synchronize the global time. it can apply to multiple sessions. Within the timed loop. this VI often is useful in conjunction with XNET Create Timing Source (FlexRay Cycle). you must call XNET Connect Terminals.

error in is the error cluster input (refer to Error Handling). A frame is decoded in the symbol window or in the network idle time. FlexRay statistics returns a LabVIEW cluster that contains the statistical elements. Outputs session out is the same as session in.Chapter 4 NI-XNET API for LabVIEW — XNET Read (State FlexRay Statistics). dynamic segment. This session is selected from a LabVIEW project or returned from XNET Create Session.vi. num syntax error ch B is the number of syntax errors that have occurred on channel B since communication started. A syntax error occurs if: • • • • • • A node starts transmitting while the channel is not in the idle state.vi Purpose Reads statistics for FlexRay communication using an XNET session. provided for use with subsequent VIs. The elements are: num syntax error ch A is the number of syntax errors that have occurred on channel A since communication started. or network idle time.vi XNET Read (State FlexRay Statistics). A frame is received within the slot after reception of a semantically correct frame (two frames in one slot). Two or more symbols are received within the symbol window. Format Inputs session in is the session to read. A symbol is decoded in the static segment. © National Instruments Corporation 4-161 NI-XNET Hardware and Software Manual . There is a decoding error.

num content error ch B is the number of content errors that have occurred on channel B since communication started. A frame ID encoded in the frame header does not match the current slot. as long as the session’s interface is FlexRay. the Null indicator is 0. num slot boundary violation ch B is the number of slot boundary violations that have occurred on channel B since communication started. Because the state reflects the FlexRay interface.com . In a static segment. the Startup indicator (bit) is 1 while the Sync indicator is 0. A slot boundary violation error occurs if the interface does not consider the channel to be idle at the boundary of a slot (either beginning or end). In a dynamic segment. error out is the error cluster output (refer to Error Handling). Description You can use this XNET Read. Summary of the FlexRay Standard.vi num content error ch A is the number of content errors that have occurred on channel A since communication started. the Sync indicator is 1. The statistical information is updated during the Network Idle Time (NIT) of each FlexRay cycle. For more information about these statistics.vi instances. Like other XNET Read. it can apply to multiple sessions. In a dynamic segment.vi instance with any XNET session mode. the Startup indicator is 1. so it is appropriate for real-time loops. this VI executes quickly. refer to Appendix B. A content error occurs if: • • • • • • • In a static segment. In a dynamic segment. NI-XNET Hardware and Software Manual 4-162 ni. num slot boundary violation ch A is the number of slot boundary violations that have occurred on channel A since communication started. A cycle count encoded in the frame’s header does not match the current cycle count.Chapter 4 NI-XNET API for LabVIEW — XNET Read (State FlexRay Statistics). the payload length of a frame does not match the global cluster property.

vi. If the interface is not communicating when this read is called. this VI captures and returns the time. © National Instruments Corporation 4-163 NI-XNET Hardware and Software Manual . The timestamp at which this integration starts is available using XNET Read (State Time Start). For the FlexRay protocol. the communication controller begins to integrate with ECUs in the network. Because the time is associated with the interface.vi instance returns time as a LabVIEW absolute timestamp data type. This XNET Read. error out is the error cluster output (refer to Error Handling). This session is selected from a LabVIEW project or returned from XNET Create Session. Once the XNET interface is fully integrated and communicating on the network (transmitting and receiving frames). error in is the error cluster input (refer to Error Handling). For the CAN protocol. time communicating returns an invalid time (0). it can apply to multiple sessions. the time difference can be many milliseconds due to factors such as clock synchronization and cycle length. This represents the time at which communication began. Format Inputs session in is the session to read. Description You can use this XNET Read.Chapter 4 NI-XNET API for LabVIEW — XNET Read (State Time Comm). Outputs session out is the same as session in.vi Purpose Reads the time at which the session’s interface completed its integration with the network cluster. provided for use with subsequent VIs.vi instance with any XNET session mode. time communicating returns the communication time of the interface as a LabVIEW absolute timestamp. After your application starts the XNET interface hardware. the time difference between Start and Communicating is very small.vi.vi XNET Read (State Time Comm).

vi XNET Read (State Time Current).vi. provided for use with subsequent VIs.vi Purpose Reads the current interface timestamp using an XNET session.vi. You use the timebase source to timestamp frames the interface receives. it can apply to multiple sessions. refer to XNET Connect Terminals.vi returns time as a LabVIEW absolute timestamp data type. time current returns the current interface timestamp as a LabVIEW absolute time. The timestamp represents absolute time that the interface timebase source drives. so this timestamp can drift relative to the LabVIEW time used for internally sourced timed loops and Get Date/Time in Seconds. The interface timebase source is not necessarily connected to the LabVIEW CPU clock. time current returns an invalid time (0). This session is selected from the LabVIEW project or returned from XNET Create Session. XNET Read (State Time Current). NI-XNET Hardware and Software Manual 4-164 ni.com .Chapter 4 NI-XNET API for LabVIEW — XNET Read (State Time Current). you use the timebase source to schedule cyclic frame transmit. error out is the error cluster output (refer to Error Handling). For more information about the interface timebase source. Format Inputs session in is the session to read. Outputs session out is the same as session in.vi is called.vi. error in is the error cluster input (refer to Error Handling). Because the time is associated with the interface. For a CAN interface. Description You can use XNET Read (State Time Current). If the interface is not started when XNET Read (State Time Current).vi with any XNET session mode.

vi. error in is the error cluster input (refer to Error Handling). If the interface is not started when XNET Read (State Time Start). you start the interface using XNET Start.vi. XNET Read (State Time Start). time start returns an invalid time (0).vi returns time as a LabVIEW absolute timestamp data type. If you use XNET Connect Terminals. it can apply to multiple sessions. If you set Auto Start? to false. Description You can use XNET Read (State Time Start). © National Instruments Corporation 4-165 NI-XNET Hardware and Software Manual .vi is called. Your application typically starts the interface simply by calling XNET Read. time start returns the interface start time as a LabVIEW absolute timestamp. all sessions for that interface wait for the trigger to occur before starting the interface.Chapter 4 NI-XNET API for LabVIEW — XNET Read (State Time Start).vi XNET Read (State Time Start).vi to import a start trigger for the interface.vi with any XNET session mode. Format Inputs session in is the session to read. Outputs session out is the same as session in. provided for use with subsequent VIs. error out is the error cluster output (refer to Error Handling). because the XNET Session Auto Start? property is true by default.vi Purpose Reads the time when the session interface started its integration.vi or XNET Write.vi. This session is selected from the LabVIEW project or returned from XNET Create Session. Because the time is associated with the interface.

Unless you connect a start trigger. the communication controller begins to integrate with ECUs in the network. After the XNET interface starts. so this VI may not be useful. That time often is useful for FlexRay. After this integration is complete. this time generally is known.vi. the time is captured and available using XNET Read (State Time Comm).Chapter 4 NI-XNET API for LabVIEW — XNET Read (State Time Start).vi Once the interface starts. this VI captures and returns the time.com . because it indicates the time when true communication began. NI-XNET Hardware and Software Manual 4-166 ni.

• • © National Instruments Corporation 4-167 NI-XNET Hardware and Software Manual . The XNET Write.vi: The session uses a FlexRay interface.vi: The session mode is Signal Output Waveform.Chapter 4 NI-XNET API for LabVIEW — XNET Write. The XNET Write. XNET Write (Frame Raw). XNET Write (Signal Waveform). Description The instances of this polymorphic VI specify the type of data provided.vi to transmit onto the network.vi: The session mode is Signal Output Single-Point. The XNET Write. There are two categories of XNET Write instance VIs: • Signal: Use when the session mode is Signal Output. Frame: Use when the session mode is Frame Output.vi are optimized for real-time performance. XNET Write (Frame CAN). the instance is Signal Waveform when the mode is Signal Output Waveform). XNET Write (Frame FlexRay).vi instance specifies the desired data type for frames and is not related to the mode.vi instances are asynchronous.vi: The session mode is Signal Output XY. use the CAN or FlexRay instance. but the XNET Write. For an easy-to-use data type. XNET Write.vi instance must match the mode exactly (for example. or Frame Output Queued Mode. Frame Output Single-Point Mode.vi: A data type for frame output that is protocol independent and more efficient than the CAN and FlexRay instances. and the mode is Frame Output Stream Mode.vi Purpose Writes data to the network using an XNET session. Frame Output Single-Point Mode. in that data is written to a hardware buffer. XNET Write (Signal XY). XNET Read.vi XNET Write.vi: The session uses a CAN interface.vi and XNET Write. use XNET Wait (Transmit Complete).vi executes quickly and avoids access to shared resources that can induce jitter on other VI priorities. If you need to wait for the data provided to XNET Write.vi returns before the corresponding frames are transmitted onto the network.vi. and the mode is Frame Output Stream Mode. or Frame Output Queued Mode. • The XNET Write instance VIs are: • • • • XNET Write (Signal Single-Point).

Each signal value is scaled. For an example of how this data applies to network traffic. If XNET Write (Signal Single-Point).vi. Format Inputs session in is the session to write. data provides a one-dimensional array of signal values. The session mode must be Signal Output Single-Point. error out is the error cluster output (refer to Error Handling). Each array element corresponds to a signal configured for the session. This session is selected from the LabVIEW project or returned from XNET Create Session.com .vi is called twice before the next transmit.vi XNET Write (Signal Single-Point). refer to Signal Output Single-Point Mode.Chapter 4 NI-XNET API for LabVIEW — XNET Write (Signal Single-Point). the transmitted frame uses signal values from the second call to XNET Write (Signal Single-Point). provided for use with subsequent VIs. error in is the error cluster input (refer to Error Handling). 64-bit floating point. Outputs session out is the same as session in.vi. The data provides the value for the next transmit of each signal. NI-XNET Hardware and Software Manual 4-168 ni.vi Purpose Writes data to a session of Signal Output Single-Point Mode. The order of signals in the array corresponds to the order in the session list.

refer to the XNET Session Number of Values Unused property to determine the actual amount of queue space available for writing. © National Instruments Corporation 4-169 NI-XNET Hardware and Software Manual . The data represents a waveform of resampled values for each signal in the session. XNET Write (Signal Waveform). The session mode must be Signal Output Waveform.vi. To write more data. The waveform elements are: t0 is the waveform start time.vi returns an error.Chapter 4 NI-XNET API for LabVIEW — XNET Write (Signal Waveform). This start time is unused (reserved) for Signal Output Waveform mode. For an example of how this data applies to network traffic. Using the default queue configuration for this mode. Each array element corresponds to a signal configured for the session. This session is selected from the LabVIEW project or returned from XNET Create Session. This is a LabVIEW relative time that specifies the time between each sample in the Y array. you can safely write 64 frames if you have a sufficiently long timeout. If you change it from its default value of 0 (invalid). and assuming a 1000 Hz resample rate.vi Purpose Writes data to a session of Signal Output Waveform Mode. data provides a one-dimensional array of LabVIEW waveforms. This is a LabVIEW absolute timestamp. refer to Signal Output Waveform Mode. dt is the waveform delta time. Format Inputs session in is the session to write. The order of signals in the array corresponds to the order in the session list. The data you write is queued up for transmit on the network.vi XNET Write (Signal Waveform).

vi returns an error.Chapter 4 NI-XNET API for LabVIEW — XNET Write (Signal Waveform). a timeout error is returned. This input is optional. error in is the error cluster input (refer to Error Handling). If you change it from its default value of 0. If the space is not available prior to the timeout. NI-XNET Hardware and Software Manual 4-170 ni. if a timeout error occurs. The default value is 10. represented as 64-bit floating-point in units of seconds. Outputs session out is the same as session in. because the size determines the total timeline for XNET Write (Signal Waveform). none of the data is queued.com . If the Y array sizes are not the same. XNET Write (Signal Waveform).vi waits up to that timeout for space to become available in queues. The timeout is a LabVIEW relative time.vi returns an error.vi. XNET Write (Signal Waveform).0 (10 seconds). error out is the error cluster output (refer to Error Handling). If timeout is positive.vi does not wait and immediately returns an error if all data cannot be queued. XNET Write (Signal Waveform). XNET Write (Signal Waveform).vi LabVIEW relative time is represented as 64-bit floating point in units of seconds. 64-bit floating point. The timeout does not wait for frames to be transmitted on the network (refer to XNET Wait (Transmit Complete). Each signal value is scaled.vi again at a later time with the same data. Y is the array of resampled signal values. This delta time is unused (reserved) for Signal Output Waveform mode. provided for use with subsequent VIs. If timeout is 0. timeout is the time to wait for the data to be queued for transmit. Regardless of the timeout used. If timeout is negative.vi waits indefinitely for space to become available in queues.vi). The Y array size must be the same for all waveforms. so you can attempt to call XNET Write (Signal Waveform). XNET Write (Signal Waveform).

The order of signals in the array corresponds to the order in the session list.Chapter 4 NI-XNET API for LabVIEW — XNET Write (Signal XY). the array sizes may be different from one cluster (signal) to another. When signals exist in different frames. The cluster elements are: timestamp is the array of LabVIEW timestamps. one for value. The data you write is queued up for transmit on the network. refer to Signal Output XY Mode.vi returns an error. If you change it from its default value of empty. XNET Write (Signal XY).. Each value is mapped to a frame for transmit. refer to the XNET Session Number of Values Unused property to determine the actual amount of queue space available for writing. The timestamp array is unused (reserved) for Signal Output XY. © National Instruments Corporation 4-171 NI-XNET Hardware and Software Manual .vi XNET Write (Signal XY). For an example of how this data applies to network traffic. The session mode must be Signal Output XY. Each array element corresponds to a signal configured for the session. Using the default queue configuration for this mode.vi Purpose Writes data to a session of Signal Output XY Mode. To write more data. you can safely write 64 elements if you have a sufficiently long timeout. Format Inputs session in is the session to write. data provides an array of LabVIEW clusters. This session is selected from the LabVIEW project or returned from XNET Create Session. The data represents a sequence of signal values for transmit using each frame’s timing as the database specifies.vi. Each cluster contains two arrays. and one for timestamp.

XNET Write (Signal XY).vi again at a later time with the same data. Each signal value is scaled. The timeout is a LabVIEW relative time. The timeout does not wait for frames to be transmitted on the network (refer to XNET Wait (Transmit Complete). error out is the error cluster output (refer to Error Handling). so you can attempt to call XNET Write (Signal XY). error in is the error cluster input (refer to Error Handling). If the space is not available prior to the timeout.vi waits indefinitely for space to become available in queues.Chapter 4 NI-XNET API for LabVIEW — XNET Write (Signal XY). The default value is 10. if a timeout error occurs. provided for use with subsequent VIs. If timeout is 0. one for each frame that contains the signal. a timeout error is returned. If timeout is positive. 64-bit floating point. represented as 64-bit floating-point in units of seconds. timeout is the time to wait for the data to be queued for transmit. Frame transmission is timed according to the frame properties in the database.vi waits up to that timeout for space to become available in queues. This input is optional.vi). XNET Write (Signal XY).vi does not wait and immediately returns with a timeout error if all data cannot be queued. Outputs session out is the same as session in.vi value is the array of signal values. XNET Write (Signal XY).0 (10 seconds). NI-XNET Hardware and Software Manual 4-172 ni. Regardless of the timeout used.com . If timeout is negative. none of the data is queued.

To write more data.vi XNET Write (Frame CAN). Each array element corresponds to a frame value to transmit.vi. or the CAN protocol specification. or Frame Output Single-Point Mode. refer to the XNET Session Number of Values Unused property to determine the actual amount of queue space available for write. For more information.vi Purpose Writes data to a session as an array of CAN frames. or Frame Output Single-Point Mode. The elements of each cluster are specific to the CAN protocol. refer to Appendix A. the order of frames in the array corresponds to the order in the session list. This session is selected from the LabVIEW project or returned from XNET Create Session. © National Instruments Corporation 4-173 NI-XNET Hardware and Software Manual . Using the default queue configuration for this mode. you can safely write 64 frames if you have a sufficiently long timeout. For a Frame Output Single-Point session mode. Summary of the CAN Standard. or Frame Output Single-Point. Format Inputs session in is the session to write. The session mode must be Frame Output Stream. Frame Output Queued Mode. Frame Output Queued Mode. For an example of how this data applies to network traffic.Chapter 4 NI-XNET API for LabVIEW — XNET Write (Frame CAN). Frame Output Queued. refer to Frame Output Stream Mode. The session must use a CAN interface and Frame Output Stream Mode. The data you write is queued up for transmit on the network. data provides the array of LabVIEW clusters.

You must set this element to the default value. For more information. timestamp represents absolute time using the LabVIEW absolute timestamp type. This is the most commonly used frame type for CAN. When the session mode is Frame Output Single-Point or Frame Output Queued.com . For a transmitted remote frame (CAN Remote type). You can leave all other CAN frame cluster elements uninitialized. payload is the array of data bytes for a CAN data frame. type is the frame type (decimal value in parentheses): CAN Data (0) The CAN data frame contains payload data. extended? is a Boolean value that determines whether the identifier uses extended format (true) or standard format (false). so 11 bits of this identifier are valid. the number of bytes in the payload array must match the Payload Length property of the corresponding frame. but the actual NI-XNET Hardware and Software Manual 4-174 ni. A remote ECU should respond with a CAN data frame for the identifier. Your application transmits a CAN remote frame to request data for the corresponding identifier. Your application provides this payload length by filling payload with the requested number of bytes.vi. The array size indicates the payload length of the frame value to transmit. the identifier uses standard format. the identifier uses extended format. echo? is not used for transmit. refer to the section for each mode. invalid (0). timestamp is not used for transmit. This enables your application to specify the frame payload length. If extended? is false. According to the CAN protocol. CAN Remote (1) CAN remote frame. You must set this element to false. the payload length in the frame value specifies the number of payload bytes requested. If extended? is true. so 29 bits of this identifier are valid.Chapter 4 NI-XNET API for LabVIEW — XNET Write (Frame CAN). which you can obtain using XNET Read. the payload length range is 0–8.vi The cluster elements are: identifier is the CAN frame arbitration identifier.

a timeout error is returned. timeout does not apply.Chapter 4 NI-XNET API for LabVIEW — XNET Write (Frame CAN).vi does not wait and immediately returns with a timeout error if all data cannot be queued. if a timeout error occurs. error out is the error cluster output (refer to Error Handling).vi again at a later time with the same data. Frame Output Queued Mode: Array of frame values to transmit for the single frame specified in the list.0. The default value is 10. If timeout is positive.vi values in the payload bytes are ignored (not contained in the transmitted frame). you must set timeout to 0. If timeout is negative. If the space is not available prior to the timeout. This input is optional. Description The data represents an array of CAN frames. error in is the error cluster input (refer to Error Handling).vi waits up to that timeout for space to become available in queues.vi waits indefinitely for space to become available in queues. Frame Output Single-Point Mode: Array of single frame values. © National Instruments Corporation 4-175 NI-XNET Hardware and Software Manual . If timeout is 0. so you can attempt to call XNET Write (Frame CAN). one for each frame specified in the list. Regardless of the timeout used. none of the data is queued. represented as 64-bit floating-point in units of seconds. If the session mode is Frame Output Single-Point. provided for use with subsequent VIs. The CAN frames are associated to the session’s list of frames as follows: • • • Frame Output Stream Mode: Array of all frame values for transmit (list ignored). Each CAN frame uses a LabVIEW cluster with CAN-specific elements.0 (10 seconds). Outputs session out is the same as session in. XNET Write (Frame CAN). Because this mode writes the most recent value of each frame. The timeout is a LabVIEW relative time. timeout is the time to wait for the CAN frame data to be queued up for transmit. XNET Write (Frame CAN). XNET Write (Frame CAN).

NI-XNET Hardware and Software Manual 4-176 ni. Frame Output Queued Mode. or Frame Output Single-Point. or Frame Output Single-Point Mode. Format Inputs session in is the session to write. The elements of each cluster are specific to the FlexRay protocol. For more information. refer to the XNET Session Number of Values Unused property to determine the actual amount of queue space available for write. the order of frames in the array corresponds to the order in the session list. or the FlexRay Protocol Specification. Using the default queue configuration for this mode. To write more data.Chapter 4 NI-XNET API for LabVIEW — XNET Write (Frame FlexRay). refer to Appendix B.vi Purpose Writes data to a session as an array of FlexRay frames. The session must use a FlexRay interface and Frame Output Stream Mode. refer to Frame Output Stream Mode. The data you write is queued up for transmit on the network. The session mode must be Frame Output Stream. you can safely write 64 frames if you have a sufficiently long timeout.vi XNET Write (Frame FlexRay).com . For an example of how this data applies to network traffic.vi. Frame Output Queued Mode. data provides the array of LabVIEW clusters. Frame Output Queued. Summary of the FlexRay Standard. Each array element corresponds to a frame value to transmit. or Frame Output Single-Point Mode. and assuming frames with 8 bytes of payload. This session is selected from the LabVIEW project or returned from XNET Create Session. For a Frame Input Single-Point session mode.

startup? is a Boolean value that specifies whether the frame is a startup frame (true) or not (false). If the frame is in the static segment. chB is a Boolean value that specifies whether to transmit the frame on channel B (true) or not (false). chA is a Boolean value that specifies whether to transmit the frame on channel A (true) or not (false).Chapter 4 NI-XNET API for LabVIEW — XNET Write (Frame FlexRay). If preamble? is false. cycle count specifies the cycle number. As specified in the XNET Frame FlexRay:Timing Type property. The message ID is always 2 bytes in length. type is not used for transmit. © National Instruments Corporation 4-177 NI-XNET Hardware and Software Manual . You must set this element to false. The XNET Cluster FlexRay:Network Management Vector Length property specifies the number of bytes at the beginning. type is the frame type. All frame values are assumed to be the FlexRay Data type. the FlexRay null frame is transmitted when a cyclically timed frame does not have new data. sync? is a Boolean value that specifies whether the frame is a sync frame (true) or not (false). preamble? is a Boolean value that specifies the value of the payload preamble indicator in the frame header.vi The cluster elements are: slot specifies the slot number within the FlexRay cycle. then rolls over back to 0. preamble? being true indicates the presence of a message ID at the beginning of the payload. preamble? being true indicates the presence of a network management vector at the beginning of the payload. The FlexRay cycle count increments from 0 to 63. If the frame is in the dynamic segment. the payload does not contain a network management vector or a message ID. Frames of FlexRay Data type contain payload data. The FlexRay Null type is not transmitted based on this type. echo? is not used for transmit. so you must leave this element uninitialized.

Because this mode writes the most recent value of each frame. error in is the error cluster input (refer to Error Handling).0 (10 seconds). If timeout is negative. timeout does not apply. represented as 64-bit floating-point in units of seconds. XNET Write (Frame FlexRay). The timeout is a LabVIEW relative time. so you can attempt to call XNET Write (Frame FlexRay). The slot and cycle count specify when the frame transmits in FlexRay global time. a timeout error is returned. If timeout is positive. If the space is not available prior to the timeout. timeout is the time to wait for the FlexRay frame data to be queued up for transmit.com . you must set timeout to 0. payload is the array of data bytes for FlexRay frames of type FlexRay Data. timestamp is not used for transmit. According to the FlexRay protocol.vi timestamp represents absolute time using the LabVIEW absolute timestamp type.0. The default value is 10. Regardless of the timeout used. the length range is 0–254.vi again at a later time with the same data. If timeout is 0. NI-XNET Hardware and Software Manual 4-178 ni.vi waits indefinitely for space to become available in queues. If the session mode is Frame Output Single-Point. XNET Write (Frame FlexRay). This input is optional. For more information. the number of bytes in the payload array must match the Payload Length property of the corresponding frame.Chapter 4 NI-XNET API for LabVIEW — XNET Write (Frame FlexRay). The array size indicates the payload length of the frame value to transmit. When the session mode is Frame Output Single-Point or Frame Output Queued. if a timeout error occurs. You can leave all other FlexRay frame cluster elements uninitialized.vi waits up to that timeout for space to become available in queues. refer to the section for each mode. none of the data is queued. invalid (0). You must set this element to the default value.vi does not wait and immediately returns with a timeout error if all data cannot be queued. XNET Write (Frame FlexRay).

Chapter 4 NI-XNET API for LabVIEW — XNET Write (Frame FlexRay). provided for use with subsequent VIs. © National Instruments Corporation 4-179 NI-XNET Hardware and Software Manual . The FlexRay frames are associated to the session’s list of frames as follows: • • • Frame Output Stream Mode: Array of all frame values for transmit (list ignored). Each FlexRay frame uses a LabVIEW cluster with FlexRay-specific elements. error out is the error cluster output (refer to Error Handling). one for each frame specified in the list.vi Outputs session out is the same as session in. Description The data represents an array of FlexRay frames. Frame Output Single-Point Mode: Array of single frame values. Frame Output Queued Mode: Array of frame values to transmit for the single frame specified in the list.

Format Inputs session in is the session to write. The raw bytes encode one or more frames using the Raw Frame Format. For information about which elements of the raw frame are applicable. if a complete raw frame is 24 bytes.vi XNET Write (Frame Raw). This session is selected from the LabVIEW project or returned from XNET Create Session. The session mode must be Frame Output Stream Mode. when you write CAN frames for a Frame Output Queued session. refer to the XNET Write. For example.Chapter 4 NI-XNET API for LabVIEW — XNET Write (Frame Raw). you can write 12 bytes. you can write data for a partial frame. you can safely write 1536 frames if you have a sufficiently long timeout. then write the next 12 bytes. You typically do this when you are reading raw frame data from a logfile and want to avoid iterating through the data to detect the start and end of each frame. representing frames to transmit. If needed.vi). Frame Output Queued Mode. This frame format is the same for read and write of raw data and also is used for log file examples. refer to the XNET Session Number of Values Unused property to determine the actual amount of queue space available for writing. For example.vi or XNET Write (Frame FlexRay). NI-XNET Hardware and Software Manual 4-180 ni. data provides the array of bytes.vi instance for the protocol in use (XNET Write (Frame CAN). To write more data.com .vi. The data you write is queued up for transmit on the network. the payload length in the raw frame data must match the payload length property for the frame. Using the default queue configuration for this mode. or Frame Output Single-Point Mode.vi Purpose Writes data to a session as an array of raw bytes.

The raw frame format is protocol independent.0. none of the data is queued. XNET Write (Frame Raw). so the session can use either a CAN or FlexRay interface.vi For an example of how this data applies to network traffic. error out is the error cluster output (refer to Error Handling). so you can attempt to call XNET Write (Frame Raw). provided for use with subsequent VIs. XNET Write (Frame Raw). a timeout error is returned. Description The raw bytes encode one or more frames using the Raw Frame Format. it is more efficient with regard to performance. refer to Frame Output Stream Mode. If the space is not available prior to the timeout. timeout does not apply. represented as 64-bit floating-point in units of seconds.0 (10 seconds).vi waits up to that timeout for space to become available in queues. if a timeout error occurs.vi waits indefinitely for space to become available in queues. © National Instruments Corporation 4-181 NI-XNET Hardware and Software Manual . XNET Write (Frame Raw).vi does not wait and immediately returns with a timeout error if all data cannot be queued. Regardless of the timeout used.Chapter 4 NI-XNET API for LabVIEW — XNET Write (Frame Raw). Frame Output Queued Mode. Because it is not converted to/from LabVIEW clusters for ease of use. Outputs session out is the same as session in.vi again at a later time with the same data. The timeout is a LabVIEW relative time. If the session mode is Frame Output Single-Point. If timeout is 0. This input is optional. you must set timeout to 0. The default value is 10. The session must use a mode of Frame Output Stream. This instance typically is used to read raw frame data from a log file and write the data to the interface for transmit (replay). If timeout is positive. timeout is the time to wait for the raw data to be queued up for transmit. or Frame Output Single-Point Mode. Frame Output Queued. error in is the error cluster input (refer to Error Handling). Because this mode writes the most recent value of each frame. If timeout is negative. or Frame Output Single-Point. The raw frame format matches the format of data transferred to/from the XNET hardware.

NI-XNET Hardware and Software Manual 4-182 ni. one for each frame specified in the list.Chapter 4 NI-XNET API for LabVIEW — XNET Write (Frame Raw).vi The raw frames are associated to the session’s list of frames as follows: • • • Frame Output Stream Mode: Array of all frame values for transmit (list ignored). Frame Output Single-Point Mode: Array of single frame values. Frame Output Queued Mode: Array of frame values to transmit for the single frame specified in the list.com .

You can use these functions to retrieve information from database files. create new database objects in LabVIEW. © National Instruments Corporation 4-183 NI-XNET Hardware and Software Manual . open the main LabVIEW help (select Search the LabVIEW Help from the Help menu) and look for the Property Nodes topic in the index. Pull down this node to add properties. XNET Database Property Node Format Description Property node used to read/write properties for an XNET Database I/O Name. control. or indicator.Chapter 4 NI-XNET API for LabVIEW — Database Subpalette Database Subpalette This subpalette includes functions for accessing databases that specify the embedded network configuration. Right-click each property name to create a constant. For more information about LabVIEW property nodes. For help on a specific property. and edit and save new database files. open the LabVIEW context help window (<Ctrl-H>) and move your cursor over the property name. Right-click to change direction between read and write. including frame and signal data that is transferred.

dbc) contain only one cluster with the name CAN_Cluster. FIBEX files can contain any number of clusters.com . cluster protocol or cluster frames). You cannot change this assignment afterwards. A cluster is assigned to a database when the cluster object is created.ncd and . You can use an array element to read or write the cluster properties (for example.Chapter 4 NI-XNET API for LabVIEW — XNET Database Property Node Clusters Data Type Direction Read Only Required? Default N/A N/A Property Class XNET Database Short Name Clsts Description Returns an array of refnums to XNET Clusters in this database. Refer to XNET Cluster I/O Name for information about using XNET I/O names. NI-XNET Hardware and Software Manual 4-184 ni. CAN databases (.

XNET Cluster Frames. For valid objects. For example. the XNET Cluster Configuration Status. meaning that invalid clusters. you must set the property to true prior to reading the XNET Database Clusters. frames. then you set the Start Bit beyond the payload length. © National Instruments Corporation 4-185 NI-XNET Hardware and Software Manual . In case the database was opened to correct invalid configuration (for example. XNET Cluster Frames. and signals are incorrectly defined and therefore cannot be used in the bus communication. Invalid clusters. and XNET Signal Configuration Status properties return an error code that explains the problem. and XNET Frame Signals properties. frames. the Configuration Status returns an error. The false setting is recommended when you use the database to create XNET sessions. in a database editor). frames. For invalid objects. XNET Frame Configuration Status. and XNET Frame Signals properties. Clusters. XNET Cluster Frames.Chapter 4 NI-XNET API for LabVIEW — XNET Database Property Node ShowInvalidFromOpen? Data Type Direction Read/Write Required? Default No False Property Class XNET Database Short Name ShowInvalid? Description Shows frames and signals that are invalid at database open time. but the frame is returned from XNET Cluster Frames. After opening a database. this property always is set to false. and signals are not returned in the XNET Database Clusters. even if ShowInvalidFromOpen? is false and Configuration Status returns an error code. Configuration Status returns success (no error). and signals that became invalid after the database is opened are still returned from the XNET Database Clusters. and XNET Frame Signals properties. if you open the frame with valid properties.

Right-click each property name to create a constant. For a complete description. prior to running the VI. then select a database. For help on a specific property. You can change constants only during configuration. You drag a constant to the block diagram of your VI. XNET Cluster Property Node Format Description Property node used to read/write properties for an XNET Cluster I/O Name. or indicator. Right-click to change direction between read and write. control. For more information about LabVIEW property nodes. NI-XNET Hardware and Software Manual 4-186 ni.com . refer to XNET Database I/O Name. Pull down this node to add properties.Chapter 4 NI-XNET API for LabVIEW — XNET Database Constant XNET Database Constant This constant provides the constant form of the XNET Database I/O name. open the LabVIEW context help window (<Ctrl-H>) and move your cursor over the property name. open the main LabVIEW help (select Search the LabVIEW Help from the Help menu) and look for the Property Nodes topic in the index.

The action point is that point within a given slot where the actual transmission of a frame starts. The property does not contain a default in this case.Chapter 4 NI-XNET API for LabVIEW — XNET Cluster Property Node FlexRay Properties This section includes the XNET Cluster FlexRay properties. If the property does not contain a valid value. so you must set a valid value prior to creating a session. To ensure that the property contains a valid value. For more information about using database files and in-memory databases. refer to Databases. the session returns an error. This is slightly later than the start of the slot. This is needed when you create your own in-memory database (:memory:) rather than use a file. © National Instruments Corporation 4-187 NI-XNET Hardware and Software Manual . The file formats require a valid value in the text for this property. This property corresponds to the global cluster parameter gdActionPointOffset in the FlexRay Protocol Specification. you can do one of the following: • • Use a database file (or alias) to create the session. This property is required. FlexRay:Action Point Offset Data Type Direction Read/Write Required? Default Yes Read from Database Property Class XNET Cluster Short Name FlexRay. Set a value in LabVIEW using the property node. and you create an XNET session that uses this cluster. The range for this property is 1–63 MT. to allow for a clock drift between the network nodes.ActPtOff Description This property specifies the number of macroticks (MT) that the action point is offset from the beginning of a static slot or symbol window.

CASRxLMax Description This property specifies the upper limit of the collision avoidance symbol (CAS) acceptance window. For more information about using database files and in-memory databases. the session returns an error. you can do one of the following: • • Use a database file (or alias) to create the session. This is needed when you create your own in-memory database (:memory:) rather than use a file. so you must set a valid value prior to creating a session. Set a value in LabVIEW using the property node. The values for this property are in the range 67–99 gdBit. To ensure that the property contains a valid value.com . and you create an XNET session that uses this cluster. A receiving FlexRay interface considers the CAS to be valid if the pattern’s low level is within 29 gdBit (cdCASRxLowMin) and CAS Rx Low Max.Chapter 4 NI-XNET API for LabVIEW — XNET Cluster Property Node FlexRay:CAS Rx Low Max Data Type Direction Read/Write Required? Default Yes Read from Database Property Class XNET Cluster Short Name FlexRay. The file formats require a valid value in the text for this property. NI-XNET Hardware and Software Manual 4-188 ni. The CAS symbol is transmitted by the FlexRay interface (node) during the symbol window within the communication cycle. The property does not contain a default in this case. If the property does not contain a valid value. This property corresponds to the global cluster parameter gdCASRxLowMax in the FlexRay Protocol Specification. refer to Databases. This property is required.

so you must set a valid value prior to creating a session. and you create an XNET session that uses this cluster. refer to Databases.Chapter 4 NI-XNET API for LabVIEW — XNET Cluster Property Node FlexRay:Channels Data Type Direction Read/Write Required? Default Yes Read from Database Property Class XNET Cluster Short Name FlexRay. A FlexRay cluster supports two independent network wires (channels A and B). The values (enumeration) for this property are: 1 2 3 Channel A only Channel B only Channels A and B This property is required. The property does not contain a default in this case. © National Instruments Corporation 4-189 NI-XNET Hardware and Software Manual . Refer to the XNET Frame FlexRay:Channel Assignment property. If the property does not contain a valid value. Set a value in LabVIEW using the property node. the session returns an error. The file formats require a valid value in the text for this property. To ensure that the property contains a valid value. you can do one of the following: • • Use a database file (or alias) to create the session. You can choose to use both or only one in your cluster.Channels Description This property specifies the FlexRay channels used in the cluster. For more information about using database files and in-memory databases. This property corresponds to the global cluster parameter gChannels in the FlexRay Protocol Specification. This is needed when you create your own in-memory database (:memory:) rather than use a file. Frames defined in this cluster are expected to use the channels this property specifies.

based on the longest microtick used in the cluster. refer to Databases. The file formats require a valid value in the text for this property.Chapter 4 NI-XNET API for LabVIEW — XNET Cluster Property Node FlexRay:Cluster Drift Damping Data Type Direction Read/Write Required? Default Yes Read from Database Property Class XNET Cluster Short Name FlexRay. For more information about using database files and in-memory databases. NI-XNET Hardware and Software Manual 4-190 ni. This property corresponds to the global cluster parameter gdClusterDriftDamping in the FlexRay Protocol Specification. and you create an XNET session that uses this cluster. the session returns an error. you can do one of the following: • • Use a database file (or alias) to create the session.ClstDriftDmp Description This property specifies the cluster drift damping factor. Set a value in LabVIEW using the property node. Use this global FlexRay parameter to compute the local cluster drift damping factor for each cluster node. If the property does not contain a valid value. You can access the local cluster drift for the XNET FlexRay interface from the XNET Session Interface:FlexRay:Cluster Drift Damping property. To ensure that the property contains a valid value. The values for this property are in the range 0–5 MT. This is needed when you create your own in-memory database (:memory:) rather than use a file. so you must set a valid value prior to creating a session.com . The property does not contain a default in this case. This property is required.

ColdStAts Description This property specifies the maximum number of times a node in this cluster can start the cluster by initiating schedule synchronization. The file formats require a valid value in the text for this property. This is needed when you create your own in-memory database (:memory:) rather than use a file. Set a value in LabVIEW using the property node. This global cluster parameter is applicable to all cluster notes that can perform a coldstart (send startup frames). To ensure that the property contains a valid value. This property is required. © National Instruments Corporation 4-191 NI-XNET Hardware and Software Manual . For more information about using database files and in-memory databases. The property does not contain a default in this case. If the property does not contain a valid value. the session returns an error. and you create an XNET session that uses this cluster. The values for this property are in the range 2–31.Chapter 4 NI-XNET API for LabVIEW — XNET Cluster Property Node FlexRay:Cold Start Attempts Data Type Direction Read/Write Required? Default Yes Read from Database Property Class XNET Cluster Short Name FlexRay. This property corresponds to the global cluster parameter gColdStartAttempts in the FlexRay Protocol Specification. refer to Databases. so you must set a valid value prior to creating a session. you can do one of the following: • • Use a database file (or alias) to create the session.

This property is required. The communication cycle counts increment from 0–63. The property does not contain a default in this case.Chapter 4 NI-XNET API for LabVIEW — XNET Cluster Property Node FlexRay:Cycle Data Type Direction Read/Write Required? Default Yes Read from Database Property Class XNET Cluster Short Name FlexRay. This property corresponds to the global cluster parameter gdCycle in the FlexRay Protocol Specification. the session returns an error. so you must set a valid value prior to creating a session.com . The range for this property is 10–16000 μs.Cycle Description This property specifies the duration of one FlexRay communication cycle. If the property does not contain a valid value. after which the cycle count resets back to 0. Set a value in LabVIEW using the property node. To ensure that the property contains a valid value. After this time. This is needed when you create your own in-memory database (:memory:) rather than use a file. NI-XNET Hardware and Software Manual 4-192 ni. and you create an XNET session that uses this cluster. All frame transmissions complete within a cycle. The file formats require a valid value in the text for this property. the frame transmissions restart with the first frame in the next cycle. refer to Databases. For more information about using database files and in-memory databases. you can do one of the following: • • Use a database file (or alias) to create the session. expressed in microseconds.

DynSegStart Description This property specifies the start of the dynamic segment. The range for this property is 8–15998 MT. It is set to 0 if the FlexRay:Number of Minislots property is 0 (no dynamic segment exists). expressed as the number of macroticks (MT) from the start of the cycle.Chapter 4 NI-XNET API for LabVIEW — XNET Cluster Property Node FlexRay:Dynamic Segment Start Data Type Direction Read Only Required? Default Yes Calculated from Other Cluster Properties Property Class XNET Cluster Short Name FlexRay. It is based on the total static segment size. This property is calculated from other cluster properties. © National Instruments Corporation 4-193 NI-XNET Hardware and Software Manual .

Chapter 4 NI-XNET API for LabVIEW — XNET Cluster Property Node FlexRay:Dynamic Slot Idle Phase Data Type Direction Read/Write Required? Default Yes Read from Database Property Class XNET Cluster Short Name FlexRay. If the property does not contain a valid value. refer to Databases. NI-XNET Hardware and Software Manual 4-194 ni. For more information about using database files and in-memory databases. To ensure that the property contains a valid value. The values for this property are in the range 0–2 minislots. This property is required. The file formats require a valid value in the text for this property.com . This is needed when you create your own in-memory database (:memory:) rather than use a file. The property does not contain a default in this case. Set a value in LabVIEW using the property node.DynSlotIdlPh Description This property specifies the dynamic slot idle phase duration. and you create an XNET session that uses this cluster. the session returns an error. so you must set a valid value prior to creating a session. you can do one of the following: • • Use a database file (or alias) to create the session. This property corresponds to the global cluster parameter gdDynamicSlotIdlePhase in the FlexRay Protocol Specification.

In other words. this dynamic slot also can transmit with Payload Length Dynamic Maximum. no dynamic slots exist. If the Number of Minislots is zero.Chapter 4 NI-XNET API for LabVIEW — XNET Cluster Property Node FlexRay:Latest Guaranteed Dynamic Slot Data Type Direction Read Only Required? Default Yes Calculated from Other Cluster Properties Property Class XNET Cluster Short Name FlexRay. A larger slot ID cannot be guaranteed to transmit a full-length frame in each cycle (although a frame might go out depending on the dynamic segment load). when all preceding dynamic slots transmit with Payload Length Dynamic Maximum. This read-only property is calculated from other cluster properties. provided all previous slots in the dynamic segment have transmitted full-length frames also. the Number of Minislots is used along with Payload Length Dynamic Maximum to determine the latest dynamic slot guaranteed to transmit in the next cycle. The range for this property is 2–2047 slots. and this property returns 0. Payload Length Dynamic Maximum) frame.LatestGuarDyn Description This property specifies the highest slot ID in the dynamic segment that still can transmit a full-length (for example. Otherwise. and its frame ends prior to the end of the dynamic segment. © National Instruments Corporation 4-195 NI-XNET Hardware and Software Manual .

If the Number of Minislots is zero. Number of Minislots is used along with Payload Length Dynamic Maximum to determine the latest dynamic slot that can be used when all preceding dynamic slots are empty (zero payload length). NI-XNET Hardware and Software Manual 4-196 ni. Otherwise. A larger slot ID cannot transmit a full-length frame (but could probably still transmit a shorter frame).com . The frame for this dynamic slot must end prior to the end of the dynamic segment. provided no other frames have been sent in the dynamic segment. this property is calculated under the assumption that all other dynamic slots use only one minislot. The range for this property is 2–2047. Any frame transmitted in a preceding dynamic slot is likely to preclude this slot’s frame. Payload Length Dynamic Maximum) frame. and this property returns 0. In other words.LatestUsableDyn Description This property specifies the highest slot ID in the dynamic segment that can still transmit a full-length (that is. and this dynamic slot uses the number of minislots required to deliver the maximum payload. no dynamic slots exist.Chapter 4 NI-XNET API for LabVIEW — XNET Cluster Property Node FlexRay:Latest Usable Dynamic Slot Data Type Direction Read Required? Default Yes Calculated from Other Cluster Properties Property Class XNET Cluster Short Name FlexRay. This read-only property is calculated from other cluster properties.

Chapter 4 NI-XNET API for LabVIEW — XNET Cluster Property Node FlexRay:Listen Noise Data Type Direction Read/Write Required? Default Yes Read from Database Property Class XNET Cluster Short Name FlexRay. To ensure that the property contains a valid value. If the property does not contain a valid value. This property corresponds to the global cluster parameter gListenNoise in the FlexRay Protocol Specification. and you create an XNET session that uses this cluster. © National Instruments Corporation 4-197 NI-XNET Hardware and Software Manual . Set a value in LabVIEW using the property node. The values for this property are in the range 2–16. The property does not contain a default in this case.LisNoise Description This property specifies the upper limit for the startup and wakeup listen timeout in the presence of noise. you can do one of the following: • • Use a database file (or alias) to create the session. refer to Databases. so you must set a valid value prior to creating a session. This is needed when you create your own in-memory database (:memory:) rather than use a file. For more information about using database files and in-memory databases. It is used as a multiplier for the Interface:FlexRay:Listen Timeout property. The file formats require a valid value in the text for this property. the session returns an error. This property is required.

and you create an XNET session that uses this cluster. the session returns an error. This property corresponds to the global cluster parameter gMacroPerCycle in the FlexRay Protocol Specification. refer to Databases. Nearly all timing dependent properties are expressed in terms of macroticks. For more information about using database files and in-memory databases. For example.MacroPerCycle Description This property specifies the number of macroticks in a communication cycle. the XNET Cluster FlexRay:Macro Per Cycle property is 5000. Set a value in LabVIEW using the property node. you can do one of the following: • • Use a database file (or alias) to create the session. This is needed when you create your own in-memory database (:memory:) rather than use a file. This property is required. If the property does not contain a valid value. The macrotick (MT) is the basic timing unit in the FlexRay cluster. To ensure that the property contains a valid value. and the duration of a macrotick is 1 μs. so you must set a valid value prior to creating a session. The property does not contain a default in this case.Chapter 4 NI-XNET API for LabVIEW — XNET Cluster Property Node FlexRay:Macro Per Cycle Data Type Direction Read/Write Required? Default Yes Read from Database Property Class XNET Cluster Short Name FlexRay. if the FlexRay cycle has a duration of 5 ms (5000 μs). NI-XNET Hardware and Software Manual 4-198 ni. The range for this property is 10–16000 MT. The file formats require a valid value in the text for this property.com .

This property is calculated from the FlexRay:Cycle and FlexRay:Macro Per Cycle properties and rounded to the nearest permitted value.Chapter 4 NI-XNET API for LabVIEW — XNET Cluster Property Node FlexRay:Macrotick Data Type Direction Read Required? Default Yes Calculated from Other Cluster Parameters Property Class XNET Cluster Short Name FlexRay. © National Instruments Corporation 4-199 NI-XNET Hardware and Software Manual . This property corresponds to the global cluster parameter gdMacrotick in the FlexRay Protocol Specification. The range for this property is 1–6 μs. The macrotick (MT) is the basic timing unit in the FlexRay cluster. expressed in microseconds.Macrotick Description This property specifies the duration of the clusterwide nominal macrotick. Nearly all timing-dependent properties are expressed in terms of macroticks.

This property is required. If the property does not contain a valid value. This is needed when you create your own in-memory database (:memory:) rather than use a file.com . so you must set a valid value prior to creating a session. This property corresponds to the global cluster parameter gMaxWithoutClockCorrectionFatal in the FlexRay Protocol Specification. For more information about using database files and in-memory databases.MaxWoClkCorFat Description This property defines the number of consecutive even/odd cycle pairs with missing clock correction terms that cause the controller to transition from the Protocol Operation Control status of Normal Active or Normal Passive to the Halt state. The property does not contain a default in this case. the session returns an error. The values for this property are in the range 1–15 even/odd cycle pairs. Use this global parameter as a threshold for testing the clock correction failure counter. refer to Databases. To ensure that the property contains a valid value. and you create an XNET session that uses this cluster. The file formats require a valid value in the text for this property. Set a value in LabVIEW using the property node. NI-XNET Hardware and Software Manual 4-200 ni.Chapter 4 NI-XNET API for LabVIEW — XNET Cluster Property Node FlexRay:Max Without Clock Correction Fatal Data Type Direction Read/Write Required? Default Yes Read from Database Property Class XNET Cluster Short Name FlexRay. you can do one of the following: • • Use a database file (or alias) to create the session.

This property corresponds to the global cluster parameter gMaxWithoutClockCorrectionPassive in the FlexRay Protocol Specification. This is needed when you create your own in-memory database (:memory:) rather than use a file.MaxWoClkCorPas Description This property defines the number of consecutive even/odd cycle pairs with missing clock correction terms that cause the controller to transition from the Protocol Operation Control status of Normal Active to Normal Passive. Use this global parameter as a threshold for testing the clock correction failure counter. To ensure that the property contains a valid value. Max Without Clock Correction Passive. Note This property. © National Instruments Corporation 4-201 NI-XNET Hardware and Software Manual .Chapter 4 NI-XNET API for LabVIEW — XNET Cluster Property Node FlexRay:Max Without Clock Correction Passive Data Type Direction Read/Write Required? Default Yes Read from Database Property Class XNET Cluster Short Name FlexRay. The file formats require a valid value in the text for this property. so you must set a valid value prior to creating a session. If the property does not contain a valid value. the session returns an error. <= Max Without Clock Correction Fatal <= 15. you can do one of the following: • • Use a database file (or alias) to create the session. The values for this property are in the range 1–15 even/odd cycle pairs. The property does not contain a default in this case. For more information about using database files and in-memory databases. and you create an XNET session that uses this cluster. This property is required. refer to Databases. Set a value in LabVIEW using the property node.

and you create an XNET session that uses this cluster. This property corresponds to the global cluster parameter gdMinislotActionPointOffset in the FlexRay Protocol Specification. Set a value in LabVIEW using the property node. The property does not contain a default in this case.com .Chapter 4 NI-XNET API for LabVIEW — XNET Cluster Property Node FlexRay:Minislot Action Point Offset Data Type Direction Read/Write Required? Default Yes Read from Database Property Class XNET Cluster Short Name MinislotActPt Description This property specifies the number of macroticks (MT) the minislot action point is offset from the beginning of a minislot. the session returns an error. you can do one of the following: • • Use a database file (or alias) to create the session. This is needed when you create your own in-memory database (:memory:) rather than use a file. If the property does not contain a valid value. The action point is that point within a given slot where the actual transmission of a frame starts. NI-XNET Hardware and Software Manual 4-202 ni. To ensure that the property contains a valid value. This is slightly later than the start of the slot to allow for a clock drift between the network nodes. For more information about using database files and in-memory databases. refer to Databases. The range for this property is 1–31 MT. This property is required. so you must set a valid value prior to creating a session. The file formats require a valid value in the text for this property.

This property is required.Minislot Description This property specifies the duration of a minislot. the session returns an error. If no frame transmits. For more information about using database files and in-memory databases. In a minislot. so you must set a valid value prior to creating a session. Set a value in LabVIEW using the property node. and you create an XNET session that uses this cluster. but it usually spans several minislots. The total dynamic segment length is determined by multiplying this property by the Number Of Minislots property. The range for this property is 2–63 MT. Minislots are the dynamic segment time increments.Chapter 4 NI-XNET API for LabVIEW — XNET Cluster Property Node FlexRay:Minislot Data Type Direction Read/Write Required? Default Yes Read from Database Property Class XNET Cluster Short Name FlexRay. frames can have variable payload length. expressed in macroticks (MT). This property corresponds to the global cluster parameter gdMinislot in the FlexRay Protocol Specification. you can do one of the following: • • Use a database file (or alias) to create the session. The property does not contain a default in this case. The file formats require a valid value in the text for this property. To ensure that the property contains a valid value. The total dynamic segment length must be shorter than the Macro Per Cycle property minus the total static segment length. a dynamic frame can start transmission. © National Instruments Corporation 4-203 NI-XNET Hardware and Software Manual . In the dynamic segment of the FlexRay cycle. refer to Databases. the slot counter (slot ID) is incremented to allow for the next frame. This is needed when you create your own in-memory database (:memory:) rather than use a file. If the property does not contain a valid value.

refer to Databases.NMVecLen Description This property specifies the length of the Network Management vector (NMVector) in a cluster. Set a value in LabVIEW using the property node. NI-XNET Hardware and Software Manual 4-204 ni. The NMVector length specifies the number of bytes in the payload segment of the FlexRay frame transmitted in the status segment that can be used as the NMVector.com . the session returns an error. The file formats require a valid value in the text for this property. The range for this property is 0–12 bytes. To ensure that the property contains a valid value. so you must set a valid value prior to creating a session. For more information about using database files and in-memory databases. If the property does not contain a valid value. This is needed when you create your own in-memory database (:memory:) rather than use a file. The property does not contain a default in this case. This property corresponds to the global cluster parameter gNetworkManagementVectorLength in the FlexRay Protocol Specification.Chapter 4 NI-XNET API for LabVIEW — XNET Cluster Property Node FlexRay:Network Management Vector Length Data Type Direction Read/Write Required? Default Yes Read from Database Property Class XNET Cluster Short Name FlexRay. and you create an XNET session that uses this cluster. Only frames transmitted in the static segment of the communication cycle use the NMVector. This property is required. you can do one of the following: • • Use a database file (or alias) to create the session.

NITStart Description This property specifies the start of the Network Idle Time (NIT). The range for this property is 8–15998 MT. The NIT is a period at the end of a FlexRay communication cycle where no frames are transmitted. expressed as the number of macroticks (MT) from the start of the cycle. The network nodes use it to re-sync their clocks to the common network time. It is the total size of the static and dynamic segments plus the symbol window length. which is optional in a FlexRay communication cycle. This property is calculated from other cluster properties. © National Instruments Corporation 4-205 NI-XNET Hardware and Software Manual .Chapter 4 NI-XNET API for LabVIEW — XNET Cluster Property Node FlexRay:NIT Start Data Type Direction Read Required? Default Yes Calculated from Other Cluster Properties Property Class XNET Cluster Short Name FlexRay.

Configure the NIT to be the Macro Per Cycle property minus the total static and dynamic segment lengths minus the optional symbol window duration.com .Chapter 4 NI-XNET API for LabVIEW — XNET Cluster Property Node FlexRay:NIT Data Type Direction Read/Write Required? Default Yes Read from Database Property Class XNET Cluster Short Name FlexRay. NI-XNET Hardware and Software Manual 4-206 ni. If the property does not contain a valid value. so you must set a valid value prior to creating a session. and you create an XNET session that uses this cluster. The network nodes use it to re-sync their clocks to the common network time. Set a value in LabVIEW using the property node. refer to Databases. This property corresponds to the global cluster parameter gdNIT in the FlexRay Protocol Specification. The property does not contain a default in this case. The NIT is a period at the end of a FlexRay communication cycle where no frames are transmitted. This property is required. you can do one of the following: • • Use a database file (or alias) to create the session. The file formats require a valid value in the text for this property. For more information about using database files and in-memory databases. expressed in macroticks (MT). This is needed when you create your own in-memory database (:memory:) rather than use a file. To ensure that the property contains a valid value. The range for this property is 2–805 MT.NIT Description This property is the Network Idle Time (NIT) duration. the session returns an error.

the session returns an error. a dynamic frame can start transmission. Set a value in LabVIEW using the property node. but it usually spans several minislots. so you must set a valid value prior to creating a session.Chapter 4 NI-XNET API for LabVIEW — XNET Cluster Property Node FlexRay:Number of Minislots Data Type Direction Read/Write Required? Default Yes Read from Database Property Class XNET Cluster Short Name FlexRay. The property does not contain a default in this case. refer to Databases. The range for this property is 0–7986. To ensure that the property contains a valid value. If no frame transmits.NumMinislt Description This property specifies the number of minislots in the dynamic segment. Minislots are the dynamic segment time increments. and you create an XNET session that uses this cluster. If the property does not contain a valid value. The total dynamic segment length is determined by multiplying this property by the Minislot property. The total dynamic segment length must be shorter than the Macro Per Cycle property minus the total static segment length. This property is required. © National Instruments Corporation 4-207 NI-XNET Hardware and Software Manual . For more information about using database files and in-memory databases. you can do one of the following: • • Use a database file (or alias) to create the session. In a minislot. This property corresponds to the global cluster parameter gNumberOfMinislots in the FlexRay Protocol Specification. The file formats require a valid value in the text for this property. This is needed when you create your own in-memory database (:memory:) rather than use a file. In the FlexRay cycle dynamic segment. frames can have variable payload lengths. the slot counter (slot ID) is incremented to allow for the next frame.

NumStatSlt Description This property specifies the number of static slots in the static segment. The range for this property is 2–1023. This is needed when you create your own in-memory database (:memory:) rather than use a file. the session returns an error. If the property does not contain a valid value. This property is required. The total static segment length must be shorter than the Macro Per Cycle property. The total static segment length is determined by multiplying this property by the Static Slot property. To ensure that the property contains a valid value.Chapter 4 NI-XNET API for LabVIEW — XNET Cluster Property Node FlexRay:Number of Static Slots Data Type Direction Read/Write Required? Default Yes Read from Database Property Class XNET Cluster Short Name FlexRay. This property corresponds to the global cluster parameter gNumberOfStaticSlots in the FlexRay Protocol Specification. The property does not contain a default in this case.com . refer to Databases. and you create an XNET session that uses this cluster. Set a value in LabVIEW using the property node. The file formats require a valid value in the text for this property. Each static slot is used to transmit one (static) frame on the bus. For more information about using database files and in-memory databases. you can do one of the following: • • Use a database file (or alias) to create the session. so you must set a valid value prior to creating a session. NI-XNET Hardware and Software Manual 4-208 ni.

The file formats require a valid value in the text for this property. This is needed when you create your own in-memory database (:memory:) rather than use a file. The NIT is a period at the end of a FlexRay communication cycle where no frames are transmitted. so you must set a valid value prior to creating a session. expressed as the number of macroticks (MT) from the start of the cycle.OffCorSt Description This property specifies the start of the offset correction phase within the Network Idle Time (NIT). The Offset Correction Start is usually configured to be NITStart + 1. refer to Databases. This property is required. To ensure that the property contains a valid value. For more information about using database files and in-memory databases. but can deviate from that value. © National Instruments Corporation 4-209 NI-XNET Hardware and Software Manual . If the property does not contain a valid value.Chapter 4 NI-XNET API for LabVIEW — XNET Cluster Property Node FlexRay:Offset Correction Start Data Type Direction Read/Write Required? Default Yes Read from Database Property Class XNET Cluster Short Name FlexRay. The range for this property is 9–15999 MT. Set a value in LabVIEW using the property node. and you create an XNET session that uses this cluster. The property does not contain a default in this case. This property corresponds to the global cluster parameter gOffsetCorrectionStart in the FlexRay Protocol Specification. you can do one of the following: • • Use a database file (or alias) to create the session. The network nodes use it to re-sync their clocks to the common network time. the session returns an error.

you can do one of the following: • • Use a database file (or alias) to create the session.PayldLenDynMax Description This property specifies the maximum of the payload lengths of all dynamic frames. In the FlexRay cycle dynamic segment. and after a reopen. the session returns an error.com . This is needed when you create your own in-memory database (:memory:) rather than use a file. Use this property to calculate the Latest Usable Dynamic Slot and Latest Guaranteed Dynamic Slot properties. The range for this property is 0–254 bytes (even numbers only). so you must set a valid value prior to creating a session. Set a value in LabVIEW using the property node. To ensure that the property contains a valid value. But this setting is lost once the database is closed. refer to Databases. If the property does not contain a valid value. The changed value is returned from the FlexRay:Payload Length Dynamic Maximum property until the database is closed. This property is required. and then this value is returned for this property. You may temporarily set this to a larger value (if it is not yet the maximum). NI-XNET Hardware and Software Manual 4-210 ni. For more information about using database files and in-memory databases.Chapter 4 NI-XNET API for LabVIEW — XNET Cluster Property Node FlexRay:Payload Length Dynamic Maximum Data Type Direction Read/Write Required? Default Yes Read from Database Property Class XNET Cluster Short Name FlexRay. The property does not contain a default in this case. the maximum of the frames is returned again. and you create an XNET session that uses this cluster. The value returned for this property is the maximum of the payload lengths of all frames defined for the dynamic segment in the database. The file formats require a valid value in the text for this property. frames can have variable payload length.

© National Instruments Corporation 4-211 NI-XNET Hardware and Software Manual .Chapter 4 NI-XNET API for LabVIEW — XNET Cluster Property Node FlexRay:Payload Length Maximum Data Type Direction Read Required? Default Yes Calculated from Other Cluster Properties Property Class XNET Cluster Short Name FlexRay.PayldLenMax Description This property returns the payload length of any frame (static or dynamic) in this cluster with the longest payload. The range for this property is 0–254 bytes (even numbers only). The payload specifies that the frame transfers the data.

This is needed when you create your own in-memory database (:memory:) rather than use a file. and you create an XNET session that uses this cluster. The file formats require a valid value in the text for this property. To ensure that the property contains a valid value. If the property does not contain a valid value. The property does not contain a default in this case. NI-XNET Hardware and Software Manual 4-212 ni.PayldLenSt Description This property specifies the payload length of a static frame. you can do one of the following: • • Use a database file (or alias) to create the session. refer to Databases. Set a value in LabVIEW using the property node. All static frames in a cluster have the same payload length.Chapter 4 NI-XNET API for LabVIEW — XNET Cluster Property Node FlexRay:Payload Length Static Data Type Direction Read/Write Required? Default Yes Read from Database Property Class XNET Cluster Short Name FlexRay.com . so you must set a valid value prior to creating a session. The range for this property is 0–254 bytes (even numbers only). For more information about using database files and in-memory databases. This property is required. the session returns an error. This property corresponds to the global cluster parameter gPayloadLengthStatic in the FlexRay Protocol Specification.

The file formats require a valid value in the text for this property. This property corresponds to the global cluster parameter gdStaticSlot in the FlexRay Protocol Specification. Each static slot is used to transmit one (static) frame on the bus. and you create an XNET session that uses this cluster. To ensure that the property contains a valid value. The total static segment length must be shorter than the Macro Per Cycle property.Chapter 4 NI-XNET API for LabVIEW — XNET Cluster Property Node FlexRay:Static Slot Data Type Direction Read/Write Required? Default Yes Read from Database Property Class XNET Cluster Short Name FlexRay. so you must set a valid value prior to creating a session. The total static segment length is determined by multiplying this property by the Number Of Static Slots property. In the FlexRay cycle static segment. as well as maximum propagation delay. This property is required. therefore. the duration of a static frame is the same. The property does not contain a default in this case. This is needed when you create your own in-memory database (:memory:) rather than use a file. Set a value in LabVIEW using the property node. refer to Databases. If the property does not contain a valid value. © National Instruments Corporation 4-213 NI-XNET Hardware and Software Manual .StatSlot Description This property specifies the duration of a slot in the static segment in macroticks (MT). all frames must have the same payload length. The range for this property is 4–661 MT. For more information about using database files and in-memory databases. The static slot duration takes into account the Payload Length Static and Action Point Offset properties. the session returns an error. you can do one of the following: • • Use a database file (or alias) to create the session.

During the symbol window. The range for this property is 8–15998 MT. It is based on the total static and dynamic segment size.com .Chapter 4 NI-XNET API for LabVIEW — XNET Cluster Property Node FlexRay:Symbol Window Start Data Type Direction Read Required? Default Yes Calculated from Other Cluster Properties Property Class XNET Cluster Short Name FlexRay. NI-XNET Hardware and Software Manual 4-214 ni. It is set to zero if the Symbol Window property is 0 (no symbol window exists). This property is calculated from other cluster properties. a channel sends a single Media Test Access Symbol (MTS).SymWinStart Description This property specifies the macrotick offset at which the symbol window begins from the start of the cycle.

you can do one of the following: • • Use a database file (or alias) to create the session. The symbol window is optional for a given cluster (the Symbol Window property can be zero).SymWin Description This property specifies the symbol window duration. This is needed when you create your own in-memory database (:memory:) rather than use a file. the session returns an error. so you must set a valid value prior to creating a session. The property does not contain a default in this case. refer to Databases.Chapter 4 NI-XNET API for LabVIEW — XNET Cluster Property Node FlexRay:Symbol Window Data Type Direction Read/Write Required? Default Yes Read from Database Property Class XNET Cluster Short Name FlexRay. For more information about using database files and in-memory databases. The symbol window is a slot after the static and dynamic segment. To ensure that the property contains a valid value. Set a value in LabVIEW using the property node. The range for this property is 0–142 MT. A symbol transmission starts at the action point offset within the symbol window. If the property does not contain a valid value. This property corresponds to the global cluster parameter gdSymbolWindow in the FlexRay Protocol Specification. The file formats require a valid value in the text for this property. This property is required. © National Instruments Corporation 4-215 NI-XNET Hardware and Software Manual . and you create an XNET session that uses this cluster. and is used to transmit Collision Avoidance symbols (CAS) and/or Media Access Test symbol (MTS). expressed in macroticks (MT).

NI-XNET Hardware and Software Manual 4-216 ni. This property is required. so you must set a valid value prior to creating a session. The file formats require a valid value in the text for this property. There must be at least two startup nodes in a network. you can do one of the following: • • Use a database file (or alias) to create the session. For more information about using database files and in-memory databases. To ensure that the property contains a valid value. The range for this property is 2–15. Sync frames define the zero points for the clock drift measurement. and you create an XNET session that uses this cluster. This property corresponds to the global cluster parameter gSyncNodeMax in the FlexRay Protocol Specification.com . refer to Databases.SyncNodeMax Description This property specifies the maximum number of nodes that may send frames with the sync frame indicator bit set to one. Set a value in LabVIEW using the property node. the session returns an error. Startup frames are special sync frames transmitted first after a network startup. This is needed when you create your own in-memory database (:memory:) rather than use a file.Chapter 4 NI-XNET API for LabVIEW — XNET Cluster Property Node FlexRay:Sync Node Max Data Type Direction Read/Write Required? Default Yes Read from Database Property Class XNET Cluster Short Name FlexRay. If the property does not contain a valid value. The property does not contain a default in this case.

The TSS prevents the frame or symbol content from being truncated. If the property does not contain a valid value. For more information about using database files and in-memory databases. © National Instruments Corporation 4-217 NI-XNET Hardware and Software Manual . This is needed when you create your own in-memory database (:memory:) rather than use a file. This property corresponds to the global cluster parameter gdTSSTransmitter in the FlexRay Protocol Specification.Chapter 4 NI-XNET API for LabVIEW — XNET Cluster Property Node FlexRay:TSS Transmitter Data Type Direction Read/Write Required? Default Yes Read from Database Property Class XNET Cluster Short Name FlexRay. refer to Databases.You must set this property to be greater than the expected worst case truncation of a frame. For example. During this setup. This property is required. To ensure that the property contains a valid value. The range for this property is 3–15 bit. Set a value in LabVIEW using the property node. A frame transmission may be truncated at the beginning. the session returns an error.TSSTx Description This property specifies the number of bits in the Transmission Start Sequence (TSS). the purpose of the TSS is to “open the gates” of an active star (that is. The file formats require a valid value in the text for this property. an active star truncates a number of bits at the beginning of a communication element. The property does not contain a default in this case. so you must set a valid value prior to creating a session. The amount of truncation depends on the nodes involved and the channel topology layout. to cause the star to properly set up input and output connections). and you create an XNET session that uses this cluster. you can do one of the following: • • Use a database file (or alias) to create the session.

com . refer to Databases. and other effects can deform the transmitted wakeup pattern. This property corresponds to the global cluster parameter gdWakeupSymbolRxIdle in the FlexRay Protocol Specification. Set a value in LabVIEW using the property node.WakeSymRxIdl Description This property specifies the number of bits the node uses to test the idle portion duration of a received wakeup symbol. The file formats require a valid value in the text for this property.Chapter 4 NI-XNET API for LabVIEW — XNET Cluster Property Node FlexRay:Wakeup Symbol Rx Idle Data Type Direction Read/Write Required? Default Yes Read from Database Property Class XNET Cluster Short Name FlexRay. The property does not contain a default in this case. If the property does not contain a valid value. so you must set a valid value prior to creating a session. and you create an XNET session that uses this cluster. For more information about using database files and in-memory databases. clock differences. the session returns an error. This is needed when you create your own in-memory database (:memory:) rather than use a file. To ensure that the property contains a valid value. you can do one of the following: • • Use a database file (or alias) to create the session. Collisions. NI-XNET Hardware and Software Manual 4-218 ni. The range for this property is 14–59 gdBit (bit duration). This property is required.

refer to Databases. This property is required. For more information about using database files and in-memory databases. The property does not contain a default in this case. This is needed when you create your own in-memory database (:memory:) rather than use a file. clock differences.Chapter 4 NI-XNET API for LabVIEW — XNET Cluster Property Node FlexRay:Wakeup Symbol Rx Low Data Type Direction Read/Write Required? Default Yes Read from Database Property Class XNET Cluster Short Name FlexRay. The file formats require a valid value in the text for this property. This property corresponds to the global cluster parameter gdWakeupSymbolRxLow in the FlexRay Protocol Specification. This lower limit of zero bits must be received for the receiver to detect the low portion. © National Instruments Corporation 4-219 NI-XNET Hardware and Software Manual . you can do one of the following: • • Use a database file (or alias) to create the session. and you create an XNET session that uses this cluster. The range for this property is 10–55 gdBit (bit duration). If the property does not contain a valid value. and other effects can deform the transmitted wakeup pattern. Set a value in LabVIEW using the property node. Active starts. so you must set a valid value prior to creating a session.WakeSymRxLow Description This property specifies the number of bits the node uses to test the low portion duration of a received wakeup symbol. To ensure that the property contains a valid value. the session returns an error.

To ensure that the property contains a valid value. This property corresponds to the global cluster parameter gdWakeupSymbolRxWindow in the FlexRay Protocol Specification.WakeSymRxWin Description This property specifies the size of the window used to detect wakeups. The range for this property is 76–301 gdBit (bit duration). refer to Databases. so you must set a valid value prior to creating a session. This is needed when you create your own in-memory database (:memory:) rather than use a file.com . The file formats require a valid value in the text for this property. and you create an XNET session that uses this cluster. The property does not contain a default in this case. Clock differences and other effects can deform the transmitted wakeup pattern. the session returns an error. Detection of a wakeup requires a low and idle period from one WUS (wakeup symbol) and a low period from another WUS. If the property does not contain a valid value. Set a value in LabVIEW using the property node.Chapter 4 NI-XNET API for LabVIEW — XNET Cluster Property Node FlexRay:Wakeup Symbol Rx Window Data Type Direction Read/Write Required? Default Yes Read from Database Property Class XNET Cluster Short Name FlexRay. NI-XNET Hardware and Software Manual 4-220 ni. For more information about using database files and in-memory databases. This property is required. to be detected entirely within a window of this size. you can do one of the following: • • Use a database file (or alias) to create the session.

WakeSymTxIdl Description This property specifies the number of bits the node uses to transmit the wakeup symbol idle portion. refer to Databases. The property does not contain a default in this case. so you must set a valid value prior to creating a session. To ensure that the property contains a valid value. the session returns an error. This property is required. you can do one of the following: • • Use a database file (or alias) to create the session. This is needed when you create your own in-memory database (:memory:) rather than use a file. and you create an XNET session that uses this cluster. For more information about using database files and in-memory databases. This property corresponds to the global cluster parameter gdWakeupSymbolTxIdle in the FlexRay Protocol Specification. Set a value in LabVIEW using the property node.Chapter 4 NI-XNET API for LabVIEW — XNET Cluster Property Node FlexRay:Wakeup Symbol Tx Idle Data Type Direction Read/Write Required? Default Yes Read from Database Property Class XNET Cluster Short Name FlexRay. If the property does not contain a valid value. © National Instruments Corporation 4-221 NI-XNET Hardware and Software Manual . The range for this property is 45–180 gdBit (bit duration). The file formats require a valid value in the text for this property.

To ensure that the property contains a valid value. refer to Databases. This is needed when you create your own in-memory database (:memory:) rather than use a file. The file formats require a valid value in the text for this property.com . The property does not contain a default in this case. so you must set a valid value prior to creating a session. Set a value in LabVIEW using the property node. For more information about using database files and in-memory databases. you can do one of the following: • • Use a database file (or alias) to create the session. the session returns an error. NI-XNET Hardware and Software Manual 4-222 ni. The range for this property is 15–60 gdBit (bit duration).Chapter 4 NI-XNET API for LabVIEW — XNET Cluster Property Node FlexRay:Wakeup Symbol Tx Low Data Type Direction Read/Write Required? Default Yes Read from Database Property Class XNET Cluster Short Name FlexRay. This property corresponds to the global cluster parameter gdWakeupSymbolTxLow in the FlexRay Protocol Specification. and you create an XNET session that uses this cluster.WakeSymTxLow Description This property specifies the number of bits the node uses to transmit the wakeup symbol low phase. This property is required. If the property does not contain a valid value.

this rate must be 2500000. 250000. If you need values other than these. so it is read-only from the session. 800000. FlexRay For FlexRay. use the custom settings as described in the Interface:Baud Rate property. Use a session interface property (for example. © National Instruments Corporation 4-223 NI-XNET Hardware and Software Manual . This baud rate represents the rate from the database. 200000. 62500. CAN For CAN. 80000. 160000. or 1000000. 50000. 5000000. Some transceivers may only support a subset of these values. Interface:Baud Rate) to override the database baud rate with an application-specific baud rate. 125000. or 10000000. 500000.Chapter 4 NI-XNET API for LabVIEW — XNET Cluster Property Node Baud Rate Data Type Direction Read/Write Required? Default No 0 Property Class XNET Cluster Short Name BaudRate Description The Baud Rate property sets the baud rate all cluster nodes use. 40000. 400000. 83333. this rate can be 33333. 100000.

You can change this behavior by setting the XNET Database ShowInvalidFromOpen? property to true. A comment is a string containing up to 65535 characters. Configuration Status Data Type Direction Read Only Required? Default N/A N/A Property Class XNET Cluster Short Name ConfigStatus Description The cluster object configuration status.vi to convert it to a text description (on message output) of the configuration problem.Chapter 4 NI-XNET API for LabVIEW — XNET Cluster Property Node Comment Data Type Direction Read/Write Required? Default No Empty String Property Class XNET Cluster Short Name Comment Description A comment describing the cluster object. incorrectly configured clusters in the database are not returned from the XNET Database Clusters property because they cannot be used in the bus communication.com . When the configuration status of a cluster becomes invalid after the database has been opened. By default. Configuration Status returns an NI-XNET error code. You can pass the value to the error code input of the Simple Error Handler. NI-XNET Hardware and Software Manual 4-224 ni. the cluster still is returned from the XNET Database Clusters property even if ShowInvalidFromOpen? is false.

Returns an array of references to all ECUs defined in this cluster.Chapter 4 NI-XNET API for LabVIEW — XNET Cluster Property Node Database Data Type Direction Read Only Required? Default N/A N/A Property Class XNET Cluster Short Name Database Description Refnum to the cluster parent database. The parent database is defined when the cluster object is created.vi. ECUs Data Type Direction Read Only Required? Default N/A N/A Property Class XNET Cluster Short Name ECUs Description ECUs in this cluster. use XNET Database Delete (ECU). use XNET Database Create (ECU).vi. To add an ECU to a cluster. © National Instruments Corporation 4-225 NI-XNET Hardware and Software Manual . An ECU is assigned to a cluster when the ECU object is created. To remove an ECU from the cluster. You cannot change it afterwards. You cannot change this assignment afterwards.

To remove a frame from a cluster. use XNET Database Create (Frame). NI-XNET Hardware and Software Manual 4-226 ni.com . use XNET Database Delete (Frame). A frame is assigned to a cluster when the frame object is created.Chapter 4 NI-XNET API for LabVIEW — XNET Cluster Property Node Frames Data Type Direction Read Only Required? Default N/A N/A Property Class XNET Cluster Short Name Frms Description Frames in this cluster. You cannot change this assignment afterwards.vi.vi. Returns an array of refnums to all frames defined in this cluster. To add a frame to a cluster.

and not a number. When you do this. to XNET String to IO Name. If you create the cluster yourself. Set the new Name (Short) for the object. the short name comes from the file (CAN_Cluster for CANdb). while retaining the other text that ensures a unique name. and underscore (_). Wire the XNET Cluster as the input string to Search and Replace String Function. © National Instruments Corporation 4-227 NI-XNET Hardware and Software Manual . Wire the result string from Search and Replace String Function.vi. This short name does not include qualifiers to ensure that it is unique. The fully qualified name is available by using the XNET Signal I/O name as a string. with the old Name as the search string. 4. It is for display purposes. and other special characters are not supported within the name. This replaces the short name in the XNET Cluster. it comes from Name input of XNET Database Create (Cluster). such as the database name. The short name is limited to 128 characters. Valid characters for the short name are lowercase letters. Get the old Name (Short) using the property node. Space ( ).). numbers. Follow these steps to avoid this problem: 1. errors can result because the old name cannot be found. then use the original XNET Cluster that contains the old name.Chapter 4 NI-XNET API for LabVIEW — XNET Cluster Property Node Name (Short) Data Type Direction Read/Write Required? Default Yes Defined in Create Object Property Class XNET Cluster Short Name NameShort Description String identifying the cluster object. If you use a file. dot (. and the new Name as the replace string. You can write this property to change the cluster’s short name. The short name must begin with a letter (uppercase or lowercase) or underscore.vi. 3. uppercase letters.vi. 2.vi A cluster name must be unique for all clusters in a database. This casts the string back to a valid XNET Cluster.

you must use Select Database again to select the new cluster name. The following diagram demonstrates steps 1 through 5 for an XNET Frame I/O name: NI-XNET Hardware and Software Manual 4-228 ni.Chapter 4 NI-XNET API for LabVIEW — XNET Cluster Property Node 5. Frame. or Signal to select the old name.com . After renaming the cluster. if you used Select Database with an XNET ECU.

A signal is assigned to a cluster when the signal object is created.vi. © National Instruments Corporation 4-229 NI-XNET Hardware and Software Manual . You cannot change this assignment afterwards.Chapter 4 NI-XNET API for LabVIEW — XNET Cluster Property Node Protocol Data Type Direction Read/Write Required? Default No CAN Property Class XNET Cluster Short Name Protocol Description Determines the cluster protocol. use XNET Database Create (Signal).vi. To remove a signal from a cluster use XNET Database Delete (Signal). To add a signal to a cluster. The values (enumeration) for this property are: 0 1 CAN FlexRay Signals Data Type Direction Read Only Required? Default N/A N/A Property Class XNET Cluster Short Name Sigs Description This property returns refnums to all XNET Signals defined in this cluster.

then select a cluster. You can change constants only during configuration. You drag a constant to the block diagram of your VI. or indicator.com . For a complete description. open the LabVIEW context help window (<Ctrl-H>) and move your cursor over the property name. Right-click to change direction between read and write. refer to XNET Cluster I/O Name. Right-click each property name to create a constant. prior to running the VI. NI-XNET Hardware and Software Manual 4-230 ni. control. Pull down this node to add properties.Chapter 4 NI-XNET API for LabVIEW — XNET Cluster Constant XNET Cluster Constant This constant provides the constant form of the XNET Cluster I/O name. For more information about LabVIEW property nodes. For help on a specific property. open the main LabVIEW help (select Search the LabVIEW Help from the Help menu) and look for the Property Nodes topic in the index. XNET ECU Property Node Format Description Property node used to read/write properties for an XNET ECU I/O Name.

Coldstart? Description Indicates that the ECU is sending a startup frame. It returns true when one of the frames this ECU transmits (refer to the XNET ECU Frames Transmitted property) has the XNET Frame FlexRay:Startup? property set to true. The parent cluster is determined when the ECU object is created. An ECU can send only one startup frame on the FlexRay bus. © National Instruments Corporation 4-231 NI-XNET Hardware and Software Manual . FlexRay:Coldstart? Data Type Direction Read Only Required? Default N/A N/A Property Class XNET ECU Short Name FlexRay. You can determine the frame transmitting the startup using the XNET ECU FlexRay:Startup Frame property. This property is valid only for ECUs connected to a FlexRay bus. You cannot change it afterwards.Chapter 4 NI-XNET API for LabVIEW — XNET ECU Property Node Cluster Data Type Direction Read Only Required? Default N/A N/A Property Class XNET ECU Short Name Cluster Description Refnum to the parent cluster to which the ECU is connected.

You can pass the value to the Simple Error Handler. Configuration Status returns an NI-XNET error code. A comment is a string containing up to 65535 characters. When the configuration status of an ECU became invalid after the database is opened. By default.Chapter 4 NI-XNET API for LabVIEW — XNET ECU Property Node Comment Data Type Direction Read/Write Required? Default No Empty String Property Class XNET ECU Short Name Comment Description Comment describing the ECU object. You can change this behavior by setting the XNET Database ShowInvalidFromOpen? property to true. Configuration Status Data Type Direction Read Only Required? Default N/A N/A Property Class XNET ECU Short Name ConfigStatus Description The ECU object configuration status.com .vi error code input to convert the value to a text description (on message output) of the configuration problem. the ECU still is returned from the XNET Cluster ECUs property even if ShowInvalidFromOpen? is false. NI-XNET Hardware and Software Manual 4-232 ni. incorrectly configured ECUs in the database are not returned from the XNET Cluster ECUs property because they cannot be used in the bus communication.

This property defines all frames the ECU receives. All frames an ECU receives in a given cluster must be defined in the same cluster. This property defines all frames the ECU transmits. © National Instruments Corporation 4-233 NI-XNET Hardware and Software Manual . Frames Transmitted Data Type Direction Read/Write Required? Default No Empty Array Property Class XNET ECU Short Name FrmsTx Description Returns an array of refnums to frames the ECU transmits.Chapter 4 NI-XNET API for LabVIEW — XNET ECU Property Node Frames Received Data Type Direction Read/Write Required? Default No Empty Array Property Class XNET ECU Short Name FrmsRx Description Returns an array of refnums to frames the ECU receives. All frames an ECU transmits in a given cluster must be defined in the same cluster.

Close the object using XNET Database Close. NI-XNET Hardware and Software Manual 4-234 ni. Wire the close all? input as false to close the renamed object only. such as the database and cluster name. and not a number. 5. uppercase letters. It is for display purposes. Set the new Name (Short) property for the object.com . You can write this property to change the ECU’s short name. When you do this and then use the original XNET ECU that contains the old name. and underscore (_).vi.vi. Wire the XNET ECU as the input string to Search and Replace String Function. This short name does not include qualifiers to ensure that it is unique. Follow these steps to avoid this problem: 1. 3. numbers. The short name is limited to 128 characters. while retaining the other text that ensures a unique name.). An ECU name must be unique for all ECUs in a cluster. Get the old Name (Short) property using the property node. The fully qualified name is available by using the XNET Signal I/O name as a string. The short name must begin with a letter (uppercase or lowercase) or underscore. Wire the result from Search and Replace String Function. and other special characters are not supported within the name. Valid characters for the short name are lowercase letters. 2.vi with the old Name as the search string and the new Name as the replacement string.vi to XNET String to IO Name. This casts the string back to a valid XNET ECU. Space ( ).Chapter 4 NI-XNET API for LabVIEW — XNET ECU Property Node Name (Short) Data Type Direction Read/Write Required? Default Yes Defined in Create Object Property Class XNET ECU Short Name NameShort Description String identifying the ECU object. 4. This replaces the short name in the XNET ECU. dot (. errors can result because the old name cannot be found.

vi to reopen the object with the new name.Chapter 4 NI-XNET API for LabVIEW — XNET ECU Property Node 6.5 or 8. The following diagram demonstrates steps 1 through 5 for an XNET Frame I/O name: © National Instruments Corporation 4-235 NI-XNET Hardware and Software Manual . If you are using LabVIEW 8. If you are using LabVIEW 2009 or later.6. call XNET Database Open. you can wire the new name to the next VI or property node (no need for explicit open).

Otherwise. If the ECU transmits a frame (refer to the XNET ECU Frames Transmitted property) with the XNET Frame FlexRay:Startup? property set to true. NI-XNET Hardware and Software Manual 4-236 ni.Chapter 4 NI-XNET API for LabVIEW — XNET ECU Property Node FlexRay:Startup Frame Data Type Direction Read Only Required? Default N/A N/A Property Class XNET ECU Short Name FlexRay. it is empty. This property is valid only for ECUs connected to a FlexRay bus.StartupFrm Description Returns the refnum to the startup frame the ECU sends.com . this property returns this frame.

Right-click each property name to create a constant. Pull down this node to add properties. XNET Frame Property Node Format Description Property node used to read/write properties for an XNET Frame I/O Name. open the LabVIEW context help window (<Ctrl-H>) and move your cursor over the property name. For more information about LabVIEW property nodes. refer to XNET ECU I/O Name.Chapter 4 NI-XNET API for LabVIEW — XNET ECU Constant XNET ECU Constant This constant provides the constant form of the XNET ECU I/O name. You can change constants only during configuration. You drag a constant to the block diagram of your VI. or indicator. prior to running the VI.ExtID? Description This property determines whether the XNET Frame Identifier property in a CAN cluster represents a standard 11-bit (false) or extended 29-bit (true) arbitration ID. Right-click to change direction between read and write. then select an ECU. control. For help on a specific property. For a complete description. © National Instruments Corporation 4-237 NI-XNET Hardware and Software Manual . open the main LabVIEW help (select Search the LabVIEW Help from the Help menu) and look for the Property Nodes topic in the index. CAN:Extended Identifier? Data Type Direction Read/Write Required? Default No False Property Class XNET Frame Short Name CAN.

Event Data (1) Cyclic Remote (2) NI-XNET Hardware and Software Manual 4-238 ni. For a description of how these CAN timing types apply to the NI-XNET session mode. The XNET Frame CAN:Transmit Time property defines the minimum interval. When you use the frame within an NI-XNET session. The transmitting ECU transmits the CAN data frame in an event-driven manner. the event occurs when you call XNET Write. The XNET Frame CAN:Transmit Time property defines the time between cycles. and an input session acts as a receiving ECU. a vehicle). The transmitting ECU responds to each CAN remote frame by transmitting the associated CAN data frame. In the following description. it describes the transfer between ECUs in the network.TimingType Description Specifies the CAN frame timing. Receiving ECU refers to an ECU that receives the CAN data frame (and possibly transmits the associated CAN remote frame).com .Chapter 4 NI-XNET API for LabVIEW — XNET Frame Property Node CAN:Timing Type Data Type Direction Read/Write Required? Default No Event Data (If Not in Database) Property Class XNET Frame Short Name CAN. The CAN timing types (decimal value in parentheses) are: Cyclic Data (0) The transmitting ECU transmits the CAN data frame in a cyclic (periodic) manner. refer to CAN Timing Type and Session Mode. The XNET Frame CAN:Transmit Time property defines the time between cycles. The receiving ECU transmits the CAN remote frame in a cyclic (periodic) manner. The transmitting ECU ignores CAN remote frames received for this frame.vi. The transmitting ECU ignores CAN remote frames received for this frame. For NI-XNET. an output session acts as the transmitting ECU. transmitting ECU refers to the ECU that transmits the CAN data frame (and possibly receives the associated CAN remote frame). Because this property specifies the behavior of the frame’s transfer within the embedded system (for example.

For NI-XNET. If NI-XNET finds an attribute named GenMsgSendType. Within your application. the event occurs when you call XNET Write. otherwise. change this property to the desired timing type. this property is a required part of the XML schema for a frame. If the GenMsgSendType attribute begins with cyclic.ncd database or an in-memory database (XNET Create Frame).dbc) database. this property is an optional attribute in the file.vi. so the default (initial) value is obtained from the file. this property’s default value is Cyclic Data. If the CANdb file does not use the GenMsgSendType attribute. If you are using an . The transmitting ECU responds to each CAN remote frame by transmitting the associated CAN data frame. this property uses a default value of Event Data. If you are using a FIBEX database. © National Instruments Corporation 4-239 NI-XNET Hardware and Software Manual . which you can change in your application. If you are using a CANdb (.Chapter 4 NI-XNET API for LabVIEW — XNET Frame Property Node Event Remote (3) The receiving ECU transmits the CAN remote frame in an event-driven manner. The XNET Frame CAN:Transmit Time property defines the minimum interval. this property uses a default value of Event Data. it is Event Data. that attribute is the default value of this property.

this property is an optional attribute in the file. this property uses a default value of 0. The units are in seconds. A time of 0.0 is invalid. so the default (initial) value is obtained from the file. which you can change in your application. this property is rounded to the nearest 500 μs increment (0.0005). For a CAN:Timing Type of Event Data or Event Remote. For a CAN:Timing Type of Cyclic Data or Cyclic Remote. If you are using a . The time is measured from the end of previous frame (acknowledgment) to the start of the next frame. this property specifies the time between consecutive data/remote frames.Chapter 4 NI-XNET API for LabVIEW — XNET Frame Property Node CAN:Transmit Time Data Type Direction Read/Write Required? Default No 0.com . If the CANdb file does not use the GenMsgCycleTime attribute.TxTime Description Specifies the time between consecutive frames from the transmitting ECU. NI-XNET Hardware and Software Manual 4-240 ni. A time of 0.0 specifies no minimum (back to back frames allowed). this property is a required part of the XML schema for a frame. Therefore. If you are using a FIBEX database. Within your application. This is also known as the debounce time or minimum interval. Although the fractional part of the DBL data type can provide resolution of picoseconds. when used within an NI-XNET output session. this property specifies the minimum time between consecutive data/remote frames when the event occurs quickly.dbc) database. The data type is 64-bit floating point (DBL). this property uses a default value of 0.ncd database or an in-memory database (XNET Create Frame).1 (100 ms).1 (100 ms). that attribute is interpreted as a number of milliseconds and used as the default value of this property. change this property to the desired time.1 (If Not in Database) Property Class XNET Frame Short Name CAN. If you are using a CANdb (. the NI-XNET CAN transmit supports an accuracy of 500 μs. If NI-XNET finds an attribute named GenMsgCycleTime.

You cannot change the parent cluster after the frame object has been created.Chapter 4 NI-XNET API for LabVIEW — XNET Frame Property Node Cluster Data Type Direction Read Only Required? Default N/A N/A Property Class XNET Frame Short Name Cluster Description This property returns the refnum to the parent cluster in which the frame has been created. Comment Data Type Direction Read/Write Required? Default No Empty String Property Class XNET Frame Short Name Comment Description Comment describing the frame object. A comment is a string containing up to 65535 characters. © National Instruments Corporation 4-241 NI-XNET Hardware and Software Manual .

FlexRay frames must use 0 to 254 bytes (even numbers only). By default. the frame still is returned from the XNET Cluster Frames property even if ShowInvalidFromOpen? is false.com .Chapter 4 NI-XNET API for LabVIEW — XNET Frame Property Node Configuration Status Data Type Direction Read Only Required? Default N/A N/A Property Class XNET Frame Short Name ConfigStatus Description The frame object configuration status. The FlexRay frame is specified to use channels not defined in the cluster. For example. The CAN arbitration ID is invalid. When a frame configuration status became invalid after the database is opened. CAN frames must use 0 to 8 bytes. Examples of invalid frame configuration: • • • • A required property of the frame or an object contained in this frame has not been defined. The number of bytes specified for this frame is incorrect. For example.vi error code input to convert the value to a text description (on message output) of the configuration problem. but dynamic frames can be sent on only one channel (A or B). Frame Payload Length. You can pass the value to the Simple Error Handler. incorrectly configured frames in the database are not returned from the XNET Cluster Frames property because they cannot be used in the bus communication. the XNET Cluster FlexRay:Channels property is set to Channel A only. • NI-XNET Hardware and Software Manual 4-242 ni. You can change this behavior by setting the XNET Database ShowInvalidFromOpen? property to true. The standard ID is greater than 0x7FF (11 bits) or the extended ID is greater than 0x1FFFFFFF (29 bits). but the XNET Frame FlexRay:Channel Assignment property is set to Channel A and B. Configuration Status returns an NI-XNET error code. The XNET Frame FlexRay:Channel Assignment property in this dynamic FlexRay frame is set to Channel A and B.

vi) FlexRay:Timing Type of Cyclic © National Instruments Corporation 4-243 NI-XNET Hardware and Software Manual . This can occur when you set the XNET Session Auto Start? property to false and call XNET Start.vi also starts frame transmit. When Auto Start? is true (default). so this property is not used. The number of bytes in the array must match the XNET Frame Payload Length property.vi: • • • • CAN:Timing Type of Cyclic Data CAN:Timing Type of Cyclic Remote (for example. this property’s use varies depending on the session mode. specified as an array of bytes (U8). The following frame configurations potentially can transmit prior to a call to XNET Write. this property is not provided in the database file.vi prior to XNET Write.vi) CAN:Timing Type of Event Remote (for example.vi. the first call to XNET Write. This property’s initial value is an array of all 0. The following sections describe this property’s behavior for each session mode.vi. Frame Output Single-Point and Frame Output Queued Modes Use this property when a frame transmits prior to a call to XNET Write.Chapter 4 NI-XNET API for LabVIEW — XNET Frame Property Node Default Payload Data Type Direction Read/Write Required? Default No Array of All 0 Property Class XNET Frame Short Name DefaultPayload Description The frame default payload. a remote frame received prior to a call to XNET Write. a remote frame received prior to a call to XNET Write. When you use this frame within an NI-XNET session. For the database formats NI-XNET supports.

vi returns prior to receiving the first frame. Each XNET Signal Default Value is used when XNET Read.vi. Refer to Frame Output Single-Point and Frame Output Queued Modes for a list of applicable frame configurations.vi. Transmit is limited to frames provided to XNET Write. so this property is not used: • • CAN:Timing Type of Event Data FlexRay:Timing Type of Event Frame Output Stream Mode This property is not used. and Signal Input XY Modes This property is not used. This property is used as the initial payload.vi is called prior to receiving the first frame. and Signal Output XY Modes Use this property when a frame transmits prior to a call to XNET Write. Frame Input Stream and Frame Input Queued Modes This property is not used. NI-XNET Hardware and Software Manual 4-244 ni. Signal Input Waveform.com . and the result is used for the frame transmit.vi. Signal Input Single-Point. then each XNET Signal Default Value is mapped into that payload. Signal Output Waveform. Frame Input Single-Point Mode This property is used for frames XNET Read. Signal Output Single-Point. These modes do not return data prior to receiving frames.Chapter 4 NI-XNET API for LabVIEW — XNET Frame Property Node The following frame configurations cannot transmit prior to a call to XNET Write.

It allows sending multiple frames in the same slot. 3.. . NI-XNET has two mechanisms for changing the frame sending frequency: • • If the frame should be sent faster than the cycle period.. The cycle number is common for all nodes on the bus. Every node on the bus provides a 6-bit cycle counter that counts the cycles from 0 to 63 and then restarts at 0. 6. 16.. If a frame should be sent in every cycle. 4.Chapter 4 NI-XNET API for LabVIEW — XNET Frame Property Node FlexRay:Base Cycle Data Type Direction Read/Write Required? Default Yes N/A Property Class XNET Frame Short Name FlexRay.BaseCycle Description The first communication cycle in which a frame is sent. For cycle multiplexing. In FlexRay.. use In-Cycle Repetition (refer to the XNET Frame FlexRay:In Cycle Repetitions:Identifiers property). set the XNET Frame FlexRay:Cycle Repetition property to 2.. Example: • • FrameA and FrameB are both sent in slot 12. This frame is sent when the cycle counter has the value 1. FrameA: The XNET Frame FlexRay:Base Cycle property is 0 and XNET Frame FlexRay:Cycle Repetition property is 2. FrameB: The XNET Frame FlexRay:Base Cycle property is 1 and XNET Frame FlexRay:Cycle Repetition property is 2. . a communication cycle contains a number of slots in which a frame can be sent. The second method is called cycle multiplexing. but on different cycle counters. • © National Instruments Corporation 4-245 NI-XNET Hardware and Software Manual .. 4. 32. use this property and the XNET Frame FlexRay:Cycle Repetition property. or 64. 8. 7. This frame is sent when the cycle counter has the value 0. If the frame should be sent slower than the cycle period. 5. 2. set this property to 0 and the XNET Frame FlexRay:Cycle Repetition property to 1.

The file formats require a valid value in the text for this property. the session returns an error. so you must set a valid value prior to creating a session. The property does not contain a default in this case. If the property does not contain a valid value. NI-XNET Hardware and Software Manual 4-246 ni. you can do one of the following: • • Use a database file (or alias) to create the session.com . This is needed when you create your own in-memory database (:memory:) rather than use a file.Chapter 4 NI-XNET API for LabVIEW — XNET Frame Property Node This property is required. refer to Databases. Set a value in LabVIEW using the property node. For more information about using database files and in-memory databases. To ensure that the property contains a valid value. and you create an XNET session that uses this frame.

and you create an XNET session that uses this frame.Chapter 4 NI-XNET API for LabVIEW — XNET Frame Property Node FlexRay:Channel Assignment Data Type Direction Read/Write Required? Default Yes N/A Property Class XNET Frame Short Name FlexRay. refer to Databases. If the property does not contain a valid value. © National Instruments Corporation 4-247 NI-XNET Hardware and Software Manual . Set a value in LabVIEW using the property node. For more information about using database files and in-memory databases. This is needed when you create your own in-memory database (:memory:) rather than use a file.ChAssign Description This property determines on which FlexRay channels the frame must be transmitted. Frames in the dynamic segment use slot IDs greater than the number of static slots cluster parameter. they must use either channel A or B. you can do one of the following: • • Use a database file (or alias) to create the session. the session returns an error. Frames in the dynamic FlexRay segment cannot be sent on both channels. configured in the XNET Cluster FlexRay:Channels property. so you must set a valid value prior to creating a session. The file formats require a valid value in the text for this property. A frame can be transmitted only on existing FlexRay channels. To ensure that the property contains a valid value. This property is required. The property does not contain a default in this case.

or 64. Every node on the bus provides a 6-bit cycle counter that counts the cycles from 0 to 63 and then restarts at 0.. 32. 4. NI-XNET has two mechanisms for changing the frame sending frequency: • • If the frame should be sent faster than the cycle period.. FrameA: The XNET Frame FlexRay:Base Cycle property is set to 0 and XNET Frame FlexRay:Cycle Repetition property is set to 2. use the XNET Frame FlexRay:Base Cycle property and this property. This frame is sent when the cycle counter has the value 1. For cycle multiplexing. 4. use In-Cycle Repetition (refer to the XNET Frame FlexRay:In Cycle Repetitions:Identifiers property). Examples: • • FrameA and FrameB are both sent in slot 12. 2. This frame is sent when the cycle counter has the value 0. FrameB: The XNET Frame FlexRay:Base Cycle property is set to 1 and XNET Frame FlexRay:Cycle Repetition property is set to 2. set the XNET Frame FlexRay:Base Cycle property to 0 and this property to 1. . The second method is called cycle multiplexing. 5. but on different cycle counters.. In FlexRay. 3. • NI-XNET Hardware and Software Manual 4-248 ni. a communication cycle contains a number of slots in which a frame can be sent. If a frame should be sent in every cycle. set this property to 2. . The cycle number is common for all nodes on the bus.CycleRep Description The number of cycles after which a frame is sent again.. 6.Chapter 4 NI-XNET API for LabVIEW — XNET Frame Property Node FlexRay:Cycle Repetition Data Type Direction Read/Write Required? Default Yes N/A Property Class XNET Frame Short Name FlexRay.com .. 7. It allows sending multiple frames in the same slot. 16.. If the frame should be sent slower than the cycle period. 8.

so you must set a valid value prior to creating a session. © National Instruments Corporation 4-249 NI-XNET Hardware and Software Manual . To ensure that the property contains a valid value. the session returns an error. The property does not contain a default in this case. you can do one of the following: • • Use a database file (or alias) to create the session. and you create an XNET session that uses this frame. The file formats require a valid value in the text for this property. This is needed when you create your own in-memory database (:memory:) rather than use a file. refer to Databases. For more information about using database files and in-memory databases. If the property does not contain a valid value.Chapter 4 NI-XNET API for LabVIEW — XNET Frame Property Node This property is required. Set a value in LabVIEW using the property node.

Preamble? Description This property determines whether payload preamble is used in a FlexRay frame: • • For frames in the static segment. NI-XNET Hardware and Software Manual 4-250 ni.Chapter 4 NI-XNET API for LabVIEW — XNET Frame Property Node FlexRay:Payload Preamble? Data Type Direction Read/Write Required? Default No False Property Class XNET Frame Short Name FlexRay.com . it indicates that the message ID is transmitted at the beginning of the payload. it indicates that the network management vector is transmitted at the beginning of the payload. For frames in the dynamic segment.

the XNET Frame FlexRay:Sync? property automatically is set to true.Chapter 4 NI-XNET API for LabVIEW — XNET Frame Property Node FlexRay:Startup? Data Type Direction Read/Write Required? Default No False Property Class XNET Frame Short Name FlexRay. this property automatically is set to false. • • • • When this property is set to true. this property is not changed. The startup frame. is returned from the XNET ECU FlexRay:Startup Frame property.Startup? Description This property determines whether the frame is a FlexRay startup frame. An ECU can send only one startup frame. FlexRay startup frames always are FlexRay sync frames also. © National Instruments Corporation 4-251 NI-XNET Hardware and Software Manual . When this property is set to false. if an ECU transmits it. When the XNET Frame FlexRay:Sync? property is set to true. the XNET Frame FlexRay:Sync? property is not changed. When the XNET Frame FlexRay:Sync? property is set to false.

the XNET Frame FlexRay:Startup? property is automatically set to false. NI-XNET Hardware and Software Manual 4-252 ni. When the XNET Frame FlexRay:Startup? property is set to false. An ECU can send only one sync frame.com . When this property is set to true. the XNET Frame FlexRay:Startup? property is not changed. this property is set to true.Chapter 4 NI-XNET API for LabVIEW — XNET Frame Property Node FlexRay:Sync? Data Type Direction Read/Write Required? Default No False Property Class XNET Frame Short Name FlexRay. this property is not changed. When the XNET Frame FlexRay:Startup? property is set to true. FlexRay startup frames always are FlexRay sync frames also: • • • • When this property is set to false.Sync? Description This property determines whether the frame is a FlexRay sync frame.

If new data is not provided for the cycle.TimingType Description Specifies the FlexRay frame timing (decimal value in parentheses): Cyclic (0) Event (1) Payload data transmits on every occurrence of the frame’s slot. Within the ECU that transmits the frame. the frame is static. If the frame’s Identifier (slot) is less than or equal to the cluster’s Number Of Static Slots. refer to FlexRay Timing Type and Session Mode. Payload data transmits in an event-driven manner. Event means the frame transmits in the minislot when the event is pending for the cycle. © National Instruments Corporation 4-253 NI-XNET Hardware and Software Manual . Event means a null frame is transmitted when no event is pending for the cycle. Static Cyclic means no null frame is transmitted. This property’s behavior depends on the FlexRay segment where the frame is located: static or dynamic. Dynamic Cyclic means the frame transmits in its minislot on every cycle.Chapter 4 NI-XNET API for LabVIEW — XNET Frame Property Node FlexRay:Timing Type Data Type Direction Read/Write Required? Default No Cyclic in Static Segment. the event typically is associated with the availability of new data. Event in Dynamic Segment Property Class XNET Frame Short Name FlexRay. This property’s default value for the static segment is Cyclic. the previous payload data transmits again. This property’s default value for the dynamic segment is Event. For a description of how these FlexRay timing types apply to the NI-XNET session mode.

The XNET Frame FlexRay:Channel Assignment property defines the first channel assignment in the cycle. FlexRay:Channel Assignment is a required property that is undefined when a new frame is created. When FlexRay:Channel Assignment is undefined.InCycRep. Both properties are arrays of maximum three values. determining the slot ID and channel assignments for the frame. NI-XNET Hardware and Software Manual 4-254 ni.com .ChAssigns Description FlexRay channels for in-cycle frame repetition. This property defines subsequent channel assignments. The XNET Frame FlexRay:In Cycle Repetitions:Identifiers property defines the corresponding slot IDs. setting the FlexRay:Channel Assignment first (the properties in a property node are set starting from top position to bottom).Chapter 4 NI-XNET API for LabVIEW — XNET Frame Property Node FlexRay:In Cycle Repetitions:Channel Assignments Data Type Direction Read/Write Required? Default No Empty Array Property Class XNET Frame Short Name FlexRay. therefore. both arrays must have the same size. setting FlexRay:In Cycle Repetitions:Channel Assignments returns an error. A FlexRay frame can be sent multiple times per cycle. Values at the same array position are corresponding. For convenience. You must set the FlexRay:Channel Assignment property before setting this property. you can set both properties in one XNET Frame property node.

Chapter 4 NI-XNET API for LabVIEW — XNET Frame Property Node FlexRay:In Cycle Repetitions:Enabled? Data Type Direction Read Only Required? Default No False Property Class XNET Frame Short Name FlexRay. and the XNET Frame FlexRay:In Cycle Repetitions:Channel Assignments property defines the corresponding FlexRay channels. Both properties are arrays of maximum three values determining the slot ID and FlexRay channels for the frame. The XNET Frame FlexRay:In Cycle Repetitions:Identifiers property can define the subsequent slot IDs. A FlexRay frame can be sent multiple times per cycle. In this case. which means that both the FlexRay:In Cycle Repetitions:Identifiers and FlexRay:In Cycle Repetitions:Channel Assignments arrays are not empty. This property returns false when at least one of the previously mentioned arrays is empty. This property returns true when at least one in-cycle repetition has been defined. The XNET Frame Identifier property defines the first slot ID in the cycle. therefore. in-cycle-repetition is not used.Enabled? Description FlexRay in-cycle frame repetition is enabled. © National Instruments Corporation 4-255 NI-XNET Hardware and Software Manual .InCycRep. both arrays must have the same size. Values at the same array position are corresponding.

Both properties are arrays of maximum three values. you can set both properties in one XNET Frame property node. setting in-cycle repetition slot IDs returns an error.IDs Description FlexRay in-cycle repetition slot IDs. The XNET Frame FlexRay:In Cycle Repetitions:Channel Assignments property defines the corresponding FlexRay channel assignments. A FlexRay frame can be sent multiple times per cycle. both arrays must have the same size. The FlexRay:In Cycle Repetitions:Identifiers property defines subsequent slot IDs.Chapter 4 NI-XNET API for LabVIEW — XNET Frame Property Node FlexRay:In Cycle Repetitions:Identifiers Data Type Direction Read/Write Required? Default No Empty Array Property Class XNET Frame Short Name FlexRay. Values at the same array position are corresponding. When Identifier is undefined. determining the subsequent slot IDs and channel assignments for the frame. You must set the XNET Frame Identifier property before setting the FlexRay:In Cycle Repetitions:Identifiers property. NI-XNET Hardware and Software Manual 4-256 ni. For your convenience.InCycRep. The XNET Frame Identifier property defines the first slot ID in the cycle. Identifier is a required property that is undefined when a new frame is created.com . therefore. setting the Identifier first (the properties in a property node are set starting from top position to bottom).

this is the standard CAN identifier with a size of 11 bits. the frame is sent in the communication cycle static segment. However. © National Instruments Corporation 4-257 NI-XNET Hardware and Software Manual . which results in allowed range of 0–536870911. so the working range of identifiers is 0–2031. The slot ID determines whether a FlexRay frame is sent in a static or dynamic segment. CAN For CAN frames. FlexRay For FlexRay frames. The valid value range for a FlexRay Slot ID is 1–2047. When the XNET Frame CAN:Extended Identifier? property is set to false. You can define subsequent slot IDs for the frame in the XNET Frame FlexRay:In Cycle Repetitions:Identifiers property. this is the Arbitration ID. this is the Slot ID in which the frame is sent. this is the extended CAN identifier with a size of 29 bits. When the XNET Frame CAN:Extended Identifier? property is set to true. Use this concept to increase a frame’s sending frequency. If the slot ID is less than or equal to the XNET Cluster FlexRay:Number of Static Slots property. which results in allowed range of 0–2047. otherwise. To decrease a frame’s sending frequency and share the same slot for different frames depending on the cycle counter. it is sent in the dynamic segment. You also can send a FlexRay frame in multiple slots per cycle. the CAN standard disallows identifiers in which the first 7 bits are all recessive. refer to the XNET Frame FlexRay:Base Cycle and FlexRay:Cycle Repetition properties.Chapter 4 NI-XNET API for LabVIEW — XNET Frame Property Node Identifier Data Type Direction Read/Write Required? Default Yes N/A Property Class XNET Frame Short Name ID Description Determines the frame identifier.

you can do one of the following: • • Use a database file (or alias) to create the session. so you must set a valid value prior to creating a session. the session returns an error. The property does not contain a default in this case. this is reported as an error in the XNET Frame Configuration Status property. For more information on using database files and in-memory databases. The file formats require a valid value in the text for this property. This is needed when you create your own in-memory database (:memory:) rather than use a file. refer to Databases. NI-XNET Hardware and Software Manual 4-258 ni.Chapter 4 NI-XNET API for LabVIEW — XNET Frame Property Node If the frame identifier is not in the allowed range. If the property does not contain a valid value.com . Set a value in LabVIEW using the property node. To ensure that the property contains a valid value. and you create an XNET Session that uses this frame. This property is required.

You can create a data multiplexer signal by creating a signal and then setting the XNET Signal Mux:Data Multiplexer? property to true. Mux:Is Data Multiplexed? Data Type Direction Read Only Required? Default No False Property Class XNET Frame Short Name Mux. If the data multiplexer is not defined in the frame. This property returns a refnum to the data multiplexer signal. the I/O control is empty. A frame can contain only one data multiplexer signal.Chapter 4 NI-XNET API for LabVIEW — XNET Frame Property Node Mux:Data Multiplexer Signal Data Type Direction Read Only Required? Default N/A N/A Property Class XNET Frame Short Name DataMuxSig Description Data multiplexer signal in the frame. Use the XNET Frame Mux:Is Data Multiplexed? property to determine whether the frame contains a multiplexer signal. © National Instruments Corporation 4-259 NI-XNET Hardware and Software Manual .IsMuxed? Description Frame is data multiplexed. Frames containing a multiplexer contain subframes that allow using bits of the frame payload for different information (signals) depending on the multiplexer value. This property returns true if the frame contains a multiplexer signal.

Chapter 4 NI-XNET API for LabVIEW — XNET Frame Property Node Mux:Static Signals Data Type Direction Read Only Required? Default N/A N/A Property Class XNET Frame Short Name Mux. as opposed to dynamic signals. Returns an array of refnums to signals in the frame that do not depend on the multiplexer value. Only one subframe at a time is transmitted in the frame. You can create dynamic signals by specifying a subframe as the parent. If the frame is not multiplexed. Mux:Subframes Data Type Direction Read Only Required? Default N/A N/A Property Class XNET Frame Short Name Mux. A subframe defines a group of signals transmitted using the same multiplexer value. You can create static signals by specifying the frame as the parent object.StatSigs Description Static signals in the frame.Subframes Description Returns an array of references to subframes in the frame. NI-XNET Hardware and Software Manual 4-260 ni. this property returns the same array as the XNET Frame Signals property. Static signals are contained in every frame transmitted. A subframe is defined by creating a subframe object as a child of a frame. which are transmitted depending on the multiplexer value.com .

vi to the XNET String to IO Name. A frame name must be unique for all frames in a cluster. The fully qualified name is available by using the XNET Signal I/O name as a string.Chapter 4 NI-XNET API for LabVIEW — XNET Frame Property Node Name (Short) Data Type Direction Read/Write Required? Default Yes Defined in Create Object Property Class XNET Frame Short Name NameShort Description String identifying a frame object. dot (. It is for display purposes. The short name must begin with a letter (uppercase or lowercase) or underscore. Wire the result from Search and Replace String Function. You can write this property to change the frame’s short name.vi with the old Name as the search string and the new Name as the replacement string. Get the old Name (Short) property using the property node. Valid characters for the short name are lowercase letters. uppercase letters. Set the new Name (Short) property for the object.vi. This short name does not include qualifiers to ensure that it is unique.). Space ( ). and not a number. When you do this and then use the original XNET Frame that contains the old name. The short name is limited to 128 characters. 4. 5. This replaces the short name in the XNET Frame. 2. Wire the XNET Frame as the input string to Search and Replace String Function. 3. Follow these steps to avoid this problem: 1.vi. and other special characters are not supported within the name. numbers. © National Instruments Corporation 4-261 NI-XNET Hardware and Software Manual . Wire the close all? input as false to close the renamed object only. Close the object using XNET Database Close. and underscore (_). such as the database and cluster name. while retaining the other text that ensures a unique name. This casts the string back to a valid XNET Frame. errors can result because the old name cannot be found.

5 or 8. If you are using LabVIEW 2009 or later. If you are using LabVIEW 8. you can wire the new name to the next VI or property node (no need for explicit open). The following diagram demonstrates steps 1 through 5 for an XNET Frame I/O name: NI-XNET Hardware and Software Manual 4-262 ni. call XNET Database Open.6.com .vi to reopen the object with the new name.Chapter 4 NI-XNET API for LabVIEW — XNET Frame Property Node 6.

The property does not contain a default in this case. refer to Databases. For example. so its value can be odd. this is 0–254. Nevertheless. This property is required. the session returns an error. it is valid for this property to be 15. This is needed when you create your own in-memory database (:memory:) rather than use a file. For CAN.Chapter 4 NI-XNET API for LabVIEW — XNET Frame Property Node Payload Length Data Type Direction Read/Write Required? Default Yes N/A Property Class XNET Frame Short Name PayldLen Description Number of bytes of data in the payload. For FlexRay. As encoded on the FlexRay bus. so you must set a valid value prior to creating a session. The file formats require a valid value in the text for this property. and you create an XNET session that uses this frame. Set a value in LabVIEW using the property node. which specifies that the last 3 bytes are unused. For more information about using database files and in-memory databases. all frames use an even payload (16-bit words). if a FlexRay cluster uses static slots of 18 bytes. this property specifies the number of payload bytes used within the frame. you can do one of the following: • • Use a database file (or alias) to create the session. If the property does not contain a valid value. and the payload of all static slots must be the same. this is 0–8. © National Instruments Corporation 4-263 NI-XNET Hardware and Software Manual . To ensure that the property contains a valid value.

You can add signals to a frame using XNET Database Create Object.vi and remove them using XNET Database Delete Object. This property returns an array with references to all signals in the frame. This property is read only.com .Chapter 4 NI-XNET API for LabVIEW — XNET Frame Property Node Signals Data Type Direction Read Only Required? Default N/A N/A Property Class XNET Frame Short Name Sigs Description Refnums to all signals in the frame. including static and dynamic signals and the multiplexer signal. NI-XNET Hardware and Software Manual 4-264 ni.vi.

For help on a specific property. Right-click to change direction between read and write. For more information about LabVIEW property nodes. control. Right-click each property name to create a constant. Pull down this node to add properties. open the main LabVIEW help (select Search the LabVIEW Help from the Help menu) and look for the Property Nodes topic in the index. You drag a constant to the block diagram of your VI. refer to XNET Frame I/O Name. prior to running the VI. then select a frame. XNET Subframe Property Node Format Description Property node used to read/write properties for an XNET Subframe I/O Name. For a complete description.Chapter 4 NI-XNET API for LabVIEW — XNET Frame Constant XNET Frame Constant This constant provides the constant form of the XNET Frame I/O name. open the LabVIEW context help window (<Ctrl-H>) and move your cursor over the property name. © National Instruments Corporation 4-265 NI-XNET Hardware and Software Manual . You can change constants only during configuration. or indicator.

This property returns an array of refnums to dynamic signals in the subframe.Chapter 4 NI-XNET API for LabVIEW — XNET Subframe Property Node Dynamic Signals Data Type Direction Read Only Required? Default N/A N/A Property Class XNET Subframe Short Name DynSig Description Dynamic signals in the subframe. and you cannot change it afterwards. The parent frame is defined when the subframe is created. Those signals are transmitted when the multiplexer signal in the frame has the multiplexer value defined in the subframe.com . NI-XNET Hardware and Software Manual 4-266 ni. Frame Data Type Direction Read Only Required? Default N/A N/A Property Class XNET Subframe Short Name Frame Description Returns the refnum to the parent frame.vi by specifying a subframe as the parent. Dynamic signals are created with XNET Database Create Object.

Set a value in LabVIEW using the property node. The property does not contain a default in this case. refer to Databases. This is needed when you create your own in-memory database (:memory:) rather than use a file. The file formats require a valid value in the text for this property. This property specifies the multiplexer signal value used when the dynamic signals in this subframe are transmitted in the frame.Chapter 4 NI-XNET API for LabVIEW — XNET Subframe Property Node Multiplexer Value Data Type Direction Read/Write Required? Default Yes N/A Property Class XNET Subframe Short Name MuxValue Description Multiplexer value for this subframe. and you create an XNET session that uses this subframe. It reflects the value set on the parent subframe object. © National Instruments Corporation 4-267 NI-XNET Hardware and Software Manual . For more information about using database files and in-memory databases. you can do one of the following: • • Use a database file (or alias) to create the session. This property is required. There is also a multiplexer value for a signal object as a read-only property. Only one subframe is transmitted at a time in the frame. so you must set a valid value prior to creating a session. To ensure that the property contains a valid value. If the property does not contain a valid value. the session returns an error.

3. Wire the result from Search and Replace String Function.vi. This casts the string back to a valid XNET Subframe. and other special characters are not supported within the name. cluster.vi with the old Name as the search string and the new Name as the replacement string.Chapter 4 NI-XNET API for LabVIEW — XNET Subframe Property Node Name (Short) Data Type Direction Read/Write Required? Default Yes Defined in Create Object Property Class XNET Subframe Short Name NameShort Description String identifying a subframe object. This short name does not include qualifiers to ensure that it is unique. Set the new Name (Short) property for the object.com . numbers. and not a number. Space ( ). Valid characters for the short name are lowercase letters. Follow these steps to avoid this problem: 1. 2. You can write this property to change the subframe’s short name. A subframe name must be unique for all subframes in a frame. uppercase letters. Wire the XNET Subframe as the input string to Search and Replace String Function. The short name must begin with a letter (uppercase or lowercase) or underscore. 5. The short name is limited to 128 characters. It is for display purposes.vi. This replaces the short name in the XNET Subframe. errors can result because the old name cannot be found. When you do this and then use the original XNET Subframe that contains the old name. while retaining the other text that ensures a unique name. Wire the close all? input as false to close the renamed object only. Get the old Name (Short) property using the property node. The fully qualified name is available by using the XNET Signal I/O name as a string. Close the object using XNET Database Close. NI-XNET Hardware and Software Manual 4-268 ni. 4.).vi to XNET String to IO Name. and frame name. and underscore (_). dot (. such as the database.

The following diagram demonstrates steps 1 through 5 for an XNET Frame I/O name: © National Instruments Corporation 4-269 NI-XNET Hardware and Software Manual .Chapter 4 NI-XNET API for LabVIEW — XNET Subframe Property Node 6. If you are using LabVIEW 2009 or later. call XNET Database Open.vi to reopen the object with the new name.5 or 8.6. you can wire the new name to the next VI or property node (no need for explicit open). If you are using LabVIEW 8.

com .Chapter 4 NI-XNET API for LabVIEW — XNET Signal Property Node XNET Signal Property Node Format Description Property node used to read/write properties for an XNET Signal I/O Name. or indicator. control. Pull down this node to add properties. Right-click to change direction between read and write. open the LabVIEW context help window (<Ctrl-H>) and move your cursor over the property name. NI-XNET Hardware and Software Manual 4-270 ni. open the main LabVIEW help (select Search the LabVIEW Help from the Help menu) and look for the Property Nodes topic in the index. For help on a specific property. Right-click each property name to create a constant. For more information about LabVIEW property nodes.

Chapter 4 NI-XNET API for LabVIEW — XNET Signal Property Node Byte Order Data Type Direction Read/Write Required? Default Yes N/A Property Class XNET Signal Short Name ByteOrdr Description Signal byte order in the frame payload. Figure 4-7. • Little Endian: Higher significant signal bits are placed on higher byte addresses. this was called Intel Byte Order. In NI-CAN. Little Endian Signal with Start Bit 12 © National Instruments Corporation 4-271 NI-XNET Hardware and Software Manual . This property defines how signal bytes are ordered in the frame payload when the frame is loaded in memory.

The file formats require a valid value in the text for this property. you can do one of the following: • • Use a database file (or alias) to create the session. and you create an XNET session that uses this signal. In NI-CAN.com . This is needed when you create your own in-memory database (:memory:) rather than use a file. refer to Databases. Big Endian Signal with Start Bit 12 This property is required. Figure 4-8. Set a value in LabVIEW using the property node. the session returns an error. NI-XNET Hardware and Software Manual 4-272 ni. For more information about using database files and in-memory databases. To ensure that the property contains a valid value. The property does not contain a default in this case. this was called Motorola Byte Order. so you must set a valid value prior to creating a session.Chapter 4 NI-XNET API for LabVIEW — XNET Signal Property Node • Big Endian: Higher significant signal bits are placed on lower byte addresses. If the property does not contain a valid value.

A comment is a string containing up to 65535 characters. © National Instruments Corporation 4-273 NI-XNET Hardware and Software Manual .Chapter 4 NI-XNET API for LabVIEW — XNET Signal Property Node Comment Data Type Direction Read/Write Required? Default No Empty String Property Class XNET Signal Short Name Comment Description Comment describing the signal object.

By default. This is not allowed due to internal limitation of the double data type that NI-XNET uses for signal values.vi error code input to convert the value to a text description (on message output) of the configuration problem. When a signal configuration status becomes invalid after the database is opened. • NI-XNET Hardware and Software Manual 4-274 ni. incorrectly configured signals in the database are not returned from the XNET Frame Signals property because they cannot be used in the bus communication. the signal still is returned from the XNET Frame Signals property even if the XNET Database ShowInvalidFromOpen? property is false. The signal overlaps another signal in the frame. For example. Configuration Status returns an NI-XNET error code. The signal with integer data type (signed or unsigned) is specified with more than 52 bits. Examples of invalid signal configuration: • • • The signal is specified using bits outside the frame payload. two multiplexed signals with the same multiplexer value are using the same bit in the frame payload.com . The frame containing the signal is invalid (for example. a CAN frame is defined with more than 8 payload bytes). You can pass the value to the Simple Error Handler. You can change this behavior by setting the XNET Database ShowInvalidFromOpen? property to true.Chapter 4 NI-XNET API for LabVIEW — XNET Signal Property Node Configuration Status Data Type Direction Read Only Required? Default No N/A Property Class XNET Signal Short Name ConfigStatus Description The signal object configuration status.

If the property does not contain a valid value. This property determines how the bits of a signal in a frame must be interpreted to build a value. © National Instruments Corporation 4-275 NI-XNET Hardware and Software Manual . you can do one of the following: • • Use a database file (or alias) to create the session. • • • Signed: Signed integer with positive and negative values. This is needed when you create your own in-memory database (:memory:) rather than use a file. The property does not contain a default in this case. Set a value in LabVIEW using the property node. and you create an XNET session that uses this signal. so you must set a valid value prior to creating a session. For more information about using database files and in-memory databases. the session returns an error. The file formats require a valid value in the text for this property.Chapter 4 NI-XNET API for LabVIEW — XNET Signal Property Node Data Type Data Type Direction Read/Write Required? Default Yes N/A Property Class XNET Signal Short Name DataType Description The signal data type. This property is required. Unsigned: Unsigned integer with no negative values. To ensure that the property contains a valid value. IEEE Float: Float value with 7 or 15 significant decimal digits (32 bit or 64 bit). refer to Databases.

Chapter 4 NI-XNET API for LabVIEW — XNET Signal Property Node Default Value Data Type Direction Read/Write Required? Default No 0.vi. specified as scaled floating-point units.vi is called prior to receiving the first frame.com . this property is returned for each signal when XNET Read. and the result is used for the frame transmit. refer to the discussion of Read/Write for each session mode. this property uses a default value of 0. For all three signal input sessions. NI-XNET Hardware and Software Manual 4-276 ni. If the database does not provide a value. For all three signal output sessions. The data type is 64-bit floating point (DBL). The XNET Frame Default Payload property is used as the initial payload.0.0 (If Not in Database) Property Class XNET Signal Short Name Default Description The signal default value. then the default value of each signal is mapped into that payload using this property. For more information about when this property is used. The initial value of this property comes from the database. this property is used when a frame transmits prior to a call to XNET Write.

create the signal object as a child of a subframe instead of a frame. Dynamic signals are transmitted in the frame when the multiplexer signal in the frame has a given value specified in the subframe.Dynamic? Description Use this property to determine if a signal is static or dynamic. To create a dynamic signal. dynamic signals were called mode-dependent signals. © National Instruments Corporation 4-277 NI-XNET Hardware and Software Manual . In NI-CAN. The dynamic signal cannot be changed to a static signal afterwards. Use the Multiplexer Value property to determine with which multiplexer value the dynamic signal is transmitted.Chapter 4 NI-XNET API for LabVIEW — XNET Signal Property Node Mux:Dynamic? Data Type Direction Read Only Required? Default No False Property Class XNET Signal Short Name Mux. This property is read only.

0 Property Class XNET Signal Short Name Max Description The scaled signal value maximum.vi do not limit the signal value to a maximum value. In LabVIEW.vi and XNET Write. You cannot change it afterwards. The parent frame is defined when the signal object is created.com . Use this database property to set the maximum value. This property returns the refnum to the signal parent frame. NI-XNET Hardware and Software Manual 4-278 ni.Chapter 4 NI-XNET API for LabVIEW — XNET Signal Property Node Frame Data Type Direction Read Only Required? Default N/A Parent Frame Property Class XNET Signal Short Name Frame Description Reference to the signal parent frame. Maximum Value Data Type Direction Read/Write Required? Default No 1000. you can use this property to set the limits of front panel controls and indicators. XNET Read.

© National Instruments Corporation 4-279 NI-XNET Hardware and Software Manual .vi and XNET Write. you can use this property to set the limits of front panel controls and indicators. the multiplexer signal.Chapter 4 NI-XNET API for LabVIEW — XNET Signal Property Node Minimum Value Data Type Direction Read/Write Required? Default No 0. The multiplexer value is determined in the subframe. All dynamic signals that are children of the same subframe object use the same multiplexer value.vi do not limit the signal value to a minimum value. Dynamic signals with the same multiplexer value may not overlap each other.MuxValue Description The multiplexer value applies to dynamic signals only (the XNET Signal Mux:Dynamic? property returns true). Mux:Multiplexer Value Data Type Direction Read Only Required? Default N/A N/A Property Class XNET Signal Short Name Mux.0 Property Class XNET Signal Short Name Min Description The scaled signal value minimum. In LabVIEW. This property defines which multiplexer value is transmitted in the multiplexer signal when this dynamic signal is transmitted in the frame. or static signals. XNET Read. Use this database property to set the minimum value.

Scaling factor and offset do not apply. the multiplexer signal was called mode channel. NI-XNET Hardware and Software Manual 4-280 ni.Muxer? Description This property defines the signal that is a multiplexer signal. Multiplexer signals may not overlap other static or dynamic signals in the frame.Chapter 4 NI-XNET API for LabVIEW — XNET Signal Property Node Mux:Data Multiplexer? Data Type Direction Read/Write Required? Default No False Property Class XNET Signal Short Name Mux. The multiplexer signal is not scaled. A frame containing a multiplexer value is called a multiplexed frame. A multiplexer defines an area within the frame to contain different information (dynamic signals) depending on the multiplexer signal value. The multiplexer signal value determines which dynamic signals are transmitted in the given frame. A frame may contain only one multiplexer signal. In NI-CAN. Dynamic signals may overlap other dynamic signals when they have a different multiplexer value. Then you must create dynamic signals using XNET Database Create (Dynamic Signal). To define dynamic signals in the frame transmitted with a given multiplexer value. you first must create a subframe in this frame and set the multiplexer value in the subframe. Dynamic signals with a different multiplexer value (defined in a different subframe) can share bits in the frame payload.com .vi to create child signals of this subframe.

Wire the result from Search and Replace String Function. such as the database. The fully qualified name is available by using the XNET Signal I/O name as a string. 2. This replaces the short name in the XNET Signal. uppercase letters. Follow these steps to avoid this problem: 1.vi to XNET String to IO Name.vi with the old Name as the search string and the new Name as the replacement string. Get the old Name (Short) property using the property node. The short name is limited to 128 characters. When you do this and then use the original XNET Signal that contains the old name. Valid characters for the short name are lowercase letters. Close the object using XNET Database Close. Wire the XNET Signal as the input string to Search and Replace String Function. Set the new Name (Short) property for the object.Chapter 4 NI-XNET API for LabVIEW — XNET Signal Property Node Name (Short) Data Type Direction Read/Write Required? Default Yes Defined in Create Object Property Class XNET Signal Short Name NameShort Description String identifying a signal object. Space ( ). The short name must begin with a letter (uppercase or lowercase) or underscore. errors can result because the old name cannot be found. numbers. You can write this property to change the signal’s short name.). This short name does not include qualifiers to ensure that it is unique.vi. 3. cluster. and frame name. 5. It is for display purposes.vi. and underscore (_). and not a number. while retaining the other text that ensures a unique name. dot (. A signal name must be unique for all signals in a frame. and other special characters are not supported within the name. This casts the string back to a valid XNET Signal. © National Instruments Corporation 4-281 NI-XNET Hardware and Software Manual . Wire the close all? input as false to close the renamed object only. 4.

you can wire the new name to the next VI or property node (no need for explicit open).Chapter 4 NI-XNET API for LabVIEW — XNET Signal Property Node 6. If you are using LabVIEW 2009 or later.5 or 8. The following diagram demonstrates steps 1 through 5 for an XNET Frame I/O name: NI-XNET Hardware and Software Manual 4-282 ni.6.vi to reopen the object with the new name. call XNET Database Open. If you are using LabVIEW 8.com .

and you create an XNET session that uses this signal. Integer (signed and unsigned) numbers are limited to 1–52 bits. NI-XNET does not support this. © National Instruments Corporation 4-283 NI-XNET Hardware and Software Manual . Set a value in LabVIEW using the property node. This is needed when you create your own in-memory database (:memory:) rather than use a file. NI-XNET converts all integers to doubles (64-bit IEEE Float). the session returns an error. To ensure that the property contains a valid value. therefore. you can do one of the following: • • Use a database file (or alias) to create the session. The file formats require a valid value in the text for this property. If the property does not contain a valid value. so you must set a valid value prior to creating a session. This property is required. For more information about using database files and in-memory databases. The property does not contain a default in this case. refer to Databases. Integer numbers with more than 52 bits (the size of the mantissa in a 64-bit IEEE Float) cannot be converted exactly to double.Chapter 4 NI-XNET API for LabVIEW — XNET Signal Property Node Number of Bits Data Type Direction Read/Write Required? Default Yes N/A Property Class XNET Signal Short Name NumBits Description The number of bits the signal uses in the frame payload. IEEE Float numbers are limited to 32 bit or 64 bit. and vice versa.

Chapter 4 NI-XNET API for LabVIEW — XNET Signal Property Node Scaling Factor Data Type Direction Read/Write Required? Default No 1. unsigned and signed.0 Property Class XNET Signal Short Name ScaleFac Description Factor a for linear scaling ax+b.0x+0.com .0. Linear scaling is applied to all signals with the IEEE Float data type. NI-XNET optimized scaling routines do not perform the multiplication and addition. NI-XNET Hardware and Software Manual 4-284 ni.0x+0. For identical scaling 1. unsigned and signed.0. Linear scaling is applied to all signals with the IEEE Float data type. Scaling Offset Data Type Direction Read/Write Required? Default No 0. NI-XNET optimized scaling routines do not perform the multiplication and addition. For identical scaling 1.0 Property Class XNET Signal Short Name ScaleOff Description Offset b for linear scaling ax+b.

it means the binary signal representation least significant bit position. The maximum bit number in a CAN frame is 63 (7 × 8 + 7). it means the mantissa least significant bit.Chapter 4 NI-XNET API for LabVIEW — XNET Signal Property Node Start Bit Data Type Direction Read/Write Required? Default Yes N/A Property Class XNET Signal Short Name StartBit Description The least significant signal bit position in the frame payload. It numerates the frame bytes on the left and the byte bits on top. the maximum bit number in a FlexRay frame is 2031 (253 × 8 + 7). The bit number in the frame is calculated as byte number × 8 + bit number. For the integer data type (signed and unsigned). This property determines the signal starting point in the frame. The NI-XNET Database Editor shows a graphical overview of the frame. Figure 4-9. Frame Overview in the NI-XNET Database Editor with a Signal Starting in Bit 12 © National Instruments Corporation 4-285 NI-XNET Hardware and Software Manual . For IEEE Float signals.

The property does not contain a default in this case. This is needed when you create your own in-memory database (:memory:) rather than use a file. so you must set a valid value prior to creating a session. and you create an XNET session that uses this signal.Chapter 4 NI-XNET API for LabVIEW — XNET Signal Property Node This property is required. For more information about using database files and in-memory databases.com . To ensure that the property contains a valid value. you can do one of the following: • • Use a database file (or alias) to create the session. refer to Databases. the session returns an error. The file formats require a valid value in the text for this property. If the property does not contain a valid value. Set a value in LabVIEW using the property node. NI-XNET Hardware and Software Manual 4-286 ni.

NI-XNET does not use the unit internally for calculations. © National Instruments Corporation 4-287 NI-XNET Hardware and Software Manual . For static signals or the multiplexer signal.Chapter 4 NI-XNET API for LabVIEW — XNET Signal Property Node Mux:Subframe Data Type Direction Read Only Required? Default N/A Parent Subframe Property Class XNET Signal Short Name Mux. this I/O name is empty. Unit Data Type Direction Read/Write Required? Default No Empty String Property Class XNET Signal Short Name Unit Description This property describes the signal value unit. You can use the string to display the signal value along with the unit on the front panel. This property is valid only for dynamic signals that have a subframe parent.Subfrm Description Reference to the subframe parent.

com . You can change constants only during configuration. For a complete description.vi XNET Database Open (Frame).vi XNET Database Open (ECU). refer to XNET Signal I/O Name.vi Purpose Opens an object from a database file.Chapter 4 NI-XNET API for LabVIEW — XNET Signal Constant XNET Signal Constant This constant provides the constant form of the XNET Signal I/O name. then select a signal.vi XNET Database Open (Signal).vi XNET Database Open (Database). Description The instances of this polymorphic VI specify which objects to open: • • • • • • XNET Database Open (Cluster). XNET Database Open. prior to running the VI. You drag a constant to the block diagram of your VI.vi XNET Database Open (Subframe).vi NI-XNET Hardware and Software Manual 4-288 ni.

vi to wire the cluster to XNET Create Session. You can use this output to wire the VI to subsequent VIs. It is an instance of the XNET Database Open poly VI.vi Purpose Opens a cluster from a database file. refer to XNET Cluster I/O Name. error out is the error cluster output (refer to Error Handling). Description This VI opens a cluster object from a database. LabVIEW 2009 or Later This VI is not required for these versions of LabVIEW.vi. In addition to opening the refnum automatically. You are not required to call XNET Database Open (Cluster).6 You must call this VI before using the cluster as a refnum (property node and VIs in the Database palette). Format Inputs cluster in is the cluster to open. For more information. © National Instruments Corporation 4-289 NI-XNET Hardware and Software Manual . Outputs cluster out is a copy of the cluster in parameter.Chapter 4 NI-XNET API for LabVIEW — XNET Database Open. because that VI uses the I/O name as a string only. LabVIEW also closes it automatically. error in is the error cluster input (refer to Error Handling). It is provided only for backward compatibility of VIs written in LabVIEW 8.5 or 8. Newer versions of LabVIEW can detect the I/O name’s first use as a refnum and open it automatically.5 and 8.6. LabVIEW 8.vi XNET Database Open (Cluster).

vi for more information.Chapter 4 NI-XNET API for LabVIEW — XNET Database Open. When you finish using the database.vi To use this VI. NI-XNET Hardware and Software Manual 4-290 ni.com . you must close its refnums. then change the poly instance to match the class that you wire in. Refer to XNET Database Close. drop it to the diagram.

It is provided only for backward compatibility of VIs written in LabVIEW 8.6 You must call this VI before using the database as a refnum (property node and VIs in the Database palette).Chapter 4 NI-XNET API for LabVIEW — XNET Database Open. © National Instruments Corporation 4-291 NI-XNET Hardware and Software Manual . Outputs database out is a copy of the database in parameter.vi XNET Database Open (Database).5 or 8. error out is the error cluster output (refer to Error Handling). LabVIEW 8. Newer versions of LabVIEW can detect the I/O name’s first use as a refnum and open it automatically. error in is the error cluster input (refer to Error Handling).6. LabVIEW also closes it automatically. In addition to opening the refnum automatically. For more information. The default is the in-memory database (:memory:). Format Inputs database in is the database to open. LabVIEW 2009 or Later This VI is not required for these versions of LabVIEW. refer to XNET Database I/O Name. Description This VI opens an XNET database object.5 and 8. You can use this parameter to wire the VI to subsequent VIs. without writing them to a file. It is an instance of the XNET Database Open poly VI.vi Purpose Opens an XNET database. which you can use to create database objects programmatically.

vi To use this VI.Chapter 4 NI-XNET API for LabVIEW — XNET Database Open. then change the poly instance to match the class that you wire in. you must close its refnums. When you finish using the database. drop it to the diagram.vi for more information.com . Refer to XNET Database Close. NI-XNET Hardware and Software Manual 4-292 ni.

It is an instance of the XNET Database Open poly VI. Refer to XNET Database Close.5 and 8.vi for more information. Newer versions of LabVIEW can detect the I/O name’s first use as a refnum and open it automatically. In addition to opening the refnum automatically. To use this VI. © National Instruments Corporation 4-293 NI-XNET Hardware and Software Manual . drop it to the diagram.6.6 You must call this VI before using the ECU as a refnum (property node and VIs in the Database palette). then change the poly instance to match the class that you wire in.5 or 8. error out is the error cluster output (refer to Error Handling).vi XNET Database Open (ECU). You can use this parameter to wire the VI to subsequent VIs. When you finish using the database. Description This VI opens an ECU object from a database. refer to XNET ECU I/O Name. It is provided only for backward compatibility of VIs written in LabVIEW 8.vi Purpose Opens an ECU from a database file. Outputs ECU out is a copy of the ECU in parameter. you must close its refnums. LabVIEW also closes it automatically. For more information.Chapter 4 NI-XNET API for LabVIEW — XNET Database Open. Format Inputs ECU in is the ECU to open. LabVIEW 8. error in is the error cluster input (refer to Error Handling). LabVIEW 2009 or Later This VI is not required for these versions of LabVIEW.

Chapter 4

NI-XNET API for LabVIEW — XNET Database Open.vi

XNET Database Open (Frame).vi
Purpose
Opens a frame from a database file.

Format

Inputs
frame in is the frame to open. error in is the error cluster input (refer to Error Handling).

Outputs
frame out is a copy of the frame in parameter. You can use this parameter to wire the VI to subsequent VIs. error out is the error cluster output (refer to Error Handling).

Description
This VI opens a frame object from a database. It is an instance of the XNET Database Open poly VI.

LabVIEW 2009 or Later
This VI is not required for these versions of LabVIEW. It is provided only for backward compatibility of VIs written in LabVIEW 8.5 or 8.6. Newer versions of LabVIEW can detect the I/O name’s first use as a refnum and open it automatically. In addition to opening the refnum automatically, LabVIEW also closes it automatically.

LabVIEW 8.5 and 8.6
You must call this VI before using the frame as a refnum (property node and VIs in the Database palette). You are not required to call XNET Database Open (Frame).vi to wire the frame to XNET Create Session.vi, because that VI uses the I/O name as a string only. For more information, refer to XNET Frame I/O Name.

NI-XNET Hardware and Software Manual

4-294

ni.com

Chapter 4

NI-XNET API for LabVIEW — XNET Database Open.vi

To use this VI, drop it to the diagram, then change the poly instance to match the class that you wire in. When you finish using the database, you must close its refnums. Refer to XNET Database Close.vi for more information.

© National Instruments Corporation

4-295

NI-XNET Hardware and Software Manual

Chapter 4

NI-XNET API for LabVIEW — XNET Database Open.vi

XNET Database Open (Signal).vi
Purpose
Opens a signal from a database file.

Format

Inputs
signal in is the signal to open. error in is the error cluster input (refer to Error Handling).

Outputs
signal out is a copy of the signal in parameter. You can use this parameter to wire the VI to subsequent VIs. error out is the error cluster output (refer to Error Handling).

Description
This VI opens a signal object from a database. It is an instance of the XNET Database Open poly VI.

LabVIEW 2009 or Later
This VI is not required for these versions of LabVIEW. It is provided only for backward compatibility of VIs written in LabVIEW 8.5 or 8.6. Newer versions of LabVIEW can detect the I/O name’s first use as a refnum and open it automatically. In addition to opening the refnum automatically, LabVIEW also closes it automatically.

LabVIEW 8.5 and 8.6
You must call this VI before using the signal as a refnum (property node and VIs in the Database palette). You are not required to call XNET Database Open (Signal).vi to wire the signal to XNET Create Session.vi, because that VI uses the I/O name as a string only. For more information, refer to XNET Signal I/O Name.

NI-XNET Hardware and Software Manual

4-296

ni.com

Chapter 4

NI-XNET API for LabVIEW — XNET Database Open.vi

To use this VI, drop it to the diagram, then change the poly instance to match the class that you wire in. When you finish using the database, you must close its refnums. Refer to XNET Database Close.vi for more information.

© National Instruments Corporation

4-297

NI-XNET Hardware and Software Manual

Chapter 4

NI-XNET API for LabVIEW — XNET Database Open.vi

XNET Database Open (Subframe).vi
Purpose
Opens a subframe from a database file.

Format

Inputs
subframe in is the subframe to open. error in is the error cluster input (refer to Error Handling).

Outputs
subframe out is a copy of the subframe in parameter. You can use this parameter to wire the VI to subsequent VIs. error out is the error cluster output (refer to Error Handling).

Description
This VI opens a subframe object from a database. It is an instance of the XNET Database Open poly VI.

LabVIEW 2009 or Later
This VI is not required for these versions of LabVIEW. It is provided only for backward compatibility of VIs written in LabVIEW 8.5 or 8.6. Newer versions of LabVIEW can detect the I/O name’s first use as a refnum and open it automatically. In addition to opening the refnum automatically, LabVIEW also closes it automatically.

LabVIEW 8.5 and 8.6
You must call this VI before using the subframe as a refnum (property node and VIs in the Database palette). You are not required to XNET Database Open (Subframe).vi to wire the subframe to XNET Create Session.vi, because that VI uses the I/O name as a string only. For more information, refer to XNET Subframe I/O Name.

NI-XNET Hardware and Software Manual

4-298

ni.com

Chapter 4

NI-XNET API for LabVIEW — XNET Database Open.vi

To use this VI, drop it to the diagram, then change the poly instance to match the class that you wire in. When you finish using the database, you must close its refnums. Refer to XNET Database Close.vi for more information.

© National Instruments Corporation

4-299

NI-XNET Hardware and Software Manual

Chapter 4

NI-XNET API for LabVIEW — XNET Database Close.vi

XNET Database Close.vi
Purpose
Closes an object from a database, or all database objects.

Description
The instances of this polymorphic VI specify which objects to close: • • • • • • XNET Database Close (Cluster).vi XNET Database Close (Database).vi XNET Database Close (ECU).vi XNET Database Close (Frame).vi XNET Database Close (Signal).vi XNET Database Close (Subframe).vi

NI-XNET Hardware and Software Manual

4-300

ni.com

Chapter 4

NI-XNET API for LabVIEW — XNET Database Close.vi

XNET Database Close (Cluster).vi
Purpose
Closes a cluster from a database, or all database objects.

Format

Inputs
cluster in is the cluster to close. close all? indicates that all open database objects will be closed. This is the default. error in is the error cluster input (refer to Error Handling).

Outputs
error out is the error cluster output (refer to Error Handling).

Description
This VI closes a cluster object from a database (or all database objects). It is an instance of the XNET Database Close poly VI. To simplify the task of closing all database objects you opened, use the close all? parameter set to true (default); otherwise, only the single database object wired in is closed.

LabVIEW 2009 or Later
Database objects are closed automatically when the top-level VI terminates, so using this VI is optional. However, you may want to close database objects to free their memory prior to starting a session. You can use this VI to do this.

LabVIEW 8.5 and 8.6
You must call this VI before the top-level VI terminates. Either call it for each database object opened, or for only one open object with the close all? parameter set to true (default).

© National Instruments Corporation

4-301

NI-XNET Hardware and Software Manual

Chapter 4

NI-XNET API for LabVIEW — XNET Database Close.vi

XNET Database Close (Database).vi
Purpose
Closes an XNET database, or all database objects.

Format

Inputs
database in is the database to close. close all? indicates that all open database objects will be closed. This is the default. error in is the error cluster input (refer to Error Handling).

Outputs
error out is the error cluster output (refer to Error Handling).

Description
This VI closes an XNET database (or all database objects). It is an instance of the XNET Database Close poly VI. To simplify the task of closing all database objects you opened, you can use the close all? parameter set to true (default); otherwise, only the single database object wired in is closed.
Note

Even if the database has been closed (using close all? set to false), all database objects retrieved from this database must be closed separately.

LabVIEW 2009 or Later
Database objects are closed automatically when the top-level VI terminates, so using this VI is optional. However, you may want to close database objects to free their memory prior to starting a session. You can use this VI to do this.

LabVIEW 8.5 and 8.6
You must call this VI before the top-level VI terminates. Either call it for each database object opened, or for only one open object with the close all? parameter set to true (default).

NI-XNET Hardware and Software Manual

4-302

ni.com

Chapter 4

NI-XNET API for LabVIEW — XNET Database Close.vi

XNET Database Close (ECU).vi
Purpose
Closes an ECU from a database, or all database objects.

Format

Inputs
ECU in is the ECU to close. close all? indicates that all open database objects will be closed. This is the default. error in is the error cluster input (refer to Error Handling).

Outputs
error out is the error cluster output (refer to Error Handling).

Description
This VI closes an ECU object from a database (or all database objects). It is an instance of the XNET Database Close poly VI. To simplify the task of closing all database objects you opened, you can use the close all? parameter set to true (default); otherwise, only the single database object wired in is closed.

LabVIEW 2009 or Later
Database objects are closed automatically when the top-level VI terminates, so using this VI is optional. However, you may want to close database objects to free their memory prior to starting a session. You can use this VI to do this.

LabVIEW 8.5 and 8.6
You must call this VI before the top-level VI terminates. Either call it for each database object opened, or for only one open object with the close all? parameter set to true (default).

© National Instruments Corporation

4-303

NI-XNET Hardware and Software Manual

Chapter 4

NI-XNET API for LabVIEW — XNET Database Close.vi

XNET Database Close (Frame).vi
Purpose
Closes a frame from a database, or all database objects.

Format

Inputs
frame in is the frame to close. close all? indicates that all open database objects will be closed. This is the default. error in is the error cluster input (refer to Error Handling).

Outputs
error out is the error cluster output (refer to Error Handling).

Description
This VI closes a frame object from a database (or all database objects). It is an instance of the XNET Database Close poly VI. To simplify the task of closing all database objects you opened, you can use the close all? parameter set to true (default); otherwise, only the single database object wired in is closed.

LabVIEW 2009 or Later
Database objects are closed automatically when the top-level VI terminates, so using this VI is optional. However, you may want to close database objects to free their memory prior to starting a session. You can use this VI to do this.

LabVIEW 8.5 and 8.6
You must call this VI before the top-level VI terminates. Either call it for each database object opened, or for only one open object with the close all? parameter set to true (default).

NI-XNET Hardware and Software Manual

4-304

ni.com

Chapter 4

NI-XNET API for LabVIEW — XNET Database Close.vi

XNET Database Close (Signal).vi
Purpose
Closes a signal from a database, or all database objects.

Format

Inputs
signal in is the signal to close. close all? indicates that all open database objects will be closed. This is the default. error in is the error cluster input (refer to Error Handling).

Outputs
error out is the error cluster output (refer to Error Handling).

Description
This VI closes a signal object from a database (or all database objects). It is an instance of the XNET Database Close poly VI. To simplify the task of closing all database objects you opened, you can use the close all? parameter set to true (default); otherwise, only the single database object wired in is closed.

LabVIEW 2009 or Later
Database objects are closed automatically when the top-level VI terminates, so using this VI is optional. However, you may want to close database objects to free their memory prior to starting a session. You can use this VI to do this.

LabVIEW 8.5 and 8.6
You must call this VI before the top-level VI terminates. Either call it for each database object opened, or for only one open object with the close all? parameter set to true (default).

© National Instruments Corporation

4-305

NI-XNET Hardware and Software Manual

Chapter 4

NI-XNET API for LabVIEW — XNET Database Close.vi

XNET Database Close (Subframe).vi
Purpose
Closes a subframe from a database, or all database objects.

Format

Inputs
subframe in is the subframe to close. close all? indicates that all open database objects will be closed. This is the default. error in is the error cluster input (refer to Error Handling).

Outputs
error out is the error cluster output (refer to Error Handling).

Description
This VI closes a subframe object from a database (or all database objects). It is an instance of the XNET Database Close poly VI. To simplify the task of closing all database objects you opened, you can use the close all? parameter set to true (default); otherwise, only the single database object wired in is closed.

LabVIEW 2009 or Later
Database objects are closed automatically when the top-level VI terminates, so using this VI is optional. However, you may want to close database objects to free their memory prior to starting a session. You can use this VI to do this.

LabVIEW 8.5 and 8.6
You must call this VI before the top-level VI terminates. Either call it for each database object opened, or for only one open object with the close all? parameter set to true (default).

NI-XNET Hardware and Software Manual

4-306

ni.com

Chapter 4

NI-XNET API for LabVIEW — XNET Database Create Object.vi

XNET Database Create Object.vi
Purpose
Creates a new database object.

Description
The instances of this polymorphic VI specify which database objects to create: • • • • • • XNET Database Create (Cluster).vi XNET Database Create (Dynamic Signal).vi XNET Database Create (ECU).vi XNET Database Create (Frame).vi XNET Database Create (Signal).vi XNET Database Create (Subframe).vi

© National Instruments Corporation

4-307

NI-XNET Hardware and Software Manual

Chapter 4

NI-XNET API for LabVIEW — XNET Database Create Object.vi

XNET Database Create (Cluster).vi
Purpose
Creates a new XNET cluster.

Format

Inputs
database in is the parent database object. database in can be an existing file. In LabvIEW 8.5 and 8.6, you first must open the file using XNET Database Open.vi. You can create a new database in memory by specifying :memory: for database in and create an entire hierarchy of objects in memory, without using a file on the disk. cluster name is the name of the cluster to create. The name must be unique for all clusters in a database. Valid characters for the name are lowercase letters, uppercase letters, numbers, and underscore (_). Space ( ), dot (.), and other special characters are not supported within the name. The name must begin with a letter (uppercase or lowercase) or underscore, and not a number. The name is limited to 128 characters. error in is the error cluster input (refer to Error Handling).

Outputs
database out is a copy of the database in parameter. You can use this output to wire the VI to subsequent VIs. cluster out is the reference to the newly created cluster object. error out is the error cluster output (refer to Error Handling).

Description
This VI creates an XNET cluster object. It is an instance of XNET Database Create Object.vi. For LabVIEW 8.5 and 8.6, you must close the cluster when it is no longer in use. Refer to XNET Database Close.vi for more information.

NI-XNET Hardware and Software Manual

4-308

ni.com

Chapter 4

NI-XNET API for LabVIEW — XNET Database Create Object.vi

The cluster name input becomes the Name (Short) property of the created object. This is distinct from the string contained within cluster out, which uses the syntax described in XNET Cluster I/O Name. The cluster object is created and remains in memory until the database is closed. This VI does not change the open database file on disk. To save the newly created object to the file, use XNET Database Save.vi.

© National Instruments Corporation

4-309

NI-XNET Hardware and Software Manual

vi Purpose Creates a new XNET dynamic signal. The name must begin with a letter (uppercase or lowercase) or underscore. and other special characters are not supported within the name. NI-XNET Hardware and Software Manual 4-310 ni. including the static signals and the multiplexer signal. You can use this parameter to wire the VI to subsequent VIs. For LabVIEW 8. The name must be unique for all signals in a frame in which the subframe parent was defined.vi for more information.6.com . uppercase letters. error in is the error cluster input (refer to Error Handling). Description This VI creates an XNET dynamic signal object. Refer to XNET Database Close. signal out is the reference to the newly created signal object. The name is limited to 128 characters. Valid characters for the name are lowercase letters. It is an instance of XNET Database Create Object. Outputs subframe out is a copy of the subframe in parameter. signal name is the name of the signal to create.vi XNET Database Create (Dynamic Signal). and not a number.vi. and underscore (_). Format Inputs subframe in is the subframe parent object.5 and 8. error out is the error cluster output (refer to Error Handling). dot (. Space ( ). numbers. you must close the signal when it is no longer in use.Chapter 4 NI-XNET API for LabVIEW — XNET Database Create Object.).

To save the newly created object to the file. This is distinct from the string contained within signal out.vi The signal name input becomes the Name (Short) property of the created object.vi. dynamic signals were called mode-dependent channels. which uses the syntax described in XNET Signal I/O Name. use XNET Database Save. In NI-CAN.Chapter 4 NI-XNET API for LabVIEW — XNET Database Create Object. © National Instruments Corporation 4-311 NI-XNET Hardware and Software Manual . Dynamic Signal is transmitted in the frame when the multiplexer signal contains the multiplexer value defined in the subframe. This VI does not change the open database file on disk. The signal object is created and remains in memory until the database is closed.

You can use this output to wire the VI to subsequent VIs. error out is the error cluster output (refer to Error Handling). numbers.5 and 8. Space ( ).6. NI-XNET Hardware and Software Manual 4-312 ni. you must close the ECU when it is no longer in use.vi VI for more information.com . Outputs cluster out is a copy of the cluster in parameter. Description This VI creates an XNET ECU object.). It is an instance of XNET Database Create Object. Format Inputs cluster in is the cluster parent object.vi Purpose Creates a new XNET ECU. dot (. For LabVIEW 8. The name must be unique for all ECUs in a cluster. and not a number. Valid characters for the name are lowercase letters. The name is limited to 128 characters.Chapter 4 NI-XNET API for LabVIEW — XNET Database Create Object. Refer to XNET Database Close. and other special characters are not supported within the name. uppercase letters. ECU out is the reference to the newly created ECU object. The name must begin with a letter (uppercase or lowercase) or underscore. ECU name is the name of the ECU to create.vi. and underscore (_). error in is the error cluster input (refer to Error Handling).vi XNET Database Create (ECU).

© National Instruments Corporation 4-313 NI-XNET Hardware and Software Manual .vi The ECU name input becomes the Name (Short) property of the created object.Chapter 4 NI-XNET API for LabVIEW — XNET Database Create Object.vi. The ECU object is created and remains in memory until the database is closed. To save the newly created object to the file. This is distinct from the string contained within ECU out. use XNET Database Save. This VI does not change the open database file on disk. which uses the syntax described in XNET ECU I/O Name.

Outputs cluster out is a copy of the cluster in parameter. numbers. you must close the cluster when it is no longer in use. NI-XNET Hardware and Software Manual 4-314 ni. error out is the error cluster output (refer to Error Handling). Valid characters for the name are lowercase letters. It is an instance of XNET Database Create Object. uppercase letters.5 and 8.6. Format Inputs cluster in is the cluster parent object. and underscore (_).vi for more information. You can use this output to wire the VI to subsequent VIs. frame name is the name of the frame to create.). Description This VI creates an XNET frame object.com . For LabVIEW 8. and other special characters are not supported within the name. The name is limited to 128 characters. and not a number. The name must begin with a letter (uppercase or lowercase) or underscore. dot (. The name must be unique for all frames in a cluster.vi Purpose Creates a new XNET frame.Chapter 4 NI-XNET API for LabVIEW — XNET Database Create Object. frame out is the reference to the newly created frame object. Space ( ).vi.vi XNET Database Create (Frame). Refer to XNET Database Close. error in is the error cluster input (refer to Error Handling).

This is distinct from the string contained within frame out. This VI does not change the open database file on disk. use XNET Database Save. © National Instruments Corporation 4-315 NI-XNET Hardware and Software Manual .vi.vi The frame name input becomes the Name (Short) property of the created object. The frame object is created and remains in memory until the database is closed. which uses the syntax described in XNET Frame I/O Name. To save the newly created object to the file.Chapter 4 NI-XNET API for LabVIEW — XNET Database Create Object.

5 and 8. error out is the error cluster output (refer to Error Handling). signal out is the reference to the newly created signal object. Outputs frame out is a copy of the frame in parameter.vi XNET Database Create (Signal). It is an instance ofXNET Database Create Object. Valid characters for the name are lowercase letters.vi for more information. You can use this parameter to wire the VI to subsequent VIs. NI-XNET Hardware and Software Manual 4-316 ni.6. numbers.Chapter 4 NI-XNET API for LabVIEW — XNET Database Create Object. uppercase letters. The name must be unique for all signals in a frame.). The name must begin with a letter (uppercase or lowercase) or underscore. Format Inputs frame in is the frame parent object. The name is limited to 128 characters. and not a number. error in is the error cluster input (refer to Error Handling).vi Purpose Creates a new XNET signal. signal name is the name of the signal to create. For LabVIEW 8. Space ( ). you must close the cluster when it is no longer in use. Description This VI creates an XNET signal object.com . Refer to XNET Database Close. dot (. and underscore (_). and other special characters are not supported within the name.vi.

vi. This is distinct from the string contained within signal out. This VI does not change the open database file on disk. © National Instruments Corporation 4-317 NI-XNET Hardware and Software Manual . which uses the syntax described in XNET Session I/O Name. To save the newly created object to the file. The signal object is created and remains in memory until the database is closed.Chapter 4 NI-XNET API for LabVIEW — XNET Database Create Object.vi The signal name input becomes the Name (Short) property of the created object. use XNET Database Save.

The subframe name input becomes the Name (Short) property of the created object.6.vi. You can use this parameter to wire the VI to subsequent VIs.). Description This VI creates an XNET subframe object.5 and 8. subframe name is the name of the subframe to create. Space ( ). The name is limited to 128 characters. The name must begin with a letter (uppercase or lowercase) or underscore. For LabVIEW 8. and other special characters are not supported within the name. dot (. It is an instance of XNET Database Create Object. numbers. error out is the error cluster output (refer to Error Handling). Outputs frame out is a copy of the frame in parameter. NI-XNET Hardware and Software Manual 4-318 ni. uppercase letters. Valid characters for the name are lowercase letters. and underscore (_). Refer to XNET Database Close.Chapter 4 NI-XNET API for LabVIEW — XNET Database Create Object. subframe out is the reference to the newly created subframe object.vi Purpose Creates a new XNET subframe. you must close the cluster when it is no longer in use.vi XNET Database Create (Subframe). and not a number. The name must be unique for all subframes in a frame. Format Inputs frame in is the frame parent object.com . error in is the error cluster input (refer to Error Handling).vi for more information.

Chapter 4 NI-XNET API for LabVIEW — XNET Database Create Object. use XNET Database Save. In NI-CAN. © National Instruments Corporation 4-319 NI-XNET Hardware and Software Manual .vi. A subframe defines the multiplexer value for all dynamic signals in this subframe.vi The subframe object is created and remains in memory until the database is closed. a subframe was called a mode. Dynamic signals within a subframe inherit the multiplexer value from the subframe parent. To save the newly created object to the file. This VI does not change the open database file on disk.

vi XNET Database Delete Object.vi NI-XNET Hardware and Software Manual 4-320 ni.com .vi XNET Database Delete (ECU).Chapter 4 NI-XNET API for LabVIEW — XNET Database Delete Object. Description The instances of this polymorphic VI specify which database objects to delete: • • • • • XNET Database Delete (Cluster).vi XNET Database Delete (Frame).vi XNET Database Delete (Signal).vi XNET Database Delete (Subframe).vi Purpose Deletes a database object.

To save the changed database to the file. © National Instruments Corporation 4-321 NI-XNET Hardware and Software Manual .vi Purpose Deletes an XNET cluster and all child objects in this cluster. use XNET Database Save.vi XNET Database Delete (Cluster). The change is in force until the database is closed. Upon deletion.vi. This VI does not change the open database file on disk. the refnums to all deleted objects are closed and no longer can be used. and ECUs in this cluster. subframes. It is an instance of XNET Database Delete Object. Description This VI deletes an XNET cluster object with all frames. signals.Chapter 4 NI-XNET API for LabVIEW — XNET Database Delete Object. error in is the error cluster input (refer to Error Handling). Outputs error out is the error cluster output (refer to Error Handling). Format Inputs cluster in references the cluster to delete. The objects are deleted from a database in memory.vi.

error in is the error cluster input (refer to Error Handling). Format Inputs ECU in references the ECU to delete. The ECU object is deleted from a database in memory and is in force until the database is closed.com .vi Purpose Deletes an XNET ECU. the refnum to the ECU is closed and no longer can be used. use XNET Database Save. Description This VI deletes an XNET ECU object. NI-XNET Hardware and Software Manual 4-322 ni. Upon deletion. This VI does not change the open database file on disk.Chapter 4 NI-XNET API for LabVIEW — XNET Database Delete Object.vi. Outputs error out is the error cluster output (refer to Error Handling). To save the changed database to the file.vi XNET Database Delete (ECU). It is an instance of XNET Database Delete Object.vi.

Outputs error out is the error cluster output (refer to Error Handling). error in is the error cluster input (refer to Error Handling). Upon deletion. Description This VI deletes an XNET frame object with all signals and subframes in this frame. The objects are deleted from a database in memory. the refnums to all deleted objects are closed and no longer can be used.vi. It is an instance of XNET Database Delete Object. Format Inputs frame in references the frame to delete. This VI does not change the open database file on disk.vi XNET Database Delete (Frame).vi.vi Purpose Deletes an XNET frame and all child objects in the frame. use XNET Database Save. © National Instruments Corporation 4-323 NI-XNET Hardware and Software Manual .Chapter 4 NI-XNET API for LabVIEW — XNET Database Delete Object. The change is in force until the database is closed. To save the changed database to the file.

Format Inputs signal in references the signal to delete. error in is the error cluster input (refer to Error Handling). Description This VI deletes an XNET signal object.Chapter 4 NI-XNET API for LabVIEW — XNET Database Delete Object.com . the refnum to the signal is closed and no longer can be used. NI-XNET Hardware and Software Manual 4-324 ni. The signal object is deleted from a database in memory and is in force until the database is closed. This VI does not change the open database file on disk. Outputs error out is the error cluster output (refer to Error Handling). use XNET Database Save.vi.vi Purpose Deletes an XNET signal.vi XNET Database Delete (Signal). To save the changed database to the file.vi. It is an instance of XNET Database Delete Object. Upon deletion.

This VI does not change the open database file on disk.vi. It is an instance of XNET Database Delete Object. use XNET Database Save. Format Inputs subframe in references the subframe to delete. Upon deletion. © National Instruments Corporation 4-325 NI-XNET Hardware and Software Manual .vi XNET Database Delete (Subframe). error in is the error cluster input (refer to Error Handling). The change is in force until the database is closed. Description This VI deletes an XNET subframe object and all dynamic signals in this subframe.vi. the refnums to the subframe and related dynamic signals are closed and no longer can be used.Chapter 4 NI-XNET API for LabVIEW — XNET Database Delete Object. The objects are deleted from a database in memory. To save the changed database to the file. Outputs error out is the error cluster output (refer to Error Handling).vi Purpose Deletes an XNET subframe and all dynamic signals in the subframe.

Saving a database is not supported in LabVIEW Real-Time.0. it uses the file path registered for that alias. NI-XNET supports only linear scaling. Outputs database out is a copy of the database in parameter. You can use this parameter to wire the VI to subsequent VIs.vi). error in is the error cluster input (refer to Error Handling).com . it uses that file path. but you can deploy and use a database saved on Windows in LabVIEW Real-Time (refer to XNET Database Deploy. For example. Description This VI saves the XNET database current state to a FIBEX 2. If filepath is empty. If the original file was created using non-XNET software.0. If opened as an alias.xml. XNET saves to the FIBEX file only features that XNET sessions use to communicate on the network.1 file.Chapter 4 NI-XNET API for LabVIEW — XNET Database Save.0. the file is saved to the same FIBEX file specified when opened. filepath contains the pathname to the FIBEX file or is empty (saves to the original filepath). If opened as a file path. If the original FIBEX file used a rational equation that cannot be expressed as a linear scaling. NI-XNET Hardware and Software Manual 4-326 ni. Format Inputs database in references the database.vi XNET Database Save. The file extension must be .0 and offset 0. error out is the error cluster output (refer to Error Handling). If the target file exists.vi Purpose Saves the open database to a FIBEX 2. it is overwritten. XNET converts this to a linear scaling with factor 1. the target file may be missing details from the original file.1 file.

dbc) or an NI-CAN database (. © National Instruments Corporation 4-327 NI-XNET Hardware and Software Manual . Outputs error out is the error cluster output (refer to Error Handling). filepath provides the path to the CANdb or FIBEX file. alias provides the desired alias name. error in is the error cluster input (refer to Error Handling).ncd).vi Purpose Adds a new alias to a database file. the alias name can use special characters such as space and dash. this VI changes the previous filepath to the specified filepath. Format Inputs default baud rate provides the default baud rate. If filepath refers to a FIBEX database (. Use this default baud rate to specify a default CAN baud rate to use with this alias.Chapter 4 NI-XNET API for LabVIEW — File Management Subpalette File Management Subpalette This subpalette includes VIs to manage database aliases and deploy or undeploy a database file to LabVIEW Real-Time (RT). the default baud rate parameter is ignored. and NI-XNET uses that baud rate as the default. Unlike the name of other XNET database objects. XNET Database Add Alias. These database formats are specific to CAN and do not specify a cluster baud rate. If the alias name already exists. The FIBEX database format requires a valid baud rate for every CAN and FlexRay cluster. used when filepath refers to a CANdb database (.xml).

and enable efficient deployment to LabVIEW Real-Time (RT) targets. you can pass the new alias to XNET Database Deploy. NI-XNET Hardware and Software Manual 4-328 ni.Chapter 4 NI-XNET API for LabVIEW — File Management Subpalette Description NI-XNET uses alias names for database files. allow for changes to the file system without changing the application. For LabVIEW RT. The alias names provide a shorter name for display. After deploying the database.vi to transfer an optimized binary image of the database to the LabVIEW RT target. you can use the alias name in any VI for the Windows host and the LabVIEW RT target. This VI is supported on Windows only.com .

use the following syntax for the IP address to deploy an alias: [user:password@]IPaddress. This VI must access the remote LabVIEW RT target from Windows. you can use the alias name in any VI for the Windows host and the LabVIEW RT target. so IP address must specify a valid IP address for the LabVIEW RT target. To deploy a database text file. wait for complete? determines whether the VI returns directly or waits until the entire transmission is completed.vi Purpose Deploys a database to a remote LabVIEW Real-Time (RT) target. You can find this IP address using MAX or VIs in the LabVIEW Real-Time palettes. error in is the error cluster input (refer to Error Handling). This VI is supported on Windows only. Description This VI transfers an optimized binary image of the database to the LabVIEW RT target. After deploying the database. error out is the error cluster output (refer to Error Handling).Chapter 4 NI-XNET API for LabVIEW — File Management Subpalette XNET Database Deploy. Format Inputs IP address is the target IP address. alias provides the database alias name. If the LabVIEW RT target access is password protected. LabVIEW RT database deployments are managed remotely from Windows. © National Instruments Corporation 4-329 NI-XNET Hardware and Software Manual .vi. first add an alias using XNET Database Add Alias. Outputs percent complete indicates the deployment progress.

vi in a loop until percent complete is returned as 100. NI-XNET Hardware and Software Manual 4-330 ni.com . If wait for complete? is true. You can use percent complete to display transfer progress on your front panel. and percent complete is 100.Chapter 4 NI-XNET API for LabVIEW — File Management Subpalette Remote file transfer can take a few seconds. this VI transfers a portion of the database and returns before it is complete. then returns. You must call XNET Database Deploy. at which time error out reflects the entire deployment status. especially when the RT target is far away. If wait for complete? is false. error out returns success. and percent complete is less than 100. For an incomplete transfer. this VI waits for the entire transfer to complete. error out reflects the deployment status.

the array is empty. © National Instruments Corporation 4-331 NI-XNET Hardware and Software Manual . This parameter applies to Windows targets only. If no aliases are registered. If no aliases are registered. Outputs array of alias returns an array of strings. on RT targets. If IP address is unwired (empty). Format Inputs IP address is the target IP address. the array is empty. array of filepath returns an array of strings that contain the file paths and filenames of the databases assigned to the aliases. this VI retrieves aliases and file paths for the remote LabVIEW RT target. You can find this IP address using MAX or VIs in the LabVIEW Real-Time palettes. one for every alias registered in the system.vi Purpose Gets the current list of databases on a system. this VI retrieves aliases and file paths for the local Windows system. this array always is empty. error in is the error cluster input (refer to Error Handling). one for every alias registered in the system. error out is the error cluster output (refer to Error Handling).Chapter 4 NI-XNET API for LabVIEW — File Management Subpalette XNET Database Get List. If IP address is a valid IP address.

array of filepath is empty. It provides the Windows file path for each corresponding alias. NI-XNET Hardware and Software Manual 4-332 ni. LabVIEW RT database deployments are managed remotely from Windows. so that only the alias is needed. This VI is supported on Windows only. The size of this array is the same as array of alias. NI-XNET handles the file system on the LabVIEW RT target automatically.com . For a remote call to LabVIEW RT. array of filepath returns an array of file paths.Chapter 4 NI-XNET API for LabVIEW — File Management Subpalette Description For a local Windows call (IP address empty).

Description This VI removes the alias from NI-XNET. © National Instruments Corporation 4-333 NI-XNET Hardware and Software Manual . error in is the error cluster input (refer to Error Handling). Format Inputs alias is the name of the alias to delete.vi Purpose Removes a database alias from the system. This VI is supported on Windows only. and the alias is removed from Windows only (not LabVIEW RT targets). Outputs error out is the error cluster output (refer to Error Handling).Chapter 4 NI-XNET API for LabVIEW — File Management Subpalette XNET Database Remove Alias. It just removes the alias association to the database filepath.vi to remove an alias from a LabVIEW Real-Time (RT) target. but does not affect the database text file. Use XNET Database Undeploy.

Chapter 4 NI-XNET API for LabVIEW — File Management Subpalette XNET Database Undeploy. This VI must access the remote LabVIEW RT target from Windows. If the LabVIEW RT target access is password protected. alias provides the database alias name.vi Purpose Undeploys a database from a remote LabVIEW Real-Time (RT) target. Outputs error out is the error cluster output (refer to Error Handling). so IP address must specify a valid IP address for the LabVIEW RT target. Description This VI completely deletes the database file and its alias from the LabVIEW RT target. error in is the error cluster input (refer to Error Handling). LabVIEW RT database deployments are managed remotely from Windows. NI-XNET Hardware and Software Manual 4-334 ni. Format Inputs IP address is the target IP address. This VI is supported on Windows only.com . You can find this IP address using MAX or VIs in the LabVIEW Real-Time palettes. you can use the following syntax for the IP address to deploy an alias: [user:password@]IPaddress.

vi XNET Wait (Interface Communicating).vi © National Instruments Corporation 4-335 NI-XNET Hardware and Software Manual .Chapter 4 NI-XNET API for LabVIEW — Notify Subpalette Notify Subpalette This subpalette includes functions for waiting on events from XNET hardware. including creation of a LabVIEW timing source. XNET Wait.vi Purpose Waits for an event to occur.vi XNET Wait (CAN Remote Wakeup). Description The instances of this polymorphic VI specify the event to wait for: • • • XNET Wait (Transmit Complete).

error out is the error cluster output (refer to Error Handling). the data may or may not have been successfully transmitted.Chapter 4 NI-XNET API for LabVIEW — XNET Wait. if this wait returns successfully. Description Waits for all data provided to XNET Write.vi API call to provide data for this session. however. error in is the error cluster input (refer to Error Handling).vi XNET Wait (Transmit Complete). After using the XNET Write. timeout specifies the maximum amount of time in seconds to wait. it indicates that the session is making no more attempts to transmit the data.vi before this XNET Wait. The timeout parameter provides the maximum number of seconds to wait. you can use this VI to wait for that data to transmit to remote ECUs. Outputs session out is the same as session in.com . This wait applies to only the current XNET session.vi call to be transmitted on the CAN or FlexRay network. NI-XNET Hardware and Software Manual 4-336 ni. You can use this VI to guarantee that all frames have been transmitted before stopping this session. provided for use with subsequent VIs. The default value is 10 (10 seconds).vi Purpose Waits for previously written data to be transmitted on the cluster. Format Inputs session in is the session to apply the wait. Depending on the bus or configuration properties such as Interface:CAN:Single Shot Transmit?. and not other sessions used for the same interface.

error in is the error cluster input (refer to Error Handling). once the interface has successfully integrated. Description Waits for the interface to begin communication on the cluster. Outputs session out is the same as session in. Format Inputs session in is the session to apply the wait. After the interface is started. error out is the error cluster output (refer to Error Handling).vi XNET Wait (Interface Communicating).vi Purpose Waits for the interface to begin communication on the cluster. for other buses. the communication may occur within a few microseconds of starting the interface. This wait returns after communication with the cluster has been established. Once the FlexRay interface has successfully integrated. If the FlexRay interface can coldstart. © National Instruments Corporation 4-337 NI-XNET Hardware and Software Manual . returns Normal-Active. timeout specifies the maximum amount of time in seconds to wait. where the interface must perform a startup routine that may take several cycles to complete.Chapter 4 NI-XNET API for LabVIEW — XNET Wait. Note For some buses (for example. Reading the XNET FlexRay interface Protocol Operation Control (POC) state (refer to the XNET Read (State FlexRay Comm). it sends out startup frames when started and synchronizes its clock with other startup nodes in the cluster. the controller connects to the cluster and starts communication. CAN). An example of a bus where the communication time is delayed from the start time is FlexRay. this could be delayed. A FlexRay interface attempts integration with the remaining nodes in the cluster when it is started.vi description). the interface is ready to start transmitting and receiving frames. provided for use with subsequent VIs.

The default value is 10 (10 seconds). the interface start occurs after the start trigger is received.Chapter 4 NI-XNET API for LabVIEW — XNET Wait. The timeout parameter provides the maximum number of seconds to wait.com .vi Note If a start trigger is configured for the interface. NI-XNET Hardware and Software Manual 4-338 ni.

the interface and transceiver go into a low-powered mode. The default value is 10 (10 seconds). However. This value must be 1. provided for use with subsequent VIs. Outputs session out is the same as session in.vi Purpose Waits for the CAN interface to wake up due to activity by a remote ECU on the network. timeout specifies the maximum amount of time in seconds to wait.vi XNET Wait (CAN Remote Wakeup). the transceiver detects this transmission. When asleep. and communication is restored. © National Instruments Corporation 4-339 NI-XNET Hardware and Software Manual . Note The interface neither receives nor acknowledges the transmission that caused the wakeup. and both the controller and transceiver wake up.Chapter 4 NI-XNET API for LabVIEW — XNET Wait. error out is the error cluster output (refer to Error Handling). The timeout parameter provides the maximum number of seconds to wait. Description This wait is used when you set the XNET Session Interface:CAN:Transceiver State property to Sleep. after the interface wakes up. the transceiver automatically is placed into normal mode. Format Inputs session in is the session to apply the wait. error in is the error cluster input (refer to Error Handling).0 (one second) or greater. This wait detects that remote wakeup. If a remote CAN ECU transmits a frame.

Format Inputs timing source name is the timing source name. timing source out uses the session name (session in). The timing source is based on the FlexRay communication cycle.vi XNET Create Timing Source (FlexRay Cycle). The timing source sends a tick to the Timed Loop at a specific offset in time within the FlexRay cycle. You must configure the session to use a FlexRay interface.com . The offset within the cycle is specified in FlexRay macroticks. This input is optional.vi Purpose Creates a timing source for a LabVIEW Timed Loop.vi XNET Create Timing Source. This session is selected from the LabVIEW project or returned from XNET Create Session. You can create only one FlexRay cycle timing source for each interface. returned as timing source out if this VI succeeds. because the timing source is based on that interface’s communication cycle.vi Purpose Creates a timing source for a LabVIEW Timed Loop. If you leave timing source name unwired (empty).vi. NI-XNET Hardware and Software Manual 4-340 ni.Chapter 4 NI-XNET API for LabVIEW — XNET Create Timing Source. Description The instances of this polymorphic VI specify the timing source to create: • XNET Create Timing Source (FlexRay Cycle). session in is the session to use for creating the timing source.

which indicates to the Timed Loop that no valid timing source exists. which specifies a tick at the start of every FlexRay cycle. refer to Macrotick Offset. If this VI returns an error (status true in error out). and therefore this VI is not supported on Windows. real-time execution is required. You can wire a single timing source to multiple Timed Loops. timing source out is empty. error in is the error cluster input (refer to Error Handling). Because the FlexRay cycle repeats every few milliseconds. refer to Using the Timed Loop. The minimum value is zero (0). You can create only one FlexRay Cycle timing source for each FlexRay interface. For more information about the Timed Loop nodes. provided for use with subsequent VIs. which you can read from the XNET Cluster the session uses. The value cannot be equal to or greater than the number of macroticks in the cycle. The following sections include more detailed information about using this VI: • • • Using the Timed Loop Session Start and Stop Macrotick Offset © National Instruments Corporation 4-341 NI-XNET Hardware and Software Manual . For further recommendations about selecting a value. timing source out is the timing source name. Outputs session out is the same as session in.vi macrotick offset is the offset within each FlexRay cycle that you want the timing source to tick. from the FlexRay:Macro Per Cycle property. Description Use this VI to synchronize your LabVIEW Real-Time application to the deterministic FlexRay cycle. You wire this name to the Source Name of the input node outside the Timed Loop. error out is the error cluster output (refer to Error Handling).Chapter 4 NI-XNET API for LabVIEW — XNET Create Timing Source.

you wire the constant 1 to this terminal. refer to the LabVIEW help topics for the Timed Loop.com . 2 iterates the loop every other FlexRay cycle). Period: For most applications. which overrides the default of 1000. The Timed Loop contains the nodes described below. According to the FlexRay specification. This specifies the XNET timing source and overrides the default built-in timing source (1 kHz). The Period specifies the number of timing source ticks that must occur for the loop to iterate. Higher values skip FlexRay cycles (for example. A value of 1 iterates the Timed Loop on every FlexRay cycle. 1 2 3 4 1 2 Input Node Left Data Node 3 4 Right Data Node Output Node Figure 4-10. For complete information. For this FlexRay cycle timing source. the process of fully synchronizing the NI-XNET Hardware and Software Manual 4-342 ni.Chapter 4 NI-XNET API for LabVIEW — XNET Create Timing Source. you wire the constant 300 to this terminal. Timeout: For most applications.vi Using the Timed Loop This section includes guidelines for using the LabVIEW Timed Loop with the NI-XNET FlexRay Cycle timing source. which overrides the default of –1. Timed Loop Nodes Input Node Source Name: Wire the timing source name output of this VI to this terminal on the Timed Loop input node. this timeout primarily applies to the first loop iteration. The Timeout specifies the maximum number of milliseconds to wait for a tick.

© National Instruments Corporation 4-343 NI-XNET Hardware and Software Manual . The timeout causes the iteration to execute untimed. starting FlexRay communication within the Timed Loop ensures that you do not miss the first FlexRay cycle. and returns the error condition on the Output Node. You typically wire the error out from this XNET Create Timing Source (FlexRay Cycle). Left Data Node Error: Propagates errors through the structure. After the initial session and interface auto-start. wire error out from the last VI in the subdiagram to this terminal.vi prior to the Timed Loop (use the Timed Loop auto-start instead). such as a shift register. Error: Use this terminal to propagate errors through the Timed Loop. Using a value of 300 for this terminal ensures that if problems occur on the FlexRay network. exits the loop. If Error receives an error condition. If network communication problems occur (for example. this terminal returns a value of 5 (Timeout). the XNET session for the timing source is started automatically. then try again on the next iteration. the Timed Loop Timeout is used to wait for communication to begin. the first tick does not occur. the Timed Loop finishes executing the current iteration untimed. Output Node Error: Propagates errors the Timed Loop receives and returns errors from the subdiagram.vi to this terminal. Due to these factors.Chapter 4 NI-XNET API for LabVIEW — XNET Create Timing Source. Wake-Up Reason returns a value of 0 (Normal). This auto-start is equivalent to calling XNET Start. The Timed Loop does not execute if this terminal receives an error condition.vi (Normal). If you want the Timed Loop to exit on error. do not call XNET Start. the Timed Loop does not return an error condition from Error. This avoids the need for alternate error propagation techniques. Because the Timed Loop uses an execution priority that typically is higher than the VIs that precede it. When the timeout occurs. This auto-start is performed even if the session’s Auto Start? property is false.vi distributed network clocks can take as long as 200 ms. This network clock synchronization is required for the NI-XNET interface to detect the first FlexRay cycle and send a tick to the Timed Loop. the Timed Loop can recover (refer to Wake-Up Reason in Left Data Node). Wire this terminal to error in of the first VI within the subdiagram. noise on the cable). Wake-Up Reason: If the first Timed Loop iteration encounters a Timeout due to problems on the FlexRay network. Right Data Node Error: Propagates errors from the subdiagram out of the Timed Loop. If the FlexRay tick occurs as expected. Session Start and Stop When the Timed Loop input node executes.

4-12.Chapter 4 NI-XNET API for LabVIEW — XNET Create Timing Source. so you can continue to use the session in VIs that follow. or TCP/IP data). For better visibility in Figures 4-11.vi When the Timed Loop exits to its output node. In this example.vi to read the value received from slot 1. When using a PXI controller for LabVIEW Real-Time. your results typically will be faster. FlexRay Frame Timed Read NI-XNET Hardware and Software Manual 4-344 ni. The subdiagram in the Timed Loop calls XNET Read.com . an dCC I/O) are longer than actual performance. the macrotick offset is set to occur at the end of slot 1. so that it occurs quickly and with negligible jitter to your LabVIEW RT execution. vision. and 4-13. Figure 4-11 shows the effects of this implementation. The Timed Loop does not stop or clear the session. the NI-XNET blocks (Read/Write. When the FlexRay Communication Controller (CC) receives a frame. Macrotick Offset To set the macrotick offset. This is especially true if your application does not transfer data on the PXI backplane continuously (for example. the XNET session remains in its current state. it helps to understand some NI-XNET implementation aspects. as this sort of transfer can adversely impact the NI-XNET DMA latencies. DMA I/O. streaming analog. This transfer is performed using DMA (Direct Memory Access) on the PXI backplane. the NI-XNET hardware immediately transfers that frame to LabVIEW Real-Time (RT). VIs in Timed Loop (Your Application) R1 CC Input and DMA Input IN1 Time (Cycle 2) Slot 1 Slot 2 Start of Cycle 3 Macrotick Offset Figure 4-11.

This means that although XNET Write. XNET Read.vi (W8) is called well in advance of slot 8 in the cycle. The frame values are transferred to the NI-XNET hardware onboard processor memory. shown as C8.vi. The FlexRay Communication Controller transmits each frame value according to its slot configuration in the cycle. macrotick offset must be large enough to ensure that the frame DMA input is complete. this onboard processor waits until the FlexRay cycle Network Idle Time (NIT) to transfer the frame values from its memory to the FlexRay Communication Controller (CC). the frame values are transferred immediately using DMA.vi Figure 4-11 shows that the DMA input transfer for slot 1 (IN1) occurs at the same time as XNET Read. For efficiency reasons. Relative to Figure 4-11. This implementation for output means that it is not necessarily urgent to call XNET Write. Nevertheless. This example expands on Figure 4-11 by calling XNET Write. Depending on which one completes first. Figure 4-12 shows the effects of this implementation.vi was called before slot 8’s occurrence in the current cycle 3.vi before the relevant slot. To prevent this uncertainty.vi with a value for slot 8. © National Instruments Corporation 4-345 NI-XNET Hardware and Software Manual . setting macrotick offset to the end of slot 2 would suffice. XNET Write. You merely need to provide time for XNET Write. The DMA output transfer for the value of slot 8 (D8) occurs immediately after XNET Write.vi may return a value from the current cycle (3) or the previous cycle (2).vi.vi for slot 1 (R1).vi and the related DMA output to complete prior to the NIT.Chapter 4 NI-XNET API for LabVIEW — XNET Create Timing Source. When your LabVIEW RT application calls XNET Write. the value for slot 8 is not placed into the FlexRay Communication Controller until the NIT time. that value does not transmit until the subsequent cycle 4.

The FlexRay:NIT Start property provides the macrotick offset for the start of NIT. the typical macrotick offset goal is a value that executes the Timed Loop after the last cycle input DMA and prior to the NIT. Assuming static slot X is the last slot that you read. Static slot numbers begin at 1. FlexRay Frame Timed Write Taking these implementation considerations into account. the FlexRay:Static Slot property provides the number of macroticks for each static slot. the lower limit for macrotick offset is (X × FlexRay:Static Slot). XNET Write. XNET Read.Chapter 4 NI-XNET API for LabVIEW — XNET Create Timing Source. To find a value for macrotick offset. a simulation model).vi. To determine the lower limit. LabVIEW code within the Timed Loop (for example. Ideally. The following example demonstrates a technique for calculating macrotick offset. the macrotick offset provides sufficient time for input DMA.com .vi. and DMA output. which is your upper limit.vi VIs in Timed Loop (Your Application) R1 W8 DMA Output D8 CC Output C8 CC Input and DMA Input IN1 1 2 3 4 5 6 7 8 9 10 Dynamic NIT (Cycle 4) Time (Cycle 2) Start of Cycle 3 Macrotick Offset Figure 4-12. you can use the XNET Cluster property node. The example uses a simple FlexRay cluster configured as follows: • • • • • • Baud Rate—5000000 bps (5 Mbps) Macrotick—1 (1 µs duration) Macro Per Cycle—1000 (1 ms) Number of Static Slots—10 Number of Minislots—80 Static Slot—58 MT (16 byte payload) NI-XNET Hardware and Software Manual 4-346 ni.

Writes a Signal Output Single-Point session for frames in static slots 8.vi • • NIT Start—900 MT offset NIT—100 MT (duration) Within the Timed Loop.vi/XNET Write. 3. select a macrotick offset that locates the simulation model at the midpoint between the end of slot 4 (the last input frame) and the start of NIT. and CC input/output. Using the cluster configuration and the time required for the simulation model. This provides the maximum time possible for XNET Read. 9. the example does the following: • • • Reads a Signal Input Single-Point session for frames in static slots 2. Assume that you test the simulation model performance and determine that it takes 100 µs (including jitter). DMA input/output. and 4. Executes a simulation model (passes in inputs and obtains outputs).Chapter 4 NI-XNET API for LabVIEW — XNET Create Timing Source.vi. EndOfSlot4 = (4 × Static_Slot) = (4 × 58) = 232 Midpoint = EndOfSlot4 + ((NIT_Start – EndOfSlot4) / 2) = 232 + ((900 – 232) / 2) = 232 + 334 = 566 macrotick offset = (Midpoint – (SimModelTime / 2)) = (566 – (100 / 2)) = 516 © National Instruments Corporation 4-347 NI-XNET Hardware and Software Manual . and 10.

vi for frames 2. use XNET Read (State FlexRay Cycle Macrotick). Notice that the simulation model is synchronized deterministically with the FlexRay cycle.Chapter 4 NI-XNET API for LabVIEW — XNET Create Timing Source. The start of SIM is halfway between the end of slot 4 and the start of NIT.4 DMA Output SIM W8.4. 3. VIs in Timed Loop (Your Application) R2. The simulation model execution is shown as block SIM.10.3.9.9.9.9.10 CC Output IN3 CC Input and DMA Input IN2 1 2 3 4 IN4 5 6 7 8 9 10 Dynamic C8.10. As with any performance-sensitive configuration. Timing Source Example Reading from the FlexRay Communication Controller (and performing the corresponding DMA) for frames 2. The corresponding DMA output for these frames is shown as block D8. and 4 is shown as blocks IN2. and then writes the output for the next cycle. XNET Read. IN3. calculates outputs. To determine the current cycle and macrotick within the Timed Loop for measurement purposes. and IN4.vi Figure 4-13 shows the Timed Loop timing diagram. The Timed Loop code reads inputs from the current cycle. 9. The FlexRay Communication Controller update during the NIT is shown as block C8. you should measure using your own hardware and application to calculate the best macrotick offset value.com .10 D8. and 10 is shown as block W8. and 4 is shown as block R2.9. 3.9.vi. XNET Write. NI-XNET Hardware and Software Manual 4-348 ni.10 Time (Cycle 2) NIT (Cycle 4) Start of Cycle 3 Macrotick Offset (516) Figure 4-13.10.3.vi for frames 8.

When you are ready for all sessions to start communicating on the associated interface. This session is selected from the LabVIEW project or returned from XNET Create Session. To have multiple sessions start at exactly the same time.Chapter 4 NI-XNET API for LabVIEW — Advanced Subpalette Advanced Subpalette This subpalette includes advanced functions for controlling the state of NI-XNET sessions. If the interface is in the Stopped state before this VI runs.vi with the Interface Only scope. This is the default value for scope if it is unwired.vi. and retrieving information about the XNET hardware in your system. start each session with the Session Only scope. © National Instruments Corporation 4-349 NI-XNET Hardware and Software Manual . Starting a previously started session is considered a no-op.vi with the Session Only scope followed by calling XNET Start. This is equivalent to calling XNET Start. Format Inputs session in is the session to start. Session Only (1) The session is placed into the Started state (refer to State Models). call XNET Start. Normal (0) The session is started followed by starting the interface. the interface remains in the Stopped state.vi Purpose Starts communication for the specified XNET session. scope describes the impact of this operation on the underlying state models for the session and its interface.vi with the Interface Only scope. XNET Start. connecting hardware terminals. and no communication occurs with the bus.

the interface is placed into the Started state (refer to State Models). For more information about the automatic start feature. for use with subsequent VIs. error out is the error cluster output (refer to Error Handling). refer to State Models. refer to the XNET Frame Default Payload and XNET Signal Default Value properties. it takes data from all started sessions to communicate with other nodes on the bus. or you read an input session before it receives a frame. Starting a previously started interface is considered a no-op. error in is the error cluster input (refer to Error Handling). this VI is optional. After the interface starts communicating. Outputs session out is the same as session in. For each physical interface. all previously started sessions can transfer data to and from the bus. For more information. When a session is started.Chapter 4 NI-XNET API for LabVIEW — XNET Start. For a specification of the state models for the session and interface. Interface: The interface physically connects to the bus and transmits (or receives) data for the sessions.com . Description Because the session is started automatically by default. When the interface is started.vi Interface Only (2) If the underlying interface is not previously started. This VI is for more advanced applications to start multiple sessions in a specific order. each of which contains frames or signals to be transmitted (or received) on the bus. You can start each logical unit separately. all contained frames or signals are placed in a state where they are ready to communicate. default data is used. NI-XNET Hardware and Software Manual 4-350 ni. refer to the Auto Start? property. the NI-XNET hardware is divided into two logical units: • • Sessions: You can create one or more sessions. If an output session starts before you write data.

for all sessions. If this is the last session stopped on the interface. Format Inputs session in is the session to stop. first stop the interface with the Interface Only scope and © National Instruments Corporation 4-351 NI-XNET Hardware and Software Manual . but data from this session does not transfer.Chapter 4 NI-XNET API for LabVIEW — XNET Stop.vi XNET Stop. If the interface was in the Started or Running state before this VI is called. to avoid disruption of communication on the other sessions. This is the default value for scope if it is unwired. This prevents all communication on the bus.vi. This allows you modify certain properties that require the interface to be stopped (for example. All sessions remain in the Started state. this call is treated just like the Session Only scope. the interface remains in that state and communication continues. as the Normal scope only stops the interface if there are no other running sessions. Session Only (1) The session is placed in the Stopped state (refer to State Models). To have multiple sessions stop at exactly the same time. Interface Only (2) The underlying interface is placed in the Stopped state (refer to State Models).vi Purpose Stops communication for the specified XNET session. Normal (0) The session is stopped. the interface is also stopped. CAN baud rate). This scope generally is not necessary. If any other sessions are running on the interface. This session is selected from the LabVIEW project or returned from XNET Create Session. scope describes the impact of this operation on the underlying state models for the session and its interface.

refer to State Models. the NI-XNET hardware is divided into two logical units: • • Sessions: You can create one or more sessions. When a session is stopped. each of which contains frames or signals to be transmitted (or received) on the bus.com . error out is the error cluster output (refer to Error Handling).Chapter 4 NI-XNET API for LabVIEW — XNET Stop. Description Because the session is stopped automatically when cleared (closed). When the interface is stopped. NI-XNET Hardware and Software Manual 4-352 ni. error in is the error cluster input (refer to Error Handling). this VI is optional.vi then stop each session with either the Normal or Session Only scope. for use with subsequent VIs. it no longer takes data from sessions to communicate with other nodes on the bus. For a specification of the state models for the session and interface. For each physical interface. Interface: The interface physically connects to the bus and transmits (or receives) data for the sessions. Outputs session out is the same as session in. You can stop each logical unit separately. all contained frames or signals are placed in a state where they are no longer ready to communicate.

This session is selected from the LabVIEW project or returned from XNET Create Session. communication stops. if you create a session for a frame named frameA using Frame Output Single-Point mode.vi with normal scope.vi.vi returns an error.vi is rarely needed in your application. so if this is the last session using the interface. Therefore.vi call. You typically use XNET Clear. If you call the XNET Clear. LabVIEW automatically clears all XNET sessions within that VI and its subVIs. error in is the error cluster input (refer to Error Handling). © National Instruments Corporation 4-353 NI-XNET Hardware and Software Manual .vi XNET Clear. XNET Clear.vi when you need to clear the existing session to create a new session that uses the same objects. When your application is finished (the top-level VI is idle). then you create a second session for frameA using Frame Output Queued mode. For example. Outputs error out is the error cluster output (refer to Error Handling). because frameA can be accessed using only one output mode. XNET Clear.vi before the second XNET Create Session. Description This VI stops communication for the session and releases all resources the session uses.Chapter 4 NI-XNET API for LabVIEW — XNET Clear. you can close the previous use of frameA to create the new session. the second call to XNET Create Session. Format Inputs session in is the session to clear.vi internally calls XNET Stop.vi Purpose Clears (closes) the XNET session.

vi. XNET Start.vi and XNET Stop. Format Inputs session in is the session to flush.vi a few seconds later.vi to write three frames. then call XNET Start. all sessions use queues to store frames.vi between XNET Stop. For input modes. Outputs session out is the same as session in. if you receive three frames. but not obtained by calling XNET Read.com . but not transmitted successfully.vi. Use XNET Flush. the queues store frame values (or corresponding signal values) that have been received.vi. if you call XNET Write. provided for use with subsequent VIs. This session is selected from the LabVIEW project or returned from XNET Create Session. XNET Read.vi. the queues store frame values provided to XNET Write. then call XNET Stop. If you call XNET Flush. For output sessions. the three frames remains in the queue. error out is the error cluster output (refer to Error Handling). If you call XNET Flush. the three frames transmit.vi have no effect on these queues. you obtain the three frames received earlier. then call XNET Read. error in is the error cluster input (refer to Error Handling).vi to empty all values from the session’s queues. For example.vi.Chapter 4 NI-XNET API for LabVIEW — XNET Flush. NI-XNET Hardware and Software Manual 4-354 ni. then immediately call XNET Stop. If you call XNET Start.vi and XNET Start.vi Purpose Flushes (empties) all XNET session queues.vi.vi.vi between XNET Stop. potentially followed by other frames received after calling XNET Start.vi returns only frames received after the calling XNET Start.vi XNET Flush.vi.vi and XNET Start.vi. As another example.vi.vi a few seconds later. no frames transmit. Description With the exception of single-point modes.

vi. Internal terminals include timebases (clocks) and logical entities such as a start trigger.vi XNET Connect Terminals. provided for simpler wiring. © National Instruments Corporation 4-355 NI-XNET Hardware and Software Manual .Chapter 4 NI-XNET API for LabVIEW — XNET Connect Terminals. This session is selected from the LabVIEW project or returned from XNET Create Session. External terminals include PXI_Trigger lines for a PXI card or RTSI terminals for a PCI card. Format Inputs session in is the session to use for the connection. Outputs session out is a duplicate of the session in. The terminal inputs use the XNET Terminal I/O name. destination terminal is the connection destination. error in is the error cluster input (refer to Error Handling). so you can select from possible values using the drop-down list. Description This VI connects a source terminal to a destination terminal on the interface hardware. one of the pair is an internal and the other an external.vi Purpose Connects terminals on the XNET interface. source terminal is the connection source. Typically. error out is the error cluster output (refer to Error Handling). The XNET terminal represents an external or internal hardware connection point on a National Instruments XNET hardware product.

Source Terminals The following table describes the valid source terminals.vi Valid Combinations of Source/Destination The following table lists all valid combinations of source terminal and destination terminal. Valid only on FlexRay hardware. these are the RTSI lines. Selects a general-purpose Front Panel Trigger line as the connection source (input). Source Terminal PXI_Trigx Description Selects a general-purpose trigger line as the connection source (input). these are the PXI Trigger lines.com . For PCI cards.Chapter 4 NI-XNET API for LabVIEW — XNET Connect Terminals. Destination Source PXI_Trigx FrontPanel0 FrontPanel1 PXI_Star1 PXI_Clk101 StartTrigger CommTrigger FlexRayStartCycle2 FlexRayMacrotick2 1MHzTimebase 10MHzTimebase 1 2 PXI_Trigx X X X X       FrontPanel0 FrontPanel1 X X X X      X Start Trigger    X X X X X X X Master Timebase   X  X X X  X X Valid only on PXI hardware. For PXI cards. FrontPanel0 FrontPanel1 NI-XNET Hardware and Software Manual 4-356 ni.

which is not available until the interface is properly integrated into the bus. some PXI products can source star trigger from Slot 2 to all higher-numbered slots. When you use PXI_Clk10 as the XNET card timebase.vi Source Terminal PXI_Star Description Selects the PXI star trigger signal. Note: You cannot use this terminal with a PCI device. you can synchronize two XNET cards by routing StartTrigger as the source terminal on one XNET card and then routing StartTrigger as the destination terminal on the other XNET card. with both cards using the same RTSI line for the connections. PXI_Star enables the PXI XNET hardware to receive the star trigger when it is in Slot 3 or higher. The communicating trigger is the same for all sessions using a given interface. Because you cannot generate a start trigger to another interface until the synchronization clock is also available. © National Instruments Corporation 4-357 NI-XNET Hardware and Software Manual . You can route the start trigger of this XNET card to the start trigger of other XNET or DAQ cards to ensure that sampling begins at the same time on both cards. StartTrigger Selects the start trigger. PXI_Clk10 Selects the PXI 10 MHz backplane clock. Note: You cannot use this terminal with a PCI device. but is used if your clock source is the FlexRayMacrotick. you also must use PXI_Clk10 as the timebase for other PXI cards to perform synchronized input/output. For example. This routes the 10 MHz PXI backplane clock for use as the XNET card timebase.Chapter 4 NI-XNET API for LabVIEW — XNET Connect Terminals. The only valid destination terminal for this source is MasterTimebase. The start trigger is the same for all sessions using a given interface. You can route the communicating trigger of this XNET card to the start trigger of other XNET or DAQ cards to ensure that sampling begins at the same time on both cards. which is the event set when the when the Start Interface transition occurs. you can use this trigger to allow for the clock under this special circumstance. The communicating trigger is similar to a start trigger. Within a PXI chassis. which is the event set when the Comm State Communicating transition occurs. CommTrigger Selects the communicating trigger.

After the interface is communicating to the FlexRay network. For example. This configures the counter that timestamps received frames to run synchronized to FlexRay time. NI-XNET Hardware and Software Manual 4-358 ni. You can use this source terminal to synchronize other measurements to the actual time on the FlexRay bus. you can synchronize two XNET cards by connecting 1MHzTimebase to PXI_Trigx on one XNET card and then connecting PXI_Trigx to MasterTimebase on the other XNET card.Chapter 4 NI-XNET API for LabVIEW — XNET Connect Terminals. the Macrotick signal becomes available. For example. This generates a repeating pulse that external hardware can use to synchronize a measurement or other action with each FlexRay cycle. Note: You can use this terminal only with a FlexRay device. The FlexRay Macrotick is the basic unit of time in a FlexRay network. 1MHzTimebase Selects the XNET card’s local 1 MHz oscillator. This routes the XNET card local 10 MHz clock for use as a timebase by other NI cards. The only valid destination terminals for this source are PXI Trigger0–PXI Trigger7.com . You also can connect the FlexRayMacrotick to the MasterTimebase. and also allows you to read the FlexRay cycle macrotick to do additional synchronization with the FlexRay bus in your application.vi Source Terminal FlexRayStartCycle Description Selects the FlexRay Start of Cycles as an advanced trigger source. you can synchronize two XNET cards by connecting 10MHzTimebase to PXI_Trigx on one XNET card and then connecting PXI_Trigx to MasterTimebase on the other XNET card. In this scenario. you would configure the FlexRayMacrotick as the source terminal and route it to a RTSI or front panel terminal. 10MHzTimebase Selects the XNET card’s local 10 MHz oscillator. FlexRayMacrotick Selects the FlexRay Macrotick as a timing source. This source terminal routes the XNET card local 1 MHz clock so that other NI cards can use it as a timebase. Note: You can use this terminal only with a FlexRay device.

and 20 MHz. you also can use PXI_Clk10 as the source terminal. For example. Selects a general-purpose Front Panel Trigger line as the connection destination (output). This receives the PXI 10 MHz backplane clock for use as the master timebase. and then connecting the same PXI_Trig line as the source terminal. FrontPanel0 FrontPanel1 StartTrigger MasterTimebase MasterTimebase instructs the XNET card to use the connection source terminal as the master timebase. The start trigger is the same for all sessions using a given interface. these are the PXI Trigger lines. For PXI cards. The XNET card uses this master timebase for input sampling (including timestamps of received messages) as well as periodic output sampling. For example. reading or writing to a session may start the interface. The start trigger occurs on the first source terminal low-to-high transition. For PCI cards. these are the RTSI lines. you can synchronize a CAN and DAQ M Series MIO card by connecting the 10 MHz oscillator (board clock) of the DAQ card to a PXI_Trig line. The default (disconnected) state of this destination means the start trigger occurs when XNET Start.Chapter 4 NI-XNET API for LabVIEW — XNET Connect Terminals. © National Instruments Corporation 4-359 NI-XNET Hardware and Software Manual . Destination Terminal PXI_Trigx Description Selects a general-purpose trigger line as the connection destination (output). if Auto Start? is enabled. Your XNET hardware supports incoming frequencies of 1 MHz. You can route the start trigger of another XNET or DAQ card to ensure that sampling begins at the same time on both cards. you can synchronize with an M-Series DAQ MIO card by routing the AI start trigger of the MIO card to a RTSI line and then routing the same RTSI line with StartTrigger as the destination terminal on the XNET card. Selects the start trigger. This causes the Start Interface transition to occur. Alternately. which is the event that allows the interface to begin communication.vi is invoked with the scope set to either Normal or Interface Only. For PXI form factor hardware. and automatically detects the frequency without any additional configuration. 10 MHz.vi Destination Terminals The following table describes the valid destination terminals.

the hardware automatically uses the local oscillator as the default MasterTimebase. the default connection to the MasterTimebase is the PXI_Clk10 signal.com . meaning you could run each port off of a separate incoming (or onboard) timebase signal. NI-XNET Hardware and Software Manual 4-360 ni. the default connection to the Master Timebase is the local oscillator. If you are using a PCI board. if it is available. Some chassis allow PXI_Clk10 to be turned off.Chapter 4 NI-XNET API for LabVIEW — XNET Connect Terminals.vi Destination Terminal Description MasterTimebase applies separately to each port of a multiport XNET card. If you are using a PXI board. In this case.

you first must stop the interface using XNET Stop. Then you can call XNET Disconnect Terminals.vi. This session is selected from the LabVIEW project or returned from XNET Create Session. you can call XNET Start.vi and XNET Connect Terminals. When the final session for a given interface is cleared (either by the VI going idle or by explicit calls to XNET Clear. Therefore.vi Purpose Disconnects terminals on the XNET interface. Format Inputs session in is the session to use for the connection.Chapter 4 NI-XNET API for LabVIEW — XNET Disconnect Terminals. © National Instruments Corporation 4-361 NI-XNET Hardware and Software Manual .vi). error in is the error cluster input (refer to Error Handling). NI-XNET automatically disconnects all terminal connections for that interface. Outputs session out is a duplicate of the session in. destination terminal is the connection destination. To disconnect a terminal.vi is not required for most applications. You can disconnect only a terminal that has been previously connected. provided for simpler wiring. source terminal is the connection source. This VI typically is used to change terminal connections dynamically while an application is running.vi XNET Disconnect Terminals. XNET Disconnect Terminals.vi with the Interface Only scope to restart the interface. Attempting to disconnect a nonconnected terminal results in an error.vi to adjust terminal connections. error out is the error cluster output (refer to Error Handling). Finally. Description This VI disconnects a specific pair of source/destination terminals previously connected with XNET Connect Terminals.vi.vi with the Interface Only scope.

For more information about LabVIEW property nodes. open the LabVIEW context help window (<Ctrl-H>) and move your cursor over the property name. NI-XNET Hardware and Software Manual 4-362 ni. prior to running the VI.com . You can change constants only during configuration. Pull down this node to add properties. control. Right-click each property name to create a constant.Chapter 4 NI-XNET API for LabVIEW — XNET Terminal Constant XNET Terminal Constant This constant provides the constant form of the XNET Terminal I/O name. then select a terminal. refer to XNET Terminal I/O Name. Right-click to change direction between read and write. You drag a constant to the block diagram of your VI. For a complete description. or indicator. For help on a specific property. XNET System Property Node Format Description The XNET System property node provides information about all NI-XNET hardware in your system. open the main LabVIEW help (select Search the LabVIEW Help from the Help menu) and look for the Property Nodes topic in the index. including all devices and interfaces.

Interfaces (FlexRay) Data Type Direction Read Only Required? Default No N/A Property Class XNET System Short Name IntfFlexRay Description Returns an array of all available interfaces on the system that support the FlexRay protocol. You can wire the XNET Device I/O name to the XNET Device property node to access properties of the device. The system refers to the execution target of this property node. The system refers to the execution target of this property node. © National Instruments Corporation 4-363 NI-XNET Hardware and Software Manual . it reports interfaces physically on the RT target. If this property node executes on an RT target. Each physical XNET board is a hardware product such as a PCI/PXI board. If this property is run on an RT target.Chapter 4 NI-XNET API for LabVIEW — XNET System Property Node Devices Data Type Direction Read Only Required? Default No N/A Property Class XNET System Short Name Devices Description Returns an array of physical XNET devices in the system. it reports the RT system hardware.

Interfaces (CAN) Data Type Direction Read Only Required? Default No N/A Property Class XNET System Short Name IntfCAN Description Returns an array of all available interfaces on the system that support the CAN Protocol. it reports interfaces physically on the RT target. The system refers to the execution target of this property node.com . If this property node executes on an RT target. The system refers to the execution target of this property node. If this property node executes on an RT target. it reports interfaces physically on the RT target.Chapter 4 NI-XNET API for LabVIEW — XNET System Property Node Interfaces (All) Data Type Direction Read Only Required? Default No N/A Property Class XNET System Short Name IntfAll Description Returns an array of all available interfaces on the system. NI-XNET Hardware and Software Manual 4-364 ni.

Determining upgrade availability.Build Description Returns the driver version [Build] as a U32. Remarks The driver version is specified in the following format: [Major]. © National Instruments Corporation 4-365 NI-XNET Hardware and Software Manual . Use this property for: • • Determining driver functionality or release date.Chapter 4 NI-XNET API for LabVIEW — XNET System Property Node Version:Build Data Type Direction Read Only Required? Default No N/A Property Class XNET System Short Name Ver. For example.3f4 returns: • • • • • [Major] = 1 [Minor] = 2 [Update] = 3 [Phase] = Final/Release [Build] = 4 A larger version number implies a newer XNET driver version. 1.2.[Minor].[Update][Phase][Build].

Determining upgrade availability. For example.Chapter 4 NI-XNET API for LabVIEW — XNET System Property Node Version:Major Data Type Direction Read Only Required? Default No N/A Property Class XNET System Short Name Ver. NI-XNET Hardware and Software Manual 4-366 ni. 1.3f4 returns: • • • • • [Major] = 1 [Minor] = 2 [Update] = 3 [Phase] = Final/Release [Build] = 4 A larger version number implies a newer XNET driver version.com .[Minor].Major Description Returns the driver version [Major] as a U32. Remarks The driver version is specified in the following format: [Major].[Update][Phase][Build].2. Use this property for: • • Determining driver functionality or release date.

Minor Description Returns the driver version [Minor] as a U32. 1.Chapter 4 NI-XNET API for LabVIEW — XNET System Property Node Version:Minor Data Type Direction Read Only Required? Default No N/A Property Class XNET System Short Name Ver. Remarks The driver version is specified in the following format: [Major].[Minor].2.[Update][Phase][Build]. Determining upgrade availability. Use this property for: • • Determining driver functionality or release date.3f4 returns: • • • • • [Major] = 1 [Minor] = 2 [Update] = 3 [Phase] = Final/Release [Build] = 4 A larger version number implies a newer XNET driver version. For example. © National Instruments Corporation 4-367 NI-XNET Hardware and Software Manual .

Determining upgrade availability.3f4 returns: • • • • • [Major] = 1 [Minor] = 2 [Update] = 3 [Phase] = Final/Release [Build] = 4 A larger version number implies a newer XNET driver version. NI-XNET Hardware and Software Manual 4-368 ni. Enumeration Development Alpha Beta Release Note Value 0 1 2 3 The driver’s official version always has a phase of Release. For example.Phase Description Returns the driver version [Phase] as an enumeration. 1.com .[Minor]. Use this property for: • • Determining driver functionality or release date.2. Remarks The driver version is specified in the following format: [Major].[Update][Phase][Build].Chapter 4 NI-XNET API for LabVIEW — XNET System Property Node Version:Phase Data Type Direction Read Only Required? Default No N/A Property Class XNET System Short Name Ver.

[Minor].Update Description Returns the driver version [Update] as a U32.3f4 returns: • • • • • [Major] = 1 [Minor] = 2 [Update] = 3 [Phase] = Final/Release [Build] = 4 A larger version number implies a newer XNET driver version. Remarks The driver version is specified in the following format: [Major]. Determining upgrade availability.2. © National Instruments Corporation 4-369 NI-XNET Hardware and Software Manual . 1.[Update][Phase][Build].Chapter 4 NI-XNET API for LabVIEW — XNET System Property Node Version:Update Data Type Direction Read Only Required? Default No N/A Property Class XNET System Short Name Ver. For example. Use this property for: • • Determining driver functionality or release date.

Right-click each property name to create a constant. Enumeration PXI PCI Value 0 1 NI-XNET Hardware and Software Manual 4-370 ni.com . For help on a specific property. Right-click to change direction between read and write.Chapter 4 NI-XNET API for LabVIEW — XNET Device Property Node XNET Device Property Node Format Description Property node used to read/write properties for an XNET Device I/O Name. For more information about LabVIEW property nodes. Pull down this node to add properties. Form Factor Data Type Direction Read Only Required? Default No N/A Property Class XNET Device Short Name FormFac Description Returns the XNET board physical form factor. open the main LabVIEW help (select Search the LabVIEW Help from the Help menu) and look for the Property Nodes topic in the index. control. or indicator. open the LabVIEW context help window (<Ctrl-H>) and move your cursor over the property name.

the XNET Interface I/O name displays the interface string name. Identification in Measurement & Automation Explorer (MAX). XNET Interface Details The XNET Interface I/O Name represents a physical communication port on an XNET device. An XNET device may have one or more XNET Interface I/O names. depending on the number of physical connectors the board has. This string is used for: • • XNET String to IO Name. You can pass the XNET Interface I/O name to the XNET Interface Property Node to retrieve hardware information about the interface. Displayed on the front panel. © National Instruments Corporation 4-371 NI-XNET Hardware and Software Manual .Chapter 4 NI-XNET API for LabVIEW — XNET Device Property Node Interfaces Data Type Direction Read Only Required? Default No N/A Property Class XNET Device Short Name Intfs Description Returns an array of XNET Interface I/O names associated with this physical hardware device. This XNET interface is the same I/O name used to create the session.vi to retrieve the XNET Interface I/O name.

Remarks For example. Product Name Data Type Direction Read Only Required? Default No N/A Property Class XNET Device Short Name ProductName Description Returns the XNET device product name. Remarks For example. returns NI PCI-8517 (2 ports) for an NI PCI-8517 device. returns 2 for an NI PCI-8517 two-port FlexRay device. NI-XNET Hardware and Software Manual 4-372 ni.com .Chapter 4 NI-XNET API for LabVIEW — XNET Device Property Node Number of Ports Data Type Direction Read Only Required? Default No N/A Property Class XNET Device Short Name NumPorts Description Returns the number of physical port connectors on the XNET board.

Remarks For example.Chapter 4 NI-XNET API for LabVIEW — XNET Device Property Node Product Number Data Type Direction Read Only Required? Default No N/A Property Class XNET Device Short Name ProductNum Description Returns the numeric portion of the XNET device product name. Remarks The serial number is written in HEX on a label on the physical XNET board. © National Instruments Corporation 4-373 NI-XNET Hardware and Software Manual . Serial Number Data Type Direction Read Only Required? Default No N/A Property Class XNET Device Short Name SerNum Description Returns the serial number associated with the XNET device. Convert the return value from this property to HEX to match the label. returns 8517 for an NI PCI-8517 two-port FlexRay device.

Chapter 4 NI-XNET API for LabVIEW — XNET Interface Property Node XNET Interface Property Node Format Description Property node used to read/write properties for an XNET Interface I/O Name.com . open the main LabVIEW help (select Search the LabVIEW Help from the Help menu) and look for the Property Nodes topic in the index. Pull down this node to add properties. Right-click each property name to create a constant. open the LabVIEW context help window (<Ctrl-H>) and move your cursor over the property name. Right-click to change direction between read and write. control. For help on a specific property. For more information about LabVIEW property nodes. NI-XNET Hardware and Software Manual 4-374 ni. or indicator.

TermCap Description Returns an enumeration indicating whether the XNET interface can terminate the CAN bus. To prevent reflections.Chapter 4 NI-XNET API for LabVIEW — XNET Interface Property Node CAN. © National Instruments Corporation 4-375 NI-XNET Hardware and Software Manual . Enumeration No Yes Value 0 1 Remarks Signal reflections on the CAN bus can cause communication failure. termination can be present as external resistance or resistance the XNET board applies internally. refer to Interface:CAN:Termination. This enumeration determines whether the XNET board can add termination to the bus.Termination Capability Data Type Direction Read Only Required? Default No N/A Property Class XNET Interface Short Name CAN. To select the CAN transceiver termination.

Chapter 4 NI-XNET API for LabVIEW — XNET Interface Property Node CAN. and Single Wire (SW).TcvrCap Description Returns an enumeration indicating the CAN bus physical transceiver support. Low-Speed (LS).com . Enumeration High-Speed (HS) Low-Speed (LS) XS (HS or LS or SW) Value 0 1 2 Remarks The XS value in the enumeration indicates the board has the physical transceivers for High-Speed (HS). This value is switchable through the Interface:CAN:Transceiver Type property. NI-XNET Hardware and Software Manual 4-376 ni.Transceiver Capability Data Type Direction Read Only Required? Default No N/A Property Class XNET Interface Short Name CAN.

Identification in MAX. Remarks This string is used for: • • XNET String to IO Name. Name Data Type Direction Read Only Required? Default No N/A Property Class XNET Interface Short Name Name Description Returns the string name assigned to the XNET Interface I/O name. © National Instruments Corporation 4-377 NI-XNET Hardware and Software Manual . to retrieve the XNET Interface I/O name. Remarks The XNET device I/O name returned is the physical XNET board that contains the XNET interface.vi.Chapter 4 NI-XNET API for LabVIEW — XNET Interface Property Node Device Data Type Direction Read Only Required? Default No N/A Property Class XNET Interface Short Name Device Description From the XNET Interface I/O Name. This property determines the physical XNET device through the XNET Device Serial Number property for a given XNET Interface I/O name. this property returns the XNET device I/O name.

Remarks The XNET driver assigns each port connector in the system a unique number XNET driver. For example: XNET Interface String Name CAN1 FlexRay3 Number 1 3 NI-XNET Hardware and Software Manual 4-378 ni.com . is the XNET Interface I/O Name string name.Chapter 4 NI-XNET API for LabVIEW — XNET Interface Property Node Number Data Type Direction Read Only Required? Default No N/A Property Class XNET Interface Short Name Number Description Returns unique number associated with the XNET interface. This number. plus its protocol name.

© National Instruments Corporation 4-379 NI-XNET Hardware and Software Manual . to associate an XNET interface with a physical (XNET board and port) combination.Chapter 4 NI-XNET API for LabVIEW — XNET Interface Property Node Port Number Data Type Direction Read Only Required? Default No N/A Property Class XNET Interface Short Name PortNum Description Returns the physical port number printed near the connector on the XNET device. along with the the XNET Device Serial Number property. Use this property. Remarks The port numbers on an XNET board are physically identified with numbering.vi. Note It is easier to find the physical location of an XNET Interface with XNET Blink.

Enumeration CAN FlexRay Value 0 1 Remarks The protocol enumeration matches the protocol part of the XNET Interface string name.Chapter 4 NI-XNET API for LabVIEW — XNET Interface Property Node Protocol Data Type Direction Read Only Required? Default No N/A Property Class XNET Interface Short Name Protocol Description Returns a protocol supported by the XNET Interface I/O Name as an enumeration. String Name CAN1 FlexRay3 Protocol Enumeration 0 1 NI-XNET Hardware and Software Manual 4-380 ni.com .

so there is no need to call the XNET Blink VI repetitively. Format Inputs interface in is the XNET Interface I/O name. For a complete description. error in is the error cluster input (refer to Error Handling). If you assign the interface to Port 1.Chapter 4 NI-XNET API for LabVIEW — XNET Interface Constant XNET Interface Constant This constant provides the constant form of the XNET Interface I/O name. The blinking rate is approximately three times per second. You drag a constant to the block diagram of your VI. Both LEDs of the interface’s physical port turn on and off. You can change constants only during configuration. Both LEDs blink green (not red). then select an interface. The hardware blinks the LEDs automatically until you disable. Enable blinking for identification. LEDs 1 and 2 blink. modifier controls LED blinking: Disable (0) Enable (1) Disable blinking for identification. LEDs 3 and 4 blink.vi Purpose Blinks LEDs for the XNET interface to identify its physical port in the system. prior to running the VI. refer to XNET Interface I/O Name. © National Instruments Corporation 4-381 NI-XNET Hardware and Software Manual . XNET Blink. If you assign the interface to Port 2. This option turns off both LEDs for the port.

the LEDs for that physical port transition to the In Use state. When your application uses multiple XNET devices. to identify it among the six CAN ports. In Use: LED behavior that XNET sessions control. Description Each XNET device contains one or two physical ports. that LED behavior no longer applies. NI-XNET Hardware and Software Manual 4-382 ni. the two interface port LEDs behave as follows: • • Activity LED: Blinks green when communication is progressing.com . error out is the error cluster output (refer to Error Handling). LED 3 is the In Use LED. If you called the XNET Blink VI previously to enable blinking for identification. The XNET device also provides four LEDs. If you call this VI while one or more XNET sessions for the interface are open (created). In Use LED: Solid green. you can use this VI to blink the LEDs for interface CAN4. LED 1 is the In Use LED. Each port is labeled on the hardware as Port 1 or Port 2. provided for use with subsequent VIs. and LED 2 is the Activity LED. and LEDs 3 and 4 are assigned to physical Port 2. this VI helps to identify each interface to associate its software behavior (LabVIEW code) to its hardware connection (port). each with two ports. In Use LED State When you create an XNET session for the interface. off otherwise. because the port’s LEDs are in the In Use state. if you have a system with three PCI CAN cards.Chapter 4 NI-XNET API for LabVIEW — XNET Blink. LEDs 1 and 2 are assigned to Port 1. and LED 4 is the Activity LED. For Port 1. Identification LED State You can use the XNET Blink VI only in the Identification state. The In Use LED state remains until all XNET sessions are cleared. This typically occurs when all LabVIEW VIs are no longer running. Prior to running your XNET sessions. The LEDs of each port support two states: • • Identification: Blink LEDs to identify the physical port assigned to the interface. For Port 2. For the In Use LED state. it returns an error.vi Outputs interface out is the same as interface in. to indicate a session is in use. For example. you can call this VI to blink the interface LEDs.

For CAN. the Activity LED blinks when any frame is received or transmitted. then pulse on. © National Instruments Corporation 4-383 NI-XNET Hardware and Software Manual . The entire cycle of three blinks take approximately one second. While the FlexRay interface is communicating. frames in static slots are continuously received/transmitted. For FlexRay.vi The Activity LED blinks in a pattern of three cycles: on long time.Chapter 4 NI-XNET API for LabVIEW — XNET Blink. then pulse on again. the Activity LED blinks as long as the interface state is running (communicating).

XNET String to IO Name (Cluster). Description This polymorphic VI converts a LabVIEW string to an XNET I/O name. The following instances are for the various XNET I/O name classes: XNET String to IO Name (Session). NI-XNET Hardware and Software Manual 4-384 ni.6. XNET String to IO Name (ECU).vi: Converts a string to an XNET subframe.vi Purpose Converts a LabVIEW string to an XNET I/O Name. XNET String to IO Name (Database Filepath). XNET String to IO Name (Interface). XNET String to IO Name (Database Alias).vi: Converts a string to an XNET interface.vi: Converts a string to an XNET database using the alias syntax. XNET String to IO Name (Frame). refer to the documentation for each VI instance).vi: Converts a string to an XNET session. to wire a string to a property node for the XNET I/O name. This VI is not required for other use cases (for more information. XNET String to IO Name (Signal).vi: Converts a string to an XNET signal. This VI is required for LabVIEW 8.vi: Converts a string to an XNET frame.5 and 8.vi: convert filepath to an XNET database using the filepath syntax.Chapter 4 NI-XNET API for LabVIEW — XNET String to IO Name.vi: Converts a string to an XNET ECU.vi: Converts a string to an XNET cluster. XNET String to IO Name (Subframe).vi XNET String to IO Name.com .

Chapter 4 NI-XNET API for LabVIEW — XNET String to IO Name. then change the poly instance to Cluster. Description For some applications.6 You must call this VI before wiring the string to its corresponding XNET property node. drop XNET String to IO Name. it is useful to store the names of XNET objects as strings. © National Instruments Corporation 4-385 NI-XNET Hardware and Software Manual . LabVIEW performs the conversion automatically. To use this VI.vi to the block diagram. and LabVIEW casts automatically. you cannot wire a string to a property node for the XNET I/O name. you can wire a string to the interface input of XNET Create Session. the following string conversions are performed automatically: • • XNET I/O name to string: You always can wire an XNET I/O name for use as a string.5 and 8. Outputs XNET Cluster is the XNET cluster I/O name.vi XNET String to IO Name (Cluster).vi. If you wire the string to an XNET property node.6. This VI converts the string to the required XNET I/O name class. LabVIEW 8.5 and 8. Format Inputs string is the LabVIEW string to convert. if you use a LabVIEW tree control to select frames and signals. the tree stores names as strings. String to IO Name input of an XNET VI: For example. In LabVIEW 8. LabVIEW 2009 or Later This VI is not required for these versions of LabVIEW. which uses the XNET Interface type. In all versions of LabVIEW. For example.vi Purpose Converts a LabVIEW string to an XNET Cluster I/O Name.

5 and 8.vi XNET String to IO Name (Database Alias). it is useful to store the names of XNET objects as strings. you can wire a string to the interface input of XNET Create Session. In all versions of LabVIEW. Outputs XNET Database is the XNET database I/O name. and LabVIEW casts automatically.vi to the block diagram.vi Purpose Converts a LabVIEW string to an XNET Database I/O Name using the <alias> syntax. which uses the XNET Interface type. For example. you cannot wire a string to a property node for the XNET I/O name.6. LabVIEW performs the conversion automatically.com .6 You must call this VI before wiring the string to its corresponding XNET property node. NI-XNET Hardware and Software Manual 4-386 ni. To use this VI. Format Inputs string is the LabVIEW string to convert. If you wire the string to an XNET property node. LabVIEW 8. drop XNET String to IO Name. The string syntax must use the <alias> syntax as specified in XNET Database I/O Name. This VI converts the string to the required XNET I/O name class. LabVIEW 2009 or Later This VI is not required for these versions of LabVIEW. String to IO Name input of an XNET VI: For example. Description For some applications.vi.Chapter 4 NI-XNET API for LabVIEW — XNET String to IO Name. then change the poly instance to Database Alias. In LabVIEW 8. if you use a LabVIEW tree control to select frames and signals. the tree stores names as strings. the following string conversions are performed automatically: • • XNET I/O name to string: You always can wire an XNET I/O name for use as a string.5 and 8.

to convert a LabVIEW filepath into the corresponding XNET database. Outputs XNET Database is the XNET database I/O name.5 and 8.6 for some applications.Chapter 4 NI-XNET API for LabVIEW — XNET String to IO Name. as specified in XNET Database I/O Name.vi. To use this VI. The LabVIEW filepath data type uses the <filepath> syntax. LabVIEW performs the conversion from string to XNET database automatically. Description NI-XNET supports use of a filepath as an XNET database I/O name. Use the LabVIEW String To Path VI to convert the filepath to its string form. such as XNET Database Open (Database). then change the poly instance to Database Filepath.vi to the block diagram. without the need to add an alias.vi Purpose Converts a LabVIEW filepath to an XNET Database I/O Name using the <filepath> syntax. © National Instruments Corporation 4-387 NI-XNET Hardware and Software Manual . then wire the string to the NI-XNET VI or property node.5 and 8.vi XNET String to IO Name (Database Filepath). LabVIEW 2009 or Later This VI is not required for these versions of LabVIEW. This input uses the LabVIEW filepath data type.6 You must call this VI to wire the filepath to an NI-XNET VI that uses XNET Database as an input. drop XNET String to IO Name. This XNET database <filepath> syntax is compatible with the LabVIEW filepath data type syntax. Format Inputs filepath is the LabVIEW filepath to convert. LabVIEW 8. This VI is required on LabVIEW 8.

which uses the XNET Interface type. LabVIEW performs the conversion automatically.com . This VI converts the string to the required XNET I/O name class.Chapter 4 NI-XNET API for LabVIEW — XNET String to IO Name. then change the poly instance to ECU.6 You must call this VI before wiring the string to its corresponding XNET property node. To use this VI. LabVIEW 2009 or Later This VI is not required for these versions of LabVIEW.5 and 8.6. LabVIEW 8. if you use a LabVIEW tree control to select frames and signals. Format Inputs string is the LabVIEW string to convert. String to IO Name input of an XNET VI: For example.vi Purpose Converts a LabVIEW string to an XNET ECU I/O Name. it is useful to store the names of XNET objects as strings. NI-XNET Hardware and Software Manual 4-388 ni. If you wire the string to an XNET property node. drop XNET String to IO Name. For example.vi XNET String to IO Name (ECU).vi to the block diagram. the tree stores names as strings. Description For some applications.5 and 8. you can wire a string to the interface input of XNET Create Session. and LabVIEW casts automatically. the following string conversions are performed automatically: • • XNET I/O name to string: You always can wire an XNET I/O name for use as a string.vi. In LabVIEW 8. you cannot wire a string to a property node for the XNET I/O name. Outputs XNET ECU is the XNET ECU I/O name. In all versions of LabVIEW.

LabVIEW 8. LabVIEW 2009 or Later This VI is not required for these versions of LabVIEW. String to IO Name input of an XNET VI: For example. To use this VI. For example. In LabVIEW 8.vi XNET String to IO Name (Frame). If you wire the string to an XNET property node. if you use a LabVIEW tree control to select frames and signals.vi to the block diagram. you cannot wire a string to a property node for the XNET I/O name. Outputs XNET Frame is the XNET frame I/O name.Chapter 4 NI-XNET API for LabVIEW — XNET String to IO Name. LabVIEW performs the conversion automatically. it is useful to store the names of XNET objects as strings. drop XNET String to IO Name.6 You must call this VI before wiring the string to its corresponding XNET property node.6.vi Purpose Converts a LabVIEW string to an XNET Frame I/O Name. and LabVIEW casts automatically. the following string conversions are performed automatically: • • XNET I/O name to string: You always can wire an XNET I/O name for use as a string. you can wire a string to the interface input of XNET Create Session. Description For some applications. then change the poly instance to Frame.vi. the tree stores names as strings. which uses the XNET Interface type. This VI converts the string to the required XNET I/O name class. In all versions of LabVIEW.5 and 8. Format Inputs string is the LabVIEW string to convert.5 and 8. © National Instruments Corporation 4-389 NI-XNET Hardware and Software Manual .

drop XNET String to IO Name. then change the poly instance to Interface. In all versions of LabVIEW. and LabVIEW casts automatically.vi to the block diagram.6. if you use a LabVIEW tree control to select frames and signals.5 and 8. the following string conversions are performed automatically: • • XNET I/O name to string: You always can wire an XNET I/O name for use as a string.6 You must call this VI before wiring the string to its corresponding XNET property node. This VI converts the string to the required XNET I/O name class. it is useful to store the names of XNET objects as strings. Outputs XNET Interface is the XNET interface I/O name. For example.vi XNET String to IO Name (Interface). Format Inputs string is the LabVIEW string to convert. the tree stores names as strings. To use this VI. you can wire a string to the interface input of XNET Create Session. In LabVIEW 8.5 and 8.com . String to IO Name input of an XNET VI: For example. NI-XNET Hardware and Software Manual 4-390 ni. you cannot wire a string to a property node for the XNET I/O name.Chapter 4 NI-XNET API for LabVIEW — XNET String to IO Name. LabVIEW performs the conversion automatically. which uses the XNET Interface type. Description For some applications. LabVIEW 8.vi.vi Purpose Converts a LabVIEW string to an XNET Interface I/O Name. LabVIEW 2009 or Later This VI is not required for these versions of LabVIEW. If you wire the string to an XNET property node.

LabVIEW performs the conversion automatically. if you use a LabVIEW tree control to select frames and signals.6. To use this VI. the following string conversions are performed automatically: • • XNET I/O name to string: You always can wire an XNET I/O name for use as a string. it is useful to store the names of XNET objects as strings. If you wire the string to an XNET property node.6 You must call this VI before wiring the string to its corresponding XNET property node.vi to the block diagram. LabVIEW 8. you cannot wire a string to a property node for the XNET I/O name. Outputs XNET Session is the XNET session I/O name.5 and 8.5 and 8. the tree stores names as strings. Description For some applications.vi. then change the poly instance to Session. LabVIEW 2009 or Later This VI is not required for these versions of LabVIEW. In LabVIEW 8. © National Instruments Corporation 4-391 NI-XNET Hardware and Software Manual . which uses the XNET Interface type. This VI converts the string to the required XNET I/O name class. Format Inputs string is the LabVIEW string to convert.vi Purpose Converts a LabVIEW string to an XNET Session I/O Name.vi XNET String to IO Name (Session). and LabVIEW casts automatically. you can wire a string to the interface input of XNET Create Session. drop XNET String to IO Name. In all versions of LabVIEW. For example. String to IO Name input of an XNET VI: For example.Chapter 4 NI-XNET API for LabVIEW — XNET String to IO Name.

For example. the following string conversions are performed automatically: • • XNET I/O name to string: You always can wire an XNET I/O name for use as a string. In all versions of LabVIEW.vi.com . LabVIEW performs the conversion automatically. you cannot wire a string to a property node for the XNET I/O name.vi to the block diagram. String to IO Name input of an XNET VI: For example. it is useful to store the names of XNET objects as strings. To use this VI. This VI converts the string to the required XNET I/O name class.5 and 8. LabVIEW 8. if you use a LabVIEW tree control to select frames and signals. LabVIEW 2009 or Later This VI is not required for these versions of LabVIEW.vi Purpose Converts a LabVIEW string to an XNET Signal I/O Name. then change the poly instance to Signal. NI-XNET Hardware and Software Manual 4-392 ni. Description For some applications.Chapter 4 NI-XNET API for LabVIEW — XNET String to IO Name.5 and 8. If you wire the string to an XNET property node. drop XNET String to IO Name. Outputs XNET Signal is the XNET signal I/O name. the tree stores names as strings.6. Format Inputs string is the LabVIEW string to convert. you can wire a string to the interface input of XNET Create Session.vi XNET String to IO Name (Signal).6 You must call this VI before wiring the string to its corresponding XNET property node. In LabVIEW 8. which uses the XNET Interface type. and LabVIEW casts automatically.

then change the poly instance to Subframe. LabVIEW 8. Description For some applications. To use this VI.vi. the tree stores names as strings. and LabVIEW casts automatically. This VI converts the string to the required XNET I/O name class. For example. if you use a LabVIEW tree control to select frames and signals. Format Inputs string is the LabVIEW string to convert.5 and 8. you can wire a string to the interface input of XNET Create Session. it is useful to store the names of XNET objects as strings.vi XNET String to IO Name (Subframe).Chapter 4 NI-XNET API for LabVIEW — XNET String to IO Name.6 You must call this VI before wiring the string to its corresponding XNET property node.vi to the block diagram.5 and 8. Outputs XNET Subframe is the XNET subframe I/O name.vi Purpose Converts a LabVIEW string to an XNET Subframe I/O Name. In LabVIEW 8. String to IO Name input of an XNET VI: For example. LabVIEW 2009 or Later This VI is not required for these versions of LabVIEW. you cannot wire a string to a property node for the XNET I/O name. If you wire the string to an XNET property node. In all versions of LabVIEW. the following string conversions are performed automatically: • • XNET I/O name to string: You always can wire an XNET I/O name for use as a string. © National Instruments Corporation 4-393 NI-XNET Hardware and Software Manual .6. drop XNET String to IO Name. LabVIEW performs the conversion automatically. which uses the XNET Interface type.

so that the user of the VI can select a name. This applies when the VI always is running for the end user. XNET ECU Control This control provides the control form of the XNET ECU I/O name. You drag a control to the front panel of your VI. Database Controls XNET Database Control This control provides the control form of the XNET Database I/O name. so that the user of the VI can select a name. Typically. refer to XNET Cluster I/O Name. refer to XNET Session I/O Name. followed by calls to XNET Read.com . For a complete description.Chapter 4 NI-XNET API for LabVIEW — Controls Palette Controls Palette This palette provides front panel controls for NI-XNET. You drag a control to the front panel of your VI. For a complete description. prior to running a VI. refer to XNET ECU I/O Name. and the VI uses distinct stages for configuration and I/O. so that the user of the VI can select a name. in which XNET Create Session. Using the previous example. the user clicks a Go button to proceed to the I/O stage. refer to XNET Database I/O Name.vi. Next. NI-XNET Hardware and Software Manual 4-394 ni.vi are called.vi and XNET Read.vi to read and display data for the selected signals. you can use XNET Signal I/O Name controls to select signals to read. For example. you use I/O name controls to select a name during configuration. you also can use I/O name controls to select a name at run time. the selected signals are passed to XNET Create Session. and the name is used at run time. so that the user of the VI can select a name. You drag a control to the front panel of your VI. For a complete description. For a complete description. XNET Cluster Control This control provides the control form of the XNET Cluster I/O name. You drag a control to the front panel of your VI. As an alternative. XNET Session Control This control provides the control form of the XNET Session I/O name. You drag a control to the front panel of your VI. When the user runs the VI. the user clicks XNET Signal I/O Name controls to select signals during the configuration stage.

You typically distribute the executable to multiple end users. You drag a control to the front panel of your VI. refer to Using LabVIEW Real-Time. refer to XNET Frame I/O Name. refer to XNET Interface I/O Name. refer to XNET Terminal I/O Name. Overall Creating a Built Application NI-XNET supports creation of a built application using a LabVIEW project. which means you copy to multiple computers (targets). so that the user of the VI can select a name. XNET Signal Control This control provides the control form of the XNET Signal I/O name. For information about creating a built application for LabVIEW RT.exe). the built application is an executable (. System Controls XNET Interface Control This control provides the control form of the XNET Interface I/O name. For a complete description.Chapter 4 NI-XNET API for LabVIEW — System Controls XNET Frame Control This control provides the control form of the XNET Frame I/O name. XNET Terminal Control This control provides the control form of the XNET Terminal I/O name. so that the user of the VI can select a name. so that the user of the VI can select a name. © National Instruments Corporation 4-395 NI-XNET Hardware and Software Manual . For a complete description. For a Windows target (My Computer). refer to XNET Signal I/O Name. You drag a control to the front panel of your VI. the built application typically is used as a startup application. This section describes creating a built application for Windows that uses NI-XNET. You drag a control to the front panel of your VI. For a complete description. For a complete description. For a LabVIEW Real-Time (RT) target. Additional Topics This section includes additional CAN and FlexRay-related information. so that the user of the VI can select a name. You drag a control to the front panel of your VI.

The term fault refers to a problem that occurs asynchronously to execution of an NI-XNET node. then select New»Application (EXE). If your application accesses a database file using an alias.exe).exe. LabVIEW uses error clusters to pass error information through each VI. Sessions If you created NI-XNET sessions under My Computer. Copy this text file along with the . If you create sessions at run time using XNET Create Session. You can use this VI as part of an installation process or call it within the executable itself. Error Handling In NI-XNET. your application can check for the required file at a likely filepath and add the alias if found. this implies that every computer that runs the executable must use the same file system layout. For example. Databases If your application uses the in-memory database (:memory:). you must add the alias using XNET Database Add Alias. you must ensure that the file exists at the same filepath on every computer. You must include this text file as part of your distribution. the configuration for those sessions is generated to the following text file: nixnetSession.vi. For example.txt This text file is in the same folder as the executable (. For more information about faults. If your application accesses a database file using a filepath (not alias). Because LabVIEW uses absolute filepaths (for example.dbc). or otherwise pop up a dialog for the end user to browse to the correct filepath (then add an alias). the term error refers to a problem that occurs within the execution of a node in the block diagram (VI or property node). Using an alias provides more flexibility than a filepath.vi is an error. but a communication problem on the network is a fault. For more information about the in-memory database.com . always to the same folder. refer to Fault Handling.vi. those sessions are standalone (no text file required). NI-XNET Hardware and Software Manual 4-396 ni. refer to the Create in Memory section of Database Programming. an invalid parameter to XNET Read. c:\MyDatabases\Database5.Chapter 4 NI-XNET API for LabVIEW — Additional Topics Create the executable by right-clicking Build Specifications under My Computer. that database is standalone (no file or alias required).

A value of 0 means success. The term fault refers to a problem that occurs asynchronously to execution of an NI-XNET node.vi and XNET Database Close. even when error in indicates an error. code is a number that identifies the error or warning. A positive value means warning: The VI performed the intended operation. with a default value of no error (status false and code 0). These problems are reflected in the communication state and other information. These VIs always perform the intended operation of closing or otherwise cleaning up. this is reported as a fault.vi. For a description of the code. A negative value means error: The VI did not perform the intended operation. but something occurred that may require your attention.Chapter 4 NI-XNET API for LabVIEW — Additional Topics NI-XNET uses the error in and error out clusters in each VI and property node. The elements of these clusters are: status is true if error occurred or false if success or warning occurred. in some cases the problem cannot be detected until the data is about to be transmitted. The error in cluster is an optional input to a VI. the NI-XNET VI executes and returns the result of its operation to error out. but a communication problem on the network is a fault.vi to obtain the description at runtime. if error in indicates an error. NI-XNET VIs do not execute under error conditions. For most NI-XNET VIs.vi. right-click the error cluster and select Explain Error or Explain Warning. If you pass invalid data to XNET Write. refer to Error Handling. For example. the VI passes the error information to error out and does not perform the intended operation. Fault Handling In NI-XNET.vi returns. the term error refers to a problem that occurs within the execution of a node in the block diagram (VI or property node). • © National Instruments Corporation 4-397 NI-XNET Hardware and Software Manual . In other words. For more information about errors. You also can wire the error cluster to Simple Error Handler. Examples of faults include: • The CAN and FlexRay protocol standards each specify mechanisms to detect communication problems on the network. source Identifies the VI where the error or warning occurred. passing an invalid session to a VI is an error. Because the transmission occurs after XNET Write. The exceptions to this behavior are XNET Clear. If error in indicates success or warning.

The following figure shows an example block diagram for this method.vi executes quickly. To detect a fault and propagate it to an error to break the LabVIEW flow. the block diagram increments a count and restarts the NI-XNET interface. use a diagram similar to the following example. The information returned from these VIs is not limited to faults. Because XNET Read.Chapter 4 NI-XNET API for LabVIEW — Additional Topics NI-XNET reports faults from a special XNET Read. Figure 4-14. Most of the indicators provide state information that the CAN or FlexRay protocol specifies. Each VI provides information about the current state of communication on the network. and for FlexRay this is XNET Read (State FlexRay Comm). and fault code is similar to the code of a LabVIEW error cluster. Each XNET Read.com . Faults specific to NI-XNET are reported in fault? and fault code. the test continues to execute. it often is useful within the primary loop of your application to ascertain the current network state.vi instance for the communication state. fault? is similar to the status of a LabVIEW error cluster. NI-XNET Hardware and Software Manual 4-398 ni. Because the CAN bus off fault was not propagated as an error. Restart on CAN Bus Off State The block diagram detects the CAN bus off state.vi. which means that communication stopped due to numerous problems on the bus. you read and interpret the communication state separately from the LabVIEW error cluster flow. this is XNET Read (State CAN Comm). When CAN bus off state is detected.vi. For example.vi returns a cluster with various indicators. To detect a fault without stopping the execution of your VIs. including faults (communication stopped). For CAN. you may want to intentionally introduce noise into CAN cables to test how your ECU behaves when the CAN bus off state occurs.

the block diagram checks for a fault in the CAN transceiver (physical layer). but can change depending on the multiplexer signal (dynamic) value. The multiplexer signal is at most 8 bits long and contains an unsigned integer number that identifies the subframe instance in the instance of a frame. Propagating CAN Faults to an Error The block diagram in the figure above first checks for CAN bus off state. This means the frame signal content is not fixed (static). © National Instruments Corporation 4-399 NI-XNET Hardware and Software Manual . A frame can contain both a static and a dynamic part. it overwrites the previous error in the standard LabVIEW error cluster. execution of subsequent VIs ceases. effectively stopping the LabVIEW application execution.Chapter 4 NI-XNET API for LabVIEW — Additional Topics Figure 4-15. If a fault or error occurs. which indicates that communication stopped due to a serious problem in the CAN protocol state machine (data link layer). For this reason. Multiplexed Signals Multiplexed signals do not appear in every instance of a frame. the block diagram checks for a fault in NI-XNET. a frame can contain a multiplexer signal and several subframes. If any of these three faults are detected. Finally. they appear only if the frame indicates this. The subframes contain the multiplexed signals. Next.

The Database Editor handles subframe manipulation completely behind the scenes. Only the subframe dynamic signals selected with the multiplexer signal value are written to the frame. Reading Multiplexed Signals You can read multiplexed signals like static signals without any additional effort. Create the multiplexed signals as children of their respective subframes. In the NI-XNET Database Editor You create multiplexed signals simply by changing their Signal Type to Multiplexed and assigning them mode values. Create the multiplexer signal and subframes as children of the frame object. XNET Read (Frame Raw). This automatically assigns the signals as dynamic signals to the subframe’s parent frame. The raw frame format is ideal for log files.com . NI-XNET Hardware and Software Manual 4-400 ni. writing multiplexed signals requires the multiplexer signal be part of the writing session.Chapter 4 NI-XNET API for LabVIEW — Additional Topics Creating Multiplexed Signals In the API Creating multiplexed signals in the API is a two-step process: 1. The subframes are assigned the mode value. the NI-XNET driver can decide which signals are present in the frame and return new values for only those signals. that is. FlexRay does not support them. This is needed for the NI-XNET driver to decide which set of dynamic signals a certain frame contains. the values for the other dynamic signals of that frame are ignored. Refer to the NI-XNET logfile examples for VIs that convert raw frame data to/from LabVIEW clusters for CAN frames or FlexRay frames. 2. As writing signals results in a frame being created and sent over the network. Support for Multiplexed Signals Multiplexed signals are currently supported for CAN only. The raw frame format is for examples that demonstrate access to log files.vi and XNET Write (Frame Raw). the value of the multiplexer signal for which this subframe becomes active. Writing Multiplexed Signals Writing multiplexed signals needs additional consideration. Because the frame read also contains the multiplexer signal.vi use this format. because you can transfer the data between NI-XNET and the file with very little conversion. Raw Frame Format This section describes the raw data format for frames.

January 1 1601 Coordinated Universal Time (UTC). NI-XNET includes a pair of VIs to convert between this U64 timestamp format and the LabVIEW timestamp format. Base Unit In the following table.m. For example. bit 29 (hex 20000000) indicates the CAN identifier format: set for extended. The LabVIEW absolute timestamp data type is different than this U64 timestamp. When Type specifies a FlexRay frame. Each frame is encoded as one Base Unit. refer to the NI-XNET examples for logfile access. the lower 29 bits (0–28) contain the CAN frame identifier. When Type specifies a CAN frame. the lower 16 bits contain the slot number. Byte Offset 0 is the least significant byte. For big-endian computing platforms (for example. This element contains a 32-bit unsigned integer (U32) in native byte order. The timestamp format is absolute. Element Timestamp Byte Offset 0 to 7 Description 64-bit timestamp in 100 ns increments. Byte Offset refers to the offset from the frame start. The 64-bit element contains the number of 100 ns intervals that have elapsed since 12:00 a. Windows). Byte Offset 0 is the most significant byte. If bit 29 is clear. and the second frame is in bytes 24–47. Identifier 8 to 11 The frame identifier. For more information. CompactRIO with a PowerPC). if the first frame is in raw data bytes 0–23. the second frame Identifier starts at byte 32 (24 + Byte Offset 8). This element contains a 64-bit unsigned integer (U64) in native byte order. All unused bits are 0. the lower 11 bits (0–10) contain the CAN frame identifier. followed by zero or more Payload Units. If bit 29 is set. clear for standard. © National Instruments Corporation 4-401 NI-XNET Hardware and Software Manual . For little-endian computing platforms (for example.Chapter 4 NI-XNET API for LabVIEW — Additional Topics The raw frame format consists of one or more frames encoded in a sequence of bytes. The NI-XNET VIs handle all time format and byte order aspects.

refer to XNET Read (Frame FlexRay). For information about the specific CAN Type values. The upper 4 bits of this element specify the protocol: 0 2 CAN FlexRay The lower 4 bits of this element contain the specific type. If set.vi. Flags 13 Eight Boolean flags that qualify the frame type. and Info element interpretation is different for each type. The Identifier. This element is not used for CAN.Chapter 4 NI-XNET API for LabVIEW — Additional Topics Element Type Byte Offset 12 The frame type. Info 14 Information that qualifies the frame Type. For information about the specific FlexRay Type values.vi after NI-XNET transmitted on the network). the frame is echoed (returned from XNET Read. If clear. Flag.vi. refer to XNET Read (Frame CAN). For FlexRay frames: • Bit 0 is set if the frame is a Startup frame • Bit 1 is set if the frame is a Sync frame • Bit 2 specifies the frame Preamble bit • Bit 4 specifies if the frame transfers on Channel A • Bit 5 specifies if the frame transfers on Channel B All unused bits are zero. the frame was received from the network (from a remote ECU). Description This element specifies the fundamental frame type. this element provides the frame cycle count (0–63). Bit 7 (hex 80) is protocol independent (supported in CAN and FlexRay frames).com . For FlexRay frames. NI-XNET Hardware and Software Manual 4-402 ni.

one or more payload units follow the base unit. bytes 0–7 are in the base unit Payload. and no additional payload units exist. Payload 16 to 23 This element always uses 8 bytes in the logfile. PayloadLength of 9 through 16 requires one additional payload unit of 8 bytes. The NI-XNET example code helps you handle the variable-length frame encoding details. only the base unit exists. but PayloadLength determines the number of valid bytes. Because this base unit always contains 8 bytes of payload data. For all CAN frames. If PayloadLength is 0–8. each raw data frame can vary in length. For example. For FlexRay frames. PayloadLength cannot exceed 8. PayloadLength is 0–254 bytes. In other words. to optimize efficiency for DMA transfers. © National Instruments Corporation 4-403 NI-XNET Hardware and Software Manual . Additional payload units are provided in increments of 8 bytes. You can calculate each frame size (in bytes) using the following pseudocode: U16 FrameSize // maximum 272 for largest FlexRay frame FrameSize = 24. // 24 byte base unit if (PayloadLength > 8) FrameSize = FrameSize + (U16)(PayloadLength . If PayloadLength is 9 or greater. the entire CAN frame is contained in the base unit. This adds bytes for additional payload units. and the last 7 bytes of the next payload unit are ignored. The last pseudocode line subtracts 1 and truncates to the nearest multiple of 8 (using bitwise AND).1) AND 0xFFF8. For example. if PayloadLength is 9. byte 8 is in the first byte of the next payload unit.Chapter 4 NI-XNET API for LabVIEW — Additional Topics Element PayloadLength Byte Offset 15 Description The PayloadLength indicates the number of valid data bytes in Payload.

NI-XNET Hardware and Software Manual 4-404 ni. but PayloadLength determines the number of valid bytes. you can specify Baud Rate using either the XNET Cluster Baud Rate property or XNET Session Interface:Baud Rate property. the object properties may be: • • Optional: The property has a default value after creation. The Cluster object class requires the following properties: • • • • 1 Baud Rate1 FlexRay:Action Point Offset FlexRay:CAS Rx Low Max FlexRay:Channels For FlexRay. The following NI-XNET object classes have no required properties: • • • • • • Session System Device Interface Database ECU This section lists all required properties. and properties with the CAN: prefix apply only to the CAN protocol. and the application does not need to set the property when the default value is desired for the session. Properties with the FlexRay: prefix in the property name apply only to the FlexRay protocol. A required property means you must provide a value for the property after you create the object. Element Payload Byte Offset 0 to 7 Description This element always uses 8 bytes in the logfile. Required: The property has no default value after creation. For CAN with other session modes. they apply only to a session with the given protocol. An undefined required property returns an error from XNET Create Session. Baud Rate always is required.com .vi.Chapter 4 NI-XNET API for LabVIEW — Additional Topics Payload Unit The base unit PayloadLength element determines the number of additional payload units (0–31). For CAN. when you use a Frame I/O Stream session. Required Properties When you create a new object in a database. Many properties are protocol specific. the XNET Cluster Baud Rate property is required.

Chapter 4 NI-XNET API for LabVIEW — Additional Topics • • • • • • • • • • • • • • • • • • • • • • • • • FlexRay:Cluster Drift Damping FlexRay:Cold Start Attempts FlexRay:Cycle FlexRay:Dynamic Slot Idle Phase FlexRay:Listen Noise FlexRay:Macro Per Cycle FlexRay:Max Without Clock Correction Fatal FlexRay:Max Without Clock Correction Passive FlexRay:Minislot Action Point Offset FlexRay:Minislot FlexRay:Network Management Vector Length FlexRay:NIT FlexRay:Number of Minislots FlexRay:Number of Static Slots FlexRay:Offset Correction Start FlexRay:Payload Length Static FlexRay:Static Slot FlexRay:Symbol Window FlexRay:Sync Node Max FlexRay:TSS Transmitter FlexRay:Wakeup Symbol Rx Idle FlexRay:Wakeup Symbol Rx Low FlexRay:Wakeup Symbol Rx Window FlexRay:Wakeup Symbol Tx Idle FlexRay:Wakeup Symbol Tx Low The Frame object class requires the following properties: • • • • • FlexRay:Base Cycle FlexRay:Channel Assignment FlexRay:Cycle Repetition Identifier Payload Length © National Instruments Corporation 4-405 NI-XNET Hardware and Software Manual .

For example. you can perform a more specific transition using XNET Start. For a description of each transition.Chapter 4 NI-XNET API for LabVIEW — Additional Topics The Subframe object class requires the following properties: • Multiplexer Value The Signal object class requires the following properties: • • • • Byte Order Data Type Number of Bits Start Bit State Models The following figures show the state model for the NI-XNET session and the associated NI-XNET interface.com . Although most state transitions occur automatically when you call XNET Read.vi and XNET Stop. In other words. Interface Communicating Create Start Session Stopped Started Communicating Clear Set Session Property Stop Session Interface Not Communicating OR Stop Session NI-XNET Hardware and Software Manual 4-406 ni. you can use one session for input on interface CAN1 and a second session for output on interface CAN1. Multiple sessions can share the interface.vi. refer to Session Transitions.vi or XNET Write. the transition is not repeated. and no error is returned.vi. The session controls the transfer of frame values between the interface (network) and the data structures that can be accessed using the API. The interface controls communication on the physical network cluster. the session controls receive or transmit of specific frames for the session. refer to Session States. If you invoke a transition that has already occurred. Session State Model For a description of each state.

then start communication for all sessions together by starting the interface (XNET Start. you cannot change properties of objects in the database.vi with the scope of Session Only. © National Instruments Corporation 4-407 NI-XNET Hardware and Software Manual . refer to Interface States. refer to Interface Transitions. For a description of each transition.Chapter 4 NI-XNET API for LabVIEW — Additional Topics Interface State Model For a description of each state. For most applications. the Started state is transitory in nature. Comm State Communicating Start Interface Stopped Started Communicating Stop Interface Set Interface Property Comm State Not communicating OR Stop Interface Session States Stopped The session initially is created in the Stopped state. While the session is Started. XNET Write. While the session is Stopped. or XNET Start. the session does not transfer frame values to or from the interface.vi.vi using defaults. When you call XNET Read. the session automatically transitions to Communicating without interaction by your application. In the Stopped state. The interface must be communicating for the session to exchange data on the network. the interface is not started. you can change properties specific to this session.vi with scope of Interface Only). the interface is started along with the session. If you call XNET Start. the session is started. You can set any property in the Session Property Node except those in the Interface category (refer to Stopped in Interface States). Started In the Started state. such as frames or signals.vi. You can use this advanced feature to prepare multiple sessions for the interface. Once the interface is Communicating. The properties of these objects are committed when the session is created. but is waiting for the associated interface to be started also.

com .vi method: This clears the session explicitly. When using the LabVIEW development environment. When you run a VI that uses the session with an XNET node (property node or VI). Frame or signal values are transmitted for an output session. and then all its resources are removed. cluster. Frame or signal values are received for an input session.vi in sequence prior to the first use of XNET Read.vi or XNET Write. the session is created. XNET Clear. and frame properties are committed to the interface. you may need to call XNET Clear. LabVIEW project method: Although you specify the session properties in the LabVIEW project user interface. For this configuration to succeed. In addition. NI-XNET automatically clears all sessions that application uses. the database. the first call to XNET Read. To change the properties of database objects that a session uses. Session Transitions Create When the session is created. To ensure that all sessions for the interface are created prior to start. the session is created.vi method: When your application calls XNET Create Session.vi or XNET Write. it is stopped (no longer communicates).vi or XNET Write. There is one exception: You can create a Frame Stream Input session while the interface is communicating.vi. the session is not created at that time. There are two ways to clear a session: • Application stop method: The typical way to clear a session is to do nothing explicit in your application. This ensures that all project-based sessions your application uses are created before the interface starts (for example. • Clear When the session is cleared. including when you select the LabVIEW abort button in that VI’s toolbar. the application stops when the executable exits.vi to change those properties. then recreate the session.vi. There are two ways to create a session: • XNET Create Session. all other sessions in the LabVIEW project that use the same interface and cluster (database) are created at that time. the application stops when the top-level VI goes idle.vi (for example. • NI-XNET Hardware and Software Manual 4-408 ni.Chapter 4 NI-XNET API for LabVIEW — Additional Topics Communicating In the Communicating state. you typically wire all calls to XNET Create Session. the session is communicating on the network with remote ECUs. When using an application built using a LabVIEW project. prior to the main loop). the interface must be in the Stopped state.vi). Your application accesses these values using XNET Read. When the application stops execution.

Interface Not Communicating This transition occurs when the session interface exits the Communicating state.vi or XNET Stop. Stop Session You can stop the session by calling XNET Clear. the property help states this. or both (normal scope). You can set any property in the XNET Session Property Node except those in the Interface category (refer to Stopped in Interface States).vi or XNET Write. To flush the queues of a session. allowing you to stop the session. you can call XNET Start. you still can call XNET Read.vi.vi. You also can use XNET Start. © National Instruments Corporation 4-409 NI-XNET Hardware and Software Manual .vi performs an automatic Start of scope Normal. if you leave the Auto Start? property at its default value of true. if an input session receives frames.vi with scope of Session Only (this Start Session transition) or Interface Only (the interface Start Interface transition). To start the session prior to calling XNET Read. If there is an exception for a specific property. The XNET Start. For an output session.vi).vi. which starts the session and interface.vi.vi provides the same scope as XNET Start. To read received frames. The session also exits its Communicating state when the session stops due to XNET Clear.vi. You cannot set properties of a session in the Started or Communicating state. the underlying queues are not flushed.vi.vi to read the frame values from the queues.Chapter 4 NI-XNET API for LabVIEW — Additional Topics Set Session Property While the session is Stopped. The auto-start feature of XNET Write. Interface Communicating This transition occurs when the session interface enters the Communicating state. When the session stops.vi performs a Start of scope Normal. For example. XNET Read.vi or XNET Stop. you can start the session simply by calling XNET Read. XNET Stop. you can change properties specific to this session. which starts the session and interface. call XNET Flush.vi.vi (or XNET Clear. Start Session For an input session. then you call XNET Stop.vi default scope is Normal. interface. which starts the session and interface.vi. you can start the session simply by calling XNET Write.

which can take as long as hundreds of milliseconds. This state is transitory in nature. the interface is communicating on the network. NI-XNET Hardware and Software Manual 4-410 ni. For CAN. so the transition is effectively from Stopped to Communicating. then get that same property using a second session. the returned value reflects the change. Started In the Started state. When more than one session exists for a given interface. integration with the network occurs in a few bit times. because it represents the communication controller of the NI-XNET hardware product port. integration with the network entails synchronization with global FlexRay time. the interface properties are restored to defaults.Chapter 4 NI-XNET API for LabVIEW — Additional Topics Interface States Stopped The interface always exists. Properties that you change in the interface are not saved from one execution of your application to another. but it is waiting for the associated communication controller to complete its integration with the network. For example.com . The NI-XNET interface initially powers on in the Stopped state. Communicating In the Communicating state. In the Stopped state. the interface does not communicate on its port. in that your application does not control transition out of the Started state. refer to Comm State Communicating and Comm State Not Communicating. These properties are contained within the Session Property Node Interface category. For information about how the interface transitions in and out of this state. if you set an interface property using one session. you can change properties specific to the interface. This physical port is wired to a cable that connects to one or more remote ECUs. One or more communicating sessions can use the interface to receive and/or transmit frame values. While the interface is Stopped. For FlexRay. When the last session for an interface is cleared. the Interface category properties provide shared access to the interface configuration. The interface remains in the Communicating state as long as communication is feasible. the interface is started.

If there is an exception for a specific property. which requests the interface and session start. For example. the interface communicates as long as at least one session is in use. If your application calls XNET Stop. In other words.vi. XNET Start. Stop Interface Under normal conditions. In other words. When more than one session exists for a given interface. Every transition requires a new pulse. You cannot set properties of the interface while it is in the Started or Communicating state.vi or XNET Write. if you set an interface property using one session.vi. so if your application stops the interface (for example. because it affects all sessions that use the interface and is not limited to the session passed to XNET Stop. you can change interface-specific properties. These properties are in the Session Property Node Interface category.vi). the actual transition depends on whether you have connected the interface start trigger. XNET Stop.vi with scope of Interface Only. After you request the interface start. the connected source terminal must pulse again.vi. using XNET Stop. you request the interface start. the returned value reflects the change. the interface is stopped when the last session is stopped (or cleared). Start Interface You can request the interface start in two ways: • • XNET Read.vi with a scope of Interface Only stops communication by all sessions simultaneously.vi with a destination of Interface Start Trigger.Chapter 4 NI-XNET API for LabVIEW — Additional Topics Interface Transitions Set Interface Property While the interface is Stopped. then get that same property using a second session. For more information. XNET Write. that immediately transitions the interface to the Stopped state. © National Instruments Corporation 4-411 NI-XNET Hardware and Software Manual . based on the start trigger connection: • • Disconnected (default): Start Interface occurs as soon as it is requested (XNET Read. the Interface category properties provide shared access to the interface configuration. If a significant number of errors occur on the network. The Start Interface transition occurs as follows. Use this feature with care.vi method: The automatic start described for the Start Session transition uses a scope of Normal. or XNET Start. the communication controller may stop the interface on its own. You connect the start trigger by calling the XNET Connect Terminals.vi). then restarts the interface. refer to Comm State Not Communicating.vi method: If you call this VI with scope of Normal or Interface Only. Connected: Start Interface occurs when the connected source terminal pulses. the property help states this.

Config. and NI-XNET is associated with the new NI-XNET CAN/FlexRay hardware.vi. For CAN. For CAN. refer to the NI-CAN Hardware and Software Manual. Because the features of the compatibility library apply to the NI-CAN API and not NI-XNET. Transition If you have an existing application that uses NI-CAN and intend to use only new NI-XNET hardware from now on. If you are starting a new application for CAN or FlexRay. refer to XNET Read (State FlexRay Comm). a compatibility library is provided so that you can reuse that code with a new NI-XNET CAN product. this occurs when communication enters one Normal Active or Normal Passive state. refer to XNET Read (State FlexRay Comm). For more information. this occurs when communication enters Error Active or Error Passive state. Compatibility If you have an existing application that uses NI-CAN.vi.com .Chapter 4 NI-XNET API for LabVIEW — Additional Topics Comm State Communicating This transition occurs when the interface is integrated with the network. it is described in the NI-CAN documentation. refer to XNET Read (State CAN Comm). Generally speaking. For information about the specific CAN interface communication states. you typically use NI-XNET (not NI-CAN). Default Config. NI-XNET Hardware and Software Manual 4-412 ni. refer to XNET Read (State CAN Comm). NI-CAN is associated with the legacy CAN hardware. this occurs when communication enters Bus Off or Idle state. you may want to transition your code to NI-XNET.vi. or Ready state. For information about the specific CAN interface communication states. For information about the specific FlexRay interface communication states. For FlexRay. this occurs when communication enters the Halt. CAN NI-CAN NI-CAN is the legacy application programming interface (API) for National Instruments CAN hardware. For FlexRay.vi. For information about the specific FlexRay interface communication states. Comm State Not Communicating This transition occurs when the interface no longer is integrated with the network.

for better control. This term is used in standards such as CAN and FlexRay. but NI-XNET starts at CAN1 (or FlexRay1).Chapter 4 NI-XNET API for LabVIEW — Additional Topics NI-XNET unifies many concepts of the earlier NI-CAN API. NI-XNET provides a different object for each direction. Table 4-1. including the FIBEX format. © National Instruments Corporation 4-413 NI-XNET Hardware and Software Manual . This term is used in standards such as FIBEX. The term Frame is the industry convention for the bits that transfer on the bus. The term Signal is the industry convention. this section describes how the frame behaves for each XNET session mode. Message Frame Channel Channel API Task Frame API CAN Object (Queue Length Zero) Signal Session (Signal I/O) Session (Frame I/O Single-Point) Frame API CAN Object (Queue Length Nonzero) Frame API Network Interface Object Interface Session (Frame I/O Queued) Session (Frame I/O Stream) Interface CAN Timing Type and Session Mode For each XNET Frame CAN:Timing Type property value. Unlike NI-CAN. for better control. NI-CAN and NI-XNET Terms NI-CAN Term CANdb file NI-XNET Term Database Comment NI-XNET supports more database file formats than the NI-CAN Channel API. that is analogous to NI-XNET Frame I/O Queued. that is analogous to NI-XNET Frame I/O Single-Point. If the NI-CAN queue length for a direction is nonzero. The NI-CAN Network Interface Object provided both input (read) and output (write) in one object. NI-CAN started interface names at CAN0. If the NI-CAN queue length for a direction is zero. NI-XNET provides a different object for each direction. NI-XNET supports simultaneous use of channel (signal) I/O and frame I/O. The NI-CAN CAN Object provided both input (read) and output (write) in one object. but the key features are similar. The following table lists NI-CAN terms and analogous NI-XNET terms.

Signal Input Waveform. When the session and its associated interface are started. Signal Output Single-Point. Frame Input Stream Mode You specify the CAN cluster when you create the session. Signal Output XY.vi is called. a subsequent call to XNET Read. When the CAN data frame is received. it is ignored. and Frame Output Queued Modes You specify the CAN frame (or its signals) when you create the session. but not the specific CAN frame. the next cycle transmits using the previous CAN data frame (repeats the payload). If no new data is available for transmit.vi. When Timing Type is Cyclic Remote or Event Remote. For information about how the data is represented for each mode. The XNET Frame CAN:Transmit Time property defines the time between cycles. and an output session transmits the CAN data frame. Frame Input Single-Point. and an output session receives the CAN remote frame. a subsequent call to XNET Read. NI-XNET Hardware and Software Manual 4-414 ni. Signal Input Single-Point. You use CAN remote frames to request the associated CAN data frame from a remote ECU.vi for the stream returns it. If the CAN remote frame is received. When you write data using XNET Write. an input session transmits the CAN remote frame. the CAN data frame transmits once every cycle.vi. After that first transmit. Signal Output Waveform.vi returns its data. regardless of whether XNET Write. it is ignored (with no effect on XNET Read. The CAN data frame data (payload) is mapped to/from signal values. Frame Output Single-Point.vi). and the CAN data frame transmits. Cyclic Data The data frame transmits in a cyclic (periodic) manner. If you pass the CAN remote frame to XNET Write. the CAN data frame is transmitted onto the network.com . refer to Session Modes.Chapter 4 NI-XNET API for LabVIEW — Additional Topics An input session receives the CAN data frame from the network. When the CAN data frame is received. For information about how the data is represented for each mode. If the CAN remote frame is received. refer to Session Modes. Signal Input XY.vi returns its data. the first cycle occurs. a subsequent call to XNET Read. and Frame Input Queued Modes You specify the CAN frame (or its signals) when you create the session.

Therefore.Chapter 4 NI-XNET API for LabVIEW — Additional Topics Frame Output Stream Mode You specify the CAN cluster when you create the session. but not the specific CAN frame.vi. For output sessions. Cyclic Remote The CAN remote frame transmits in a cyclic (periodic) manner. the CAN data frame does not transmit again until a subsequent call to XNET Write. Frame Input Single-Point. Frame Output Single-Point. the event is XNET Write.vi. followed by the associated CAN data frame as a response.vi have transmitted. © National Instruments Corporation 4-415 NI-XNET Hardware and Software Manual . The XNET Frame CAN:Transmit Time property defines the minimum interval. Signal Input XY.vi. the CAN data frame transmits only when you pass it to XNET Write. it is transmitted onto the network as soon as possible. and Frame Input Queued Modes The behavior is the same as Cyclic Data. Because the stream I/O modes ignore the database-specified timing for all frames. Signal Output Waveform. it is transmitted onto the network as soon as possible. and does not transmit cyclically afterward. Frame Output Stream Mode The behavior is the same as Cyclic Data. Signal Output Single-Point. you can write either CAN data or CAN remote frames. Because the stream I/O modes ignore the database-specified timing for all frames. after the CAN data frames for XNET Write. Signal Input Single-Point.vi. and Frame Output Queued Modes The behavior is the same as Cyclic Data. except that the CAN data frame does not continue to transmit cyclically after the data from XNET Write. If you pass the CAN remote frame to XNET Write. Signal Input Waveform. Because the database-specified timing for the frame is event based. Event Data The data frame transmits in an event-driven manner. When you write the CAN data frame using XNET Write.vi has transmitted. you can read either CAN data or CAN remote frames. Frame Input Stream Mode The behavior is the same as Cyclic Data. The stream I/O modes do not use the database-specified timing for frames. Signal Output XY.vi.

Frame Output Single-Point. the CAN remote frame transmits once every cycle. The CAN remote frame cyclic transmit is independent of the corresponding CAN data frame reception. Signal Output XY. and Frame Input Queued Modes You specify the CAN frame (or its signals) when you create the session. the CAN data frame is transmitted onto the network when the associated CAN remote frame is received (same identifier).vi returns its data. When the CAN data frame is received. Signal Output Waveform. refer to Session Modes. the event is XNET Write.vi. you can read either CAN data or CAN remote frames. After that first transmit. the first cycle occurs. NI-XNET Hardware and Software Manual 4-416 ni. Frame Input Stream Mode The behavior is the same as Cyclic Data. NI-XNET detects the received CAN remote frame.com . a subsequent call to XNET Read. you can write either CAN data or CAN remote frames. When NI-XNET transmits a CAN remote frame. Because the stream I/O modes ignore the database-specified timing for all frames. When you call XNET Write. You do not call XNET Write. This CAN remote frame requests data from the remote ECU. Signal Input XY.vi to read that frame. Signal Input Waveform. but instead waits for the associated CAN remote frame to be received.vi to provide the CAN data frames used for transmit. For input sessions. the CAN data frame does not transmit immediately. and immediately transmits the next CAN data frame. even if no CAN data frame is received. Frame Output Stream Modes The behavior is the same as Cyclic Data. For information about how the data is represented for each mode. Your application uses XNET Write. refer to Session Modes. Event Remote The CAN remote frame transmits in an event-driven manner.vi for the session. and the CAN remote frame transmits. Because the stream I/O modes ignore the database-specified timing for all frames. Frame Input Single-Point.vi. which soon responds with the associated CAN data frame (same identifier). When you write data using XNET Write.Chapter 4 NI-XNET API for LabVIEW — Additional Topics Signal Input Single-Point. Signal Output Single-Point. When the session and its associated interface are started. you do not call XNET Read. Although the session receives the CAN remote frame.vi. For information about how the data is represented for each mode. and Frame Output Queued Modes You specify the CAN frame (or its signals) when you create the session. followed by the associated CAN data frame as a response. it transmits a CAN remote frame again CAN:Transmit Time later.

Chapter 4 NI-XNET API for LabVIEW — Additional Topics Signal Input Single-Point. but the behavior is the same regarding XNET Write. Unlike Cyclic Data.vi.vi to provide the event that triggers the CAN remote frame transmit. The FlexRay data frame data (payload) is mapped to/from signal values. Signal Input XY. Frame Output Single-Point. Because the stream I/O modes ignore the database-specified timing for all frames. When you call XNET Write. the data is ignored. For information about how the data is represented for each mode. When the remote ECU receives the CAN remote frame. This CAN Timing Type and mode combination is somewhat advanced. Each call to XNET Write. © National Instruments Corporation 4-417 NI-XNET Hardware and Software Manual . When the CAN data frame is received. its data is returned from a subsequent call to XNET Read. it responds with a CAN data frame. An input session receives the FlexRay data frame from the network. you can read either CAN data or CAN remote frames. Frame Input Single-Point. in that you must call both XNET Read. Signal Output Single-Point. When you write data using XNET Write.vi transmits only one CAN remote frame. which is received and read using XNET Read. even if you provide multiple signal or frame values. Because the stream I/O modes ignore the database-specified timing for all frames. Signal Output XY.vi. this section describes how the frame behaves for each XNET session mode. Frame Output Stream Mode The behavior is the same as Cyclic Data. the remote ECU sends the associated CAN remote frame in an event-driven manner. the CAN data frame transmits onto the network when the associated CAN remote frame is received (same identifier). refer to Session Modes. and one CAN remote frame transmits as soon as possible. and Frame Output Queued Modes The behavior is the same as Cyclic Remote. you can write either CAN data or CAN remote frames. Frame Input Stream Modes The behavior is the same as Cyclic Data.vi.vi and XNET Write. Signal Input Waveform.vi and the CAN data frame transmit. Signal Output Waveform. You must call XNET Write. and Frame Input Queued Modes You specify the CAN frame (or its signals) when you create the session. and an output session transmits the FlexRay data frame. FlexRay FlexRay Timing Type and Session Mode For each XNET frame FlexRay:Timing Type property value.vi.vi.

or multiple times per cycle (FlexRay:In Cycle Repetitions:Enabled?). Signal Input Waveform. Frame Input Queued and Frame Input Single-Point Modes You specify the FlexRay frame(s) when you create the session. the payload data from the previous transmit is repeated. For NI-XNET input sessions. If a FlexRay null frame is received. NI-XNET Hardware and Software Manual 4-418 ni. the rate can be once per cycle (FlexRay:Cycle Repetition 1).Chapter 4 NI-XNET API for LabVIEW — Additional Topics You use FlexRay null frames in the static segment to indicate that no new payload exists for the frame.vi. Signal Input Single-Point. the Timing Type determines whether to transmit a data frame when no new payload data is available. it is ignored (no effect on XNET Read. Frame Input Stream Mode You specify the FlexRay cluster when you create the session. In the dynamic segment. a subsequent call to XNET Read.vi). a subsequent call to XNET Read. When the FlexRay data frame is received. refer to Session Modes. For information about how the data is represented for each mode. and Signal Input XY Modes You specify the FlexRay signals when you create the session. refer to Session Modes. but not the specific FlexRay frames. it simply does not transmit (no frame). the Timing Type does not directly impact the representation of data from XNET Read. For NI-XNET output sessions. When the FlexRay data frame is received. Cyclic Data The data frame transmits in a cyclic (periodic) manner. FlexRay null frames are not used to map signal values. If the frame is in the dynamic segment. a subsequent call to XNET Read. If the frame is in the static segment. once every N cycles (FlexRay:Cycle Repetition N).vi returns it.vi returns its data. If no new payload data is available when it is time to transmit.vi returns its data. If a FlexRay null frame is received. For information about how the data is represented for each mode. and a specific FlexRay data frame contains each signal. if no new payload exists for the frame. it is ignored (not returned).com . the rate is once per cycle. When any FlexRay data frame is received.

vi). When you write data using XNET Write. Frame Output Single-Point. If the frame is contained in the static segment.vi. Frame Output Stream Mode This session mode is not supported for FlexRay. no frame transmits. If you pass the FlexRay null frame to XNET Write. After that first transmit.vi is called. the interval is once per cycle.vi for the stream returns them. If no new event (payload data) is available when it is time to transmit. it is ignored. When the session and its associated interface are started. the FlexRay data frame transmits according to its rate.vi. FlexRay null frames are ignored (not returned). regardless of whether XNET Write. If Null Frames To Input Stream? is false (default).vi. the FlexRay data frame is transmitted onto the network. a FlexRay data frame transmits at all times. If no new data is available for transmit. a FlexRay data frame transmits every cycle. the interval can be once per cycle (FlexRay:Cycle Repetition 1). In the static segment. The FlexRay null frame is not transmitted. Signal Output Waveform. the next cycle transmits using the previous FlexRay data frame (repeats the payload). © National Instruments Corporation 4-419 NI-XNET Hardware and Software Manual . the FlexRay data frame transmits according to its rate. refer to Session Modes. The event is XNET Write. This minimum interval is configured in the same manner as a Cyclic frame. If the frame is in the dynamic segment. If the frame is contained in the dynamic segment. Signal Output XY. Signal Output Single-Point. a subsequent call to XNET Read. the minimum interval between events is specified based on the FlexRay cycle. once every N cycles (FlexRay:Cycle Repetition N). The dynamic frame minislot is always used. You can determine whether each frame value is data or null by evaluating the type element (refer to XNET Read (Frame FlexRay). For information about how the data is represented for each mode. or multiple times per cycle (FlexRay:In Cycle Repetitions:Enabled?). Because FlexRay is a time-driven protocol. and Frame Output Queued Modes You specify the FlexRay frame (or its signals) when you create the session.Chapter 4 NI-XNET API for LabVIEW — Additional Topics If the XNET Session Interface:FlexRay:Null Frames To Input Stream? property is true. If the frame is in the static segment. this lack of new data is represented as a null frame. and FlexRay null frames are received. Event Data The data frame transmits in an event-driven manner.

vi.vi. Frame Input Single-Point. the frame does not transmit when no new data is available. This applies when the VI always is running for the end user.vi to read and display data for the selected signals. and the instance is used at run time. and Frame Output Queued Modes The behavior is similar to Cyclic Data. Signal Output XY. the user clicks XNET Signal I/O Name controls to select signals during the configuration stage.vi. Frame Output Single-Point. You can use an I/O name as a: • Control (or indicator): Use an I/O name control to select a specific instance on the front panel. a FlexRay null frame transmits when no new data is available (no new call to XNET Write. prior to running a VI. followed by calls to XNET Read. after the FlexRay data frames for XNET Write. The dynamic frame minislot is used only when new data is provided to XNET Write. the FlexRay data frame does not transmit again until a subsequent call to XNET Write. Typically.vi. you use I/O name controls to select an instance during configuration. you also can use I/O name controls to select an instance at run time. If the frame is contained in the static segment. Signal Output Waveform. Frame Output Stream Mode This session mode is not supported for FlexRay. For example. Because the database-specified timing for the frame is event based. and Frame Input Stream Modes The behavior is the same as Cyclic Data.vi). the user NI-XNET Hardware and Software Manual 4-420 ni. If you pass the FlexRay null frame to XNET Write. As an alternative. If the frame is contained in the dynamic segment. it is ignored. Signal Output Single-Point. Frame Input Queued.Chapter 4 NI-XNET API for LabVIEW — Additional Topics Signal Input Single-Point. and the VI uses distinct stages for configuration and I/O. the selected signals are passed to XNET Create Session. Using the previous example. Signal Input Waveform.vi has transmitted. Next. I/O names provide user interface features for easy configuration. you can use XNET Signal I/O Name controls to select signals to read. XNET I/O Names LabVIEW I/O names (also known as refnum tags) are provided for various object classes within NI-XNET.com . Signal Input XY. When the user runs the VI. except that the FlexRay data frame does not continue to transmit cyclically after the data from XNET Write.vi have transmitted. NI-XNET I/O name controls are in the front panel Modern»I/O»XNET controls palette.

While running in an executable.vi. the string contains the selected instance name.vi and XNET Read. the I/O name drop-down menu is supported. in which XNET Create Session. In LabVIEW 8. Use this string to store the I/O name is a portable form. The I/O name has two simultaneous LabVIEW types: • String: When you wire the I/O name to a LabVIEW string.1 and later. When wiring an XNET String to IO Name. such as to change state (start/stop).1 or earlier. which in turn enables the user interface of NI-XNET I/O names to operate remotely. You can select names from the databases on the RT target and menu items to manage database deployments. • Constant: Use an I/O name constant to select a specific instance on the block diagram. You can access I/O name constants only during configuration. The VIs provide methods for the instance. or access data (read/write). The property node for the I/O name provides access to its configuration. In LabVIEW 8. prior to running the VI. Your application uses XNET sessions to read and write I/O data. such as a text file.0 and earlier.6. I/O Name Classes NI-XNET includes the following I/O name classes: Session Each session represents a connection between your National Instruments CAN/FlexRay hardware and hardware products on the external CAN/FlexRay network. NI-XNET I/O name controls do not operate properly on an executable front panel. you can wire a LabVIEW string directly to an I/O name. If you are using LabVIEW Real-Time (RT). At run time. In LabVIEW 2009 or later. you can right-click the RT target within a LabVIEW Project and select the Connect menu item.vi are called. the string must use the specified syntax for the I/O name class. NI-XNET I/O name constants are in the block diagram Measurement I/O»XNET functions palette. the VIs use I/O names to access features for the selected instance. © National Instruments Corporation 4-421 NI-XNET Hardware and Software Manual .6. the I/O name contains a numeric reference to the instance for use with NI-XNET property nodes and VIs.Chapter 4 NI-XNET API for LabVIEW — Additional Topics clicks a Go button to proceed to the I/O stage. This connects to the RT target over TCP/IP.6. you can build a standalone application (executable) that contains NI-XNET I/O name controls on its front panel.vi to convert a LabVIEW string to an I/O name. you must use XNET String to IO Name. but the right-click menu is not operational. In LabVIEW 8. • Refnum: At run time.

For example. In other words. and one Chassis FlexRay cluster.Chapter 4 NI-XNET API for LabVIEW — Additional Topics The session I/O name is primarily for sessions created during configuration using a LabVIEW project. where the cluster represents a collection of hardware products all connected over a shared cabling harness.xml) for FlexRay. Multiple clusters can contain a single ECU. such as the vehicle. and the third payload byte may represent a pressure. • • • NI-XNET Hardware and Software Manual 4-422 ni. Frame: Each frame represents a unique unit of data transfer over the cluster cable. where the vehicle contains one Body CAN cluster. The database contains many object classes. each cluster represents a single CAN network or FlexRay network. each of which is called a signal. Although the I/O name string can be the complete file path. The physical unit uses a LabVIEW double-precision floating-point numeric type. The signal is the highest level of abstraction for embedded networks. When you use an XNET Session to read/write signal values as physical units. Database Classes To communicate with hardware products on the external CAN/FlexRay network.dbc) for CAN or FIBEX (. NI-XNET applications must understand how that hardware communicates in the actual embedded system. The frame bits contain payload data and an identifier that specifies the data (signal) content. the I/O name serves only as a refnum (its string is irrelevant). ECU: Each Electronic Control Unit (ECU) represents a single hardware product in the embedded system. the database may describe a single vehicle. and a scaling formula to convert raw bits to/from a physical unit. This embedded communication is described within a standardized file.vi. this file is referred to as a database. in which case it behaves as a gateway between the clusters. When you create a session at run time with XNET Create Session. all connected over a CAN or FlexRay cable. Within the database. position. another Powertrain CAN cluster. it typically uses a shortened alias. For example. such as CANdb (. Only one ECU in the cluster transmits each frame. your application does not need to be concerned with protocol (CAN/FlexRay) and frame encoding details. and one or more ECUs receive each frame. Signal: Each frame contains zero or more values. each signal specifies its name.com . Cluster: Each database contains one or more clusters. Within NI-XNET. the first two bytes of a frame payload may represent a temperature. each of which describes a distinct entity in the embedded system: • • Database: Each database is represented as a distinct instance in NI-XNET. and length of the raw bits in the frame. The cluster contains one or more ECUs.

access properties. © National Instruments Corporation 4-423 NI-XNET Hardware and Software Manual . it does not make sense to connect the NI interface to multiple clusters simultaneously. Terminal: Each interface contains various terminals. a Powertrain CAN cluster. When you create an NI-XNET session. you see a list of all clusters known to NI-XNET. where the cluster represents a collection of hardware products all connected over a shared cabling harness. followed by a separator (line). • XNET Cluster I/O Name Each database contains one or more clusters. such as a PXI or PCI card. For example. the interface is the object used to communicate with external hardware described in the database. and invoke methods. both of which operate on the session. LabVIEW selects the closest match from the list. Interface: This represents a single CAN or FlexRay connector (port) on the device. For general information about I/O names.Chapter 4 NI-XNET API for LabVIEW — Additional Topics System Classes These classes describe hardware in your National Instruments system. Because the cluster represents a single physical cable harness. Each NI-XNET device contains one or more interfaces. you specify a physical and logical connection between the NI interface and a cluster. Each cluster in the drop-down list uses the syntax specified in String Use. the terminal does not provide refnum features such as property nodes. refer to XNET I/O Names. If you have not added an alias. The terminals are for NI-XNET synchronization features. such as when to use them. Unlike the other I/O name classes. In other words. Use the XNET Cluster I/O name to select a cluster. to connect triggers and timebases (clocks) to/from the interface hardware. where the vehicle contains a Body CAN cluster. Right-clicking the I/O name displays a menu of LabVIEW items and items specific to NI-XNET. each cluster represents a single CAN network or FlexRay network. User Interface When you select the drop-down arrow on the right side of the I/O name. The list of clusters spans all database aliases known to NI-XNET. • • Device: This represents the National Instruments device for CAN/FlexRay. Within NI-XNET. such as PXI or a desktop PC containing PCI cards. the list of clusters is empty.vi.vi or XNET Disconnect Terminals. the database may describe a single vehicle. The terminal I/O name is for selecting a string input to the XNET Connect Terminals. You can select a cluster from the drop-down list or by typing the name. then a list of menu items. As you type a name. and a Chassis FlexRay cluster.

com . New XNET Database: If you do not have an existing database file. followed by the name of the cluster within that database. such as MyDatabase for a file path of C:\Embedded\Vehicle5\MyDatabase. the dialog provides features for reviewing the list of databases on the RT target. When you save the file. Manage Database Aliases: Select this menu item to open a dialog for managing aliases. you can right-click the RT target within LabVIEW Project and select the Connect menu item. This connects to the RT target over TCP/IP. Edit XNET Database: If you selected a cluster using the I/O name. in that it contains the name of a database alias. after you save from the editor. The second syntax convention uses the database alias only. String Use Use one of two syntax conventions for the string in the XNET Cluster I/O name: • • <alias>. NI-XNET Hardware and Software Manual 4-424 ni. If the alias is not unique.<cluster> <alias> The first syntax convention is the most complete. NI-XNET adds an alias to the file. This is always true for CANdb (. or NI-CAN (. deploying a new database from Windows to the RT target.xml). including the cluster. After adding the alias.dbc). NI-XNET appends a number per LabVIEW conventions (for example. remove an alias (without deleting the file). select this item to launch the NI-XNET Database Editor. you can select the objects in that database from any NI-XNET I/O name.dbc) and NI-CAN (. You can use the editor to make changes to the database file. MyDatabase 2).ncd) files. You can review your list of aliases and associated file paths. When you select OK. You can use the NI-XNET Database Editor to create objects for the database and then save to a file. and undeploying a database (removing an alias and file from RT target). This is supported when the database contains only one cluster.Chapter 4 NI-XNET API for LabVIEW — Additional Topics The XNET Cluster I/O name includes the following menu items (in right-click or drop-down menus): • Browse For Database File: If you have an existing CANdb (. select this item to launch the NI-XNET Database Editor with that cluster’s database file. Therefore. FIBEX (. the NI-XNET Database Editor also adds an alias. followed by a dot separator. The alias uses the filename.dbc. • • • If you are using LabVIEW Real-Time (RT). Use the file dialog to browse to the database file on your system.ncd) database file. and add new aliases. select this item to add an alias to NI-XNET. which always contain a single CAN cluster. If you open the Manage dialog while connected to an RT target. which in turn enables the user interface of NI-XNET I/O names to operate remotely. the clusters in the database become available in the XNET Cluster I/O name drop-down list.

such as the list of all XNET Frames. In LabVIEW 8. reads information for the cluster. • © National Instruments Corporation 4-425 NI-XNET Hardware and Software Manual .vi: The stream I/O sessions transfer an arbitrary sequence of frames on the cluster. This occurs when the last top-level VI using the database goes idle (aborted or stops executing). the <cluster> name is stored in the database file. Close (Cluster): Call this VI when you finish using the XNET Cluster refnum.vi. you must open the refnum manually by calling XNET Database Open (Cluster).6. The Generic instance provides advanced features to pass in database object names as strings. no <cluster> name is stored. In LabVIEW 8. The manual XNET Database Open (Cluster). numbers.xml) files. In LabVIEW 2009 and later.vi. and the refnum is opened prior to the first use. and other special characters are not supported within the cluster name. and space ( ) are recommended.). Within Create Session. LabVIEW can open the XNET Cluster I/O name automatically.dbc) or NI-CAN (. so only the XNET Cluster is required for configuration (not specific frames). The cluster name must begin with a letter (uppercase or lowercase) or underscore. so NI-XNET uses the name CAN_Cluster. and not a number. but only letters. Generic).1 and earlier. and then closes the database. This property node is the most common use case for the XNET Cluster I/O name. In LabVIEW 2009 and later. because it provides the features needed to query and/or edit the cluster contents in the database file. you can use this VI to close all objects in the database with one call. LabVIEW closes the XNET Cluster automatically.Chapter 4 NI-XNET API for LabVIEW — Additional Topics The <alias> can use any character.1 and earlier. you must open the cluster. Open Refnum: Before using the XNET Cluster as a refnum. and underscore (_). dot (.vi is supported for compatibility. uppercase letters. numbers. You can use the XNET Cluster I/O name string as follows: • XNET Create Session (Frame In Stream.ncd) files. but is not required.6. Space ( ). underscore (_). Valid characters for <cluster> are lowercase letters. For CANdb (. Frame Out Stream. • Refnum Use You can use the XNET Cluster I/O name refnum as follows: • XNET Cluster Property Node: The cluster property node provides information about its contents. Wire the I/O name to a property node or VI. For FIBEX (. NI-XNET opens the database file. including the cluster. The cluster name is limited to 128 characters. you must close the refnum manually by calling XNET Database Close. This VI wires out an XNET Cluster I/O name with the refnum open. As a convenience.

such as CANdb (. The database contains many object classes. and you change its file path to C:\Embedded\Vehicle5\MyDatabase. followed by a separator (line). Right-clicking the I/O name displays a menu of LabVIEW items and items specific to NI-XNET. As you type a name. save). For general information about I/O names. each of which describes a distinct entity in the embedded system. For example. if your application uses the alias MyDatabase. refer to What Is an Alias?. For more information about aliases. Within NI-XNET. refer to XNET I/O Names. Use the XNET Database I/O name to select a database. The alias uses the filename. you can add an alias named MyDatabase. The XNET Database I/O name provides the following menu items in right-click and drop-down menus: • Browse For Database File: If you have an existing CANdb (. LabVIEW selects the closest match from the list.ncd) for CAN. The alias concept is used in most NI-XNET features. or FIBEX (. access properties. When using a database file with NI-XNET.dbc). call this VI to create a new XNET ECU or Frame within the cluster. such as when to use them. such as the vehicle. When you select OK. you can specify the file path or specify an alias to the file.com . then a list of menu items.xml) for FlexRay. The alias provides a shorter. NI-XNET adds an alias to the file. This embedded communication is described within a standardized file. NI-XNET applications must understand how that hardware communicates in the actual embedded system. easier-to-read name for use within your application. the alias concept isolates your LabVIEW application from the specific filepath. XNET Database I/O Name To communicate with hardware products on the external CAN/FlexRay network. or NI-CAN (.dbc.dbc. select this item to add an alias to NI-XNET. for the file path C:\C:\Documents and Settings\All Users\Documents\ Vehicle5\MyDatabase. and invoke methods (for example. Frame): If you are creating a new database. such as MyDatabase for a file path NI-XNET Hardware and Software Manual 4-426 ni. including deployment of database files to LabVIEW Real-Time targets.Chapter 4 NI-XNET API for LabVIEW — Additional Topics • Create (ECU.xml). this file is referred to as a database. For example. In addition to improving readability.dbc) or NI-CAN (. Use the file dialog to browse to the database file on your system. User Interface When you select the drop-down arrow on the right side of the I/O name. You can select an alias from the drop-down list or by typing the name. If you have not added an alias. the first list is empty. FIBEX (.ncd) database file. you see a list of all database aliases known to NI-XNET. your LabVIEW application continues to run without change.

and undeploy a database (remove the alias and file from the RT target). select this item to launch the NI-XNET Database Editor with that database file. © National Instruments Corporation 4-427 NI-XNET Hardware and Software Manual . NI-XNET appends a number per LabVIEW conventions (for example. If the alias is not unique. underscore (_). You can use the <filepath> syntax to open the database directly. You can use the NI-XNET Database Editor to create objects for the database and then save to a file. Because special characters typically are required in an absolute filepath (such as \ or :). You can review your list of aliases and associated file paths. MyDatabase 2). • New XNET Database: If you do not have an existing database file. The <alias> can use any character. Manage Database Aliases: Select this menu item to open a dialog to manage aliases. and space ( ) are recommended.dbc. you can select the objects in that database from any NI-XNET I/O name. without adding an alias to NI-XNET. using the operating system file conventions (such as C:\Embedded\Vehicle5\MyDatabase. after you save from the editor. Relative file paths are not supported. The <filepath> is the absolute path to the text database file. This syntax is the only option available when you select a database from the drop-down list or use the menu items. Therefore.dbc). deploy a new database from Windows to the RT target. select this item to launch the NI-XNET Database Editor. NI-XNET uses these characters to distinguish the alias syntax from <filepath> syntax. After adding the alias. the dialog provides features to review the list of databases on the RT target. but only letters. You can use the editor to make changes to the database file. • • If you are using LabVIEW Real-Time (RT). numbers. remove an alias (without deleting the file). When you save the file. which in turn enables the user interface of NI-XNET I/O names to operate remotely. you can right-click the RT target within a LabVIEW Project and select the Connect menu item. and add new aliases. Edit XNET Database: If you have selected a database using the I/O name. Valid characters for <filepath> include any characters your operating system supports for an absolute file path. This connects to the RT target over TCP/IP. If you open the Manage dialog while connected to an RT target. String Use Use one of two syntax conventions for the XNET Database I/O name string: • • <alias> <filepath> The <alias> is the database file short name. the NI-XNET Database Editor also adds an alias. the database becomes available in the XNET Database I/O name drop-down list.Chapter 4 NI-XNET API for LabVIEW — Additional Topics of C:\Embedded\Vehicle5\MyDatabase. used as an alias to the complete filepath.

1 and earlier. LabVIEW closes the XNET Database automatically. This property node is the most common use case for the XNET Database I/O name.vi. The XNET Database is passed in as a string. call this VI to save those changes to the file. you must open the database.vi. In LabVIEW 2009 and later. • • XNET Database Create (Cluster). reads information.com • NI-XNET Hardware and Software Manual . The file is saved in the FIBEX format. XNET Database Save.vi: Call this VI when you finish using the XNET Database. and the refnum is opened prior to the first use. Within Create Session. because it provides the features needed to query and/or edit all database contents from the top-level down to all other objects. These VIs require the alias syntax for the XNET Database (not filepath).6. 4-428 ni. As a convenience. NI-XNET must maintain a binary image of the database objects in memory.vi instances use signal or frame I/O names and not the database directly.vi is supported for compatibility. While the database refnum is open. Undeploy: These VIs enable you to manage an existing alias at run time. To free this memory for other purposes. but is not required.vi: The commonly used XNET Create Session. this VI provides a feature to close all objects in the database with one call. In LabVIEW 8. you must close the refnum manually by calling XNET Database Close. such as the list of all XNET Clusters. call this VI to create a new XNET Cluster within the database. • Remove Alias. Deploy. Open Refnum: Before using the XNET Database as a refnum. close the database refnum when it is no longer used.6. In LabVIEW 2009 and later. In LabVIEW 8. The Generic instance provides advanced features to pass in database object names as strings. much like the Manage Database Aliases dialog.vi: After you set properties for the database or any of its objects. you must open the refnum manually by calling XNET Database Open (Database). XNET Database Close (Database). This occurs when the last top-level VI using the database goes idle (aborted or stops executing). The manual XNET Database Open (Database). This VI wires out an XNET Database I/O name with the refnum open. including the database itself. and is not opened as a refnum. NI-XNET opens the database file. Wire the I/O name to a property node or VI. LabVIEW can open the XNET Database I/O name automatically. • Refnum Use You can use the XNET Database I/O name refnum as follows: • XNET Database Property Node: The database property node provides information on its contents.vi: If you are creating a new database. and closes the database.1 and earlier.Chapter 4 NI-XNET API for LabVIEW — Additional Topics You can use the XNET Database I/O name string as follows: • XNET Create Session (Generic).

This syntax may change in future versions. access properties. Use the XNET ECU I/O name to select an ECU. User Interface The XNET Device I/O name is not intended for use on VI front panels or as a diagram constant. so string display or formation is not recommended.Chapter 4 NI-XNET API for LabVIEW — Additional Topics XNET Device I/O Name Within NI-XNET. String Use NI-XNET determines the XNET Device I/O name string syntax internally. User Interface Before using the ECU I/O name. This occurs when the last top-level VI using the device goes idle (aborted or stops executing). XNET ECU I/O Name Each Electronic Control Unit (ECU) represents a single hardware product in the embedded system. such as when to use them. Because the NI-XNET hardware interface physically connects to a single cluster in your embedded system. This I/O name class is returned as the value of the following properties: • • XNET System Devices XNET Interface Device The value these properties return is used as a refnum only. LabVIEW closes the XNET device automatically. The XNET Device Property Node provides information such as the serial number and list of interfaces contained within the device. it makes sense to limit the list to ECUs contained in a single cluster. the term device refers to your National Instruments CAN/FlexRay hardware product. For general information about I/O names. such as a PXI or PCI card. refer to XNET I/O Names. Each device contains one or more interfaces to communicate on a CAN/FlexRay network. © National Instruments Corporation 4-429 NI-XNET Hardware and Software Manual . you must use Select Database to select a cluster within a known database. and invoke methods. Refnum Use You can use the XNET Device I/O name refnum as a device node. The cluster contains one or more ECUs. all connected by a CAN or FlexRay cable.

As you type a name. Right-clicking the I/O name displays a menu of LabVIEW items and items specific to NI-XNET. You can review your list of aliases and associated file paths. If you are using LabVIEW Real-Time (RT). the clusters in the database become available in the Select Database list. After adding the alias. you see a list of all ECUs within the selected cluster. the NI-XNET Database Editor also adds an alias. select this item to launch the NI-XNET Database Editor. after you save from the editor. When you select OK. then a list of menu items. and add new aliases.dbc). You must select the desired cluster when you finish using the NI-XNET Database Editor. remove an alias (without deleting the file). or NI-CAN (. LabVIEW selects the closest match from the list. select this item to add an alias to NI-XNET. The alias uses the filename. • New XNET Database: If you do not have an existing database file. you can right-click the RT target within a LabVIEW Project and select the Connect menu item. After adding the alias. this item provides a pull-right menu to select the cluster.ncd) database file. You can select an ECU from the drop-down list or by typing the name. each <alias>. When you save the file. You can use the NI-XNET Database Editor to create objects for the database and then save to a file. including the ECUs. You can use the editor to make changes to the database file. NI-XNET appends a number per LabVIEW conventions (for example. • Browse For Database File: If you have an existing CANdb (. The list of clusters uses the same list as the XNET Cluster I/O Name. The XNET ECU I/O name provides the following menu items in right-click and drop-down menus: • Select Database: In the drop-down list. This connects to the RT target over • • NI-XNET Hardware and Software Manual 4-430 ni. If the alias is not unique. You must select a cluster to specify the frame selection scope. MyDatabase 2).dbc. Use the file dialog to browse to the database file on your system. and the first cluster in the database is selected automatically. Manage Database Aliases: Select this menu item to open a dialog to manage aliases. NI-XNET adds an alias to the file. this menu item opens a dialog to select a cluster. followed by a separator (line). FIBEX (. select this item to launch the NI-XNET Database Editor with that cluster’s database file. but when the database contains multiple clusters. In the right-click menu.xml). Edit XNET Database: If you have selected a cluster using Select Database. Each ECU in the drop-down list uses the syntax specified in String Use. such as MyDatabase for a file path of C:\Embedded\Vehicle5\MyDatabase. you can select the objects in that database from any NI-XNET I/O name.<cluster> name is listed. Each cluster name typically is just the database <alias> only. it appears in the Select Database list.Chapter 4 NI-XNET API for LabVIEW — Additional Topics When you select the drop-down arrow on the right side of the I/O name. Therefore.com .

xml) and CANdb (. In LabVIEW 2009 and later. which uses the same syntax convention as the XNET Cluster I/O Name. The manual XNET Database Open (ECU). and undeploy a database (remove the alias and file from an RT target). If you open the Manage dialog while connected to an RT target. which in turn enables the user interface of NI-XNET I/O names to operate remotely. but is not required. LabVIEW can open the XNET ECU I/O name automatically. The characters for <dbSelection> are the same as the name you selected using Select Database. This VI wires out an XNET ECU I/O name with the refnum open.1 and earlier.).Chapter 4 NI-XNET API for LabVIEW — Additional Topics TCP/IP. because each instance is located using its name. String Use Use the following syntax convention for the XNET ECU I/O name string: <ecu>\n<dbSelection> The string contains the ECU name.dbc) files. LabVIEW requires each I/O name to use a unique name. followed by a new line (\n) as a separator.ncd) files. rather than the more complex syntax that includes <dbSelection>. This enables the VI end user to focus on selecting the <ecu>. By appending the cluster name. and other special characters are not supported within the ECU name. you must open the refnum manually by calling XNET Database Open (ECU). When you drop the I/O name onto your front panel. NI-XNET ensures that the entire name is unique in large applications that use multiple NI-XNET interfaces (multiple clusters). Wire the I/O name to a property node or VI. Valid characters for <ecu> are lowercase letters. The <ecu> name must begin with a letter (uppercase or lowercase) or underscore.vi is supported for compatibility. For FIBEX (. the dialog provides features to review the list of databases on the RT target. To view the <dbSelection> when the I/O name is displayed. © National Instruments Corporation 4-431 NI-XNET Hardware and Software Manual . numbers. The <ecu> name is limited to 128 characters. and underscore (_). followed by the selected cluster name. resize its constant/control to show multiple lines. You can use the XNET ECU I/O name string as follows: • Open Refnum: Before using the XNET ECU as a refnum. ECU specifications are not provided within NI-CAN (.vi. the database file stores the <ecu> name. The <dbSelection> is appended to the ECU name to ensure that the XNET ECU I/O name is unique. In LabVIEW 8. uppercase letters. you must open the ECU. Space ( ). the control displays only one line by default. dot (. deploy a new database from Windows to the RT target. and the refnum is opened prior to the first use. and not a number.6.

FlexRay:Base Cycle. then a list of menu items. FlexRay:Cycle Repetition. refer to XNET I/O Names. each frame is identified by its arbitration ID. The frame bits contain payload data and an identifier that specifies the data (signal) content. In LabVIEW 8. you must use Select Database to select a cluster within a known database. Only one ECU in the cluster transmits each frame. • XNET Frame I/O Name Each frame represents a unique unit of data transfer over the cluster cable.1 and earlier. each frame is identified by its location within the FlexRay cycle and channels. This occurs when the last top-level VI using the database goes idle (aborted or stops executing). and invoke methods. For CAN. Each frame in the drop-down list uses the syntax specified in String Use. NI-XNET Hardware and Software Manual 4-432 ni. it makes sense to limit the list to frames contained in a single cluster. LabVIEW closes the XNET ECU automatically. followed by a separator (line). As a convenience. For general information about I/O names. The XNET Frame Identifier.vi. you must close the refnum manually by calling XNET Database Close. access properties. When you are creating an application to test a single ECU product. you see a list of all frames within the selected cluster. Close (ECU): Call this VI when you finish using the XNET ECU refnum. For FlexRay. In LabVIEW 2009 and later. and FlexRay:In Cycle Repetitions:Enabled? properties specify this location. Use the XNET Frame I/O name to select a frame. and one or more ECUs receive each frame.Chapter 4 NI-XNET API for LabVIEW — Additional Topics Refnum Use You can use the XNET ECU I/O name refnum as follows: • XNET ECU Property Node: The ECU property node provides the list of all frames the ECU transmits and receives.com . The XNET Frame Identifier and CAN:Extended Identifier? properties specify this arbitration ID.6. Because the NI-XNET hardware interface physically connects to a single cluster in your embedded system. these frame lists help you create sessions for input/output of all frames (or signals) to fully test the ECU behavior. FlexRay:Channel Assignment. User Interface Before using the frame I/O name. When you select the drop-down arrow on the right side of the I/O name. such as when to use them. this VI provides a feature for closing all objects in the database with one call.

select this item to launch the NI-XNET Database Editor with that cluster’s database file. and add new aliases. You must select a cluster to specify the frame selection scope. The alias uses the filename. and undeploy a database (remove the alias and file from the RT target). you can select the objects in that database from any NI-XNET I/O name. If you are using LabVIEW Real-Time (RT). you can right-click the RT target within a LabVIEW Project and select the Connect menu item. including the frames. NI-XNET appends a number per LabVIEW conventions (for example. In the right-click menu. remove an alias (without deleting the file). such as MyDatabase for a file path of C:\Embedded\Vehicle5\MyDatabase. Each cluster name typically is just the database <alias> only. deploy a new database from Windows to the RT target.<cluster> name is listed. select this item to add an alias to NI-XNET. If you open the Manage dialog while connected to an RT target. or NI-CAN (. Therefore. You can review your list of aliases and associated file paths.ncd) database file. Edit XNET Database: If you have selected a cluster using Select Database. Right-clicking the I/O name displays a menu of LabVIEW items and items specific to NI-XNET.dbc). and the first cluster in the database is selected automatically. As you type a name. • • © National Instruments Corporation 4-433 NI-XNET Hardware and Software Manual . NI-XNET adds an alias to the file. This connects to the RT target over TCP/IP. If the alias is not unique. When you save the file. FIBEX (. it appears in the Select Database list. The XNET Frame I/O name includes the following menu items in right-click and drop-down menus: • Select Database: In the drop-down list. which in turn enables the user interface of NI-XNET I/O names to operate remotely. When you select OK. Use the file dialog to browse to the database file on your system. select this item to launch the NI-XNET Database Editor.xml). You can use the NI-XNET Database Editor to create objects for the database and then save to a file. this item includes a pull-right menu to select the cluster. After adding the alias. after you save from the editor. You must select the desired cluster when you finish using the NI-XNET Database Editor. but when multiple clusters are in the database. each <alias>. the clusters in the database become available in the Select Database list. MyDatabase 2). LabVIEW selects the closest match from the list.Chapter 4 NI-XNET API for LabVIEW — Additional Topics You can select a frame from the drop-down list or by typing the name. You can use the editor to make changes to the database file. • Browse For Database File: If you have an existing CANdb (. the dialog provides features to review the list of databases on the RT target.dbc. The list of clusters uses the same list as the XNET Cluster I/O Name. Manage Database Aliases: Select this menu item to open a dialog to manage aliases. the NI-XNET Database Editor also adds an alias. After adding the alias. this menu item opens a dialog to select a cluster. • New XNET Database: If you do not have an existing database file.

reads information for the frames. and closes the database. You can use the XNET Frame I/O name string as follows: • XNET Create Session (Frame In Queued. This VI wires out an XNET Frame I/O name with the refnum open. Frame Out Queued. resize its constant/control to show multiple lines. followed by the selected cluster name. LabVIEW requires each I/O name to use a unique name. The <dbSelection> is appended to the frame name to ensure that the XNET Frame I/O name is unique. In LabVIEW 2009 and later.vi. because each instance is located using its name. Frame In Single-Point. The single-point I/O sessions transfer the recent value for a list of frames. Generic). For all supported database formats. and the refnum is opened prior • NI-XNET Hardware and Software Manual 4-434 ni.1 and earlier. which uses the same syntax convention as the XNET Cluster I/O Name. Open Refnum: Before using the XNET Frame as a refnum. followed by a new line (\n) as a separator. dot (. For all of these instances. the XNET Frame I/O name is passed in as input. and not a number. NI-XNET ensures that the entire name is unique in large applications that use multiple NI-XNET interfaces (multiple clusters). NI-XNET opens the database file. the control displays only one line by default. uppercase letters. Frame Out Single-Point. and other special characters are not supported within the <frame> name. Within Create Session. Wire the I/O name to a property node or VI.). you must open the frame.Chapter 4 NI-XNET API for LabVIEW — Additional Topics String Use Use the following syntax convention for the XNET Frame I/O name string: <frame>\n<dbSelection> The string contains the frame name. numbers. and underscore (_). The <frame> name must begin with a letter (uppercase or lowercase) or underscore. the database file stores the <frame> name.vi: The queued I/O sessions transfer a sequence of values for a single frame in the cluster. The <frame> name is limited to 128 characters. This enables the VI end user to focus on selecting the <frame>. In LabVIEW 8.6. To view the <dbSelection> when the I/O name is displayed. When you drop the I/O name onto your front panel. Space ( ). The Generic instance provides advanced features to pass in database object names as strings. including one or more frames. but is used as a string. By appending the cluster name. you must open the refnum manually by calling XNET Database Open (Frame). LabVIEW can open the XNET Frame I/O name automatically. rather than the more complex syntax that includes <dbSelection>. Valid characters for <frame> are lowercase letters. The characters for <dbSelection> are the same as the name you selected using Select Database.com .

© National Instruments Corporation 4-435 NI-XNET Hardware and Software Manual . Because the cluster represents a single physical cable harness. LabVIEW closes the XNET Frame automatically. The check for an actual CAN4 interface does not occur until it is used at runtime (for example. but not required. • XNET Interface I/O Name The XNET interface represents a single CAN or FlexRay connector (port) on the device. You can select an interface from the drop-down list or by typing the name. such as when you can use them.6. As you type a name. you must close the refnum manually by calling the XNET Database Close. the interface is the object used to communicate with external hardware described in the database. You can type the name of an interface that does not exist in your system. In LabVIEW 8.Chapter 4 NI-XNET API for LabVIEW — Additional Topics to the first use. call this VI to create a new XNET Signal or Subframe within the frame. refer to XNET I/O Names. When you create an NI-XNET session. and to read hardware information properties. LabVIEW selects the closest match from the list.vi: If you are creating a new database. Subframe). number of payload bytes. Within NI-XNET. you can type CAN4 even if only CAN1 and CAN2 exist in your system. This occurs when the last top-level VI using the database goes idle (aborted or stops executing). As a convenience.vi is supported for compatibility.vi.vi. this VI provides a feature to close all objects in the database with one call. XNET Database Close (Frame). For general information about I/O names. For example. you specify a physical and logical connection between the NI interface and a cluster. User Interface When you select the drop-down arrow on the right side of the I/O name. Refnum Use You can use the XNET Frame I/O name refnum as follows: • XNET Frame Property Node: The frame property node provides the information such as the network identification. within a session). The manual XNET Database Open (Frame). you see a list of all interfaces available in your system. In LabVIEW 2009 and later. The XNET interface I/O name is used to select an interface to pass to XNET Create Session. • XNET Database Create (Signal.1 and earlier. it does not make sense to have the NI interface connected to multiple clusters simultaneously. and the list of signals within the frame.vi: Call this VI when you finish using the XNET frame refnum.

the code in the VI block diagram works with that protocol only. For example.Chapter 4 NI-XNET API for LabVIEW — Additional Topics If you are using LabVIEW Real-Time (RT). The XNET interface drop-down list shows (target disconnected) until you connect the RT target. The numbering starts at 1. I/O Name Filtering is available at edit-time only. the interface names will be CAN1. The protocol name is not case sensitive. Within XNET Create Session. you do not want to allow the VI end users to select a different protocol at runtime. CAN only. a PXI chassis). You can show all CAN and FlexRay interfaces. NI-XNET Hardware and Software Manual 4-436 ni.vi. if you have a two-port CAN device and a two-port FlexRay device in your system. The selected filtering is saved along with the VI that uses the I/O name. When you right-click the I/O name. even if new CAN cards are added. or FlexRay only.vi: All XNET Create Session.vi instances use the interface I/O name to specify the interface for the session’s I/O. For as long as that CAN card exists in your system. the menu contains LabVIEW items including I/O Name Filtering. you can write all of your applications to assume CAN1 and CAN2. Although you can change the interface number <n> within MAX. FlexRay1. Use this menu item to filter the interface names shown in the I/O name. before you run your VI. CAN2. the typical practice is to allow NI-XNET to select the number automatically. NI-XNET uses the same interface numbers for that device. which in turn enables the user interface of NI-XNET I/O names to operate remotely. the drop-down list shows all interfaces on that RT target (for example. you can right-click the RT target within LabVIEW project and select Connect. and your system always uses a single two-port CAN device. This connects to the RT target over TCP/IP. The number <n> identifies the specific interface within the scope of the protocol. String Use Use one of two syntax conventions for the string in the XNET Interface I/O name: <protocol><n> The protocol is either CAN for a CAN interface or FlexRay for a FlexRay interface. NI-XNET opens the interface and configures the hardware for the session’s I/O communication.com . Therefore. If you do not change the number in MAX. and FlexRay2. When the RT target is connected. This is done under the assumption that if you filter for a specific protocol. NI-XNET always starts at 1 and increments for each new interface found. You can use the XNET Interface I/O name string as follows: • XNET Create Session.

For general information about I/O names. When the RT target is connected. Use the XNET Session I/O name to select a session defined in a LabVIEW project. such as when to use them. LabVIEW selects the closest match from the list. PXI chassis). such as the port number next to the connector. Use the session class I/O name primarily for sessions created at edit time using a LabVIEW project. the I/O name serves only as a refnum (its string is irrelevant). When you wire the I/O name to one of the following nodes.vi. chassis with multiple CAN devices). the available sessions are in the NI-XNET configuration file (nixnetSession. The XNET session drop-down list shows (target disconnected) until you connect the RT target. You can select a session from the drop-down list or by typing the name. Blink: If no session is in use for the interface. Your application uses sessions to read and write I/O data.exe). © National Instruments Corporation 4-437 NI-XNET Hardware and Software Manual . If you are using a VI within a built application (. prior to using the interface within a session.vi. When you create a session at run time with XNET Create Session.vi or XNET Write. The refnum is closed automatically when it is no longer used. which in turn enables the user interface of NI-XNET I/O names to operate remotely. refer to XNET I/O Names User Interface When you select the drop-down arrow on the right side of the I/O name. for use with methods such as XNET Read. If you are using a VI within a LabVIEW project. the available sessions are listed under the VI target (RT or My Computer).txt) the LabVIEW build generates. XNET Session I/O Name The XNET Session represents a connection between your National Instruments CAN/FlexRay hardware and hardware products on the external CAN/FlexRay network. you see a list of all available sessions.Chapter 4 NI-XNET API for LabVIEW — Additional Topics Refnum Use The XNET interface refnum always is opened and closed automatically. LabVIEW opens a refnum for the interface. You can use the XNET Frame I/O Name refnum as follows: • • XNET Interface Property Node: The interface property node provides information for the hardware. As you type a name. This connects to the RT target over TCP/IP. you can right-click the RT target within a LabVIEW project and select the Connect menu item. you can use this VI to identify a specific interface within a large system (for example. the drop-down list shows all sessions on that RT target (for example. If you are using LabVIEW Real-Time (RT). The XNET interface refnum features are for hardware information and identification.

vi: Write data for an output session. before you run your VI. in that you use the session to read and write data on the embedded network using the following property node and VIs: • • • • • • XNET Session Property Node: Use the session property node to change the session configuration. the menu contains LabVIEW items and the following items: • Edit XNET Session: This item opens the Properties dialog for the selected session. LabVIEW conventions for names in project allow any character. You also can close the refnum by calling XNET Clear.vi: Connect/disconnect synchronization terminals. XNET Start. XNET Write. You can change the session properties and select OK to save those changes in the project. The new session is created under the same target as the current VI. The XNET Session I/O name string is not used directly.vi: Read data for an input session and read state information for the session interface. XNET Connect Terminals. Refnum Use The XNET Session refnum always is opened and closed automatically.com .vi. including special characters such as space ( ) and slash (/). XNET Wait. The refnum is closed automatically when your top-level VIs are no longer executing (idle).vi: Handle notification of events that occur in the session. This menu item is available at edit time only. LabVIEW opens a refnum for the session.vi. • String Use Use a session name from the drop-down list. This menu item is available at edit time only. before you run your VI.vi: Control the session and buffer states. XNET Read. New XNET Session: This launches the wizard to create a new XNET Session.vi and XNET Disconnect Terminals. in that it always is opened automatically for use as a refnum. NI-XNET Hardware and Software Manual 4-438 ni.Chapter 4 NI-XNET API for LabVIEW — Additional Topics When you right-click the I/O name.vi.vi and XNET Create Timing Source. and XNET Flush. XNET Stop. The XNET Session refnum features represent the core NI-XNET functionality. When you wire the I/O name to a node.

then a list of menu items. In the right-click menu. position. LabVIEW closes the refnum automatically when your top-level VIs are no longer executing (idle). Use the XNET Signal I/O name to select a signal. Each signal in the drop-down list uses the syntax specified in String Use. For general information about I/O names. each signal specifies its name. Right-clicking the I/O name displays a menu of LabVIEW items and items specific to NI-XNET. each <alias>. it makes sense to limit the list to signals contained in a single cluster. and a scaling formula to convert raw bits to/from a physical unit. your application does not need to be concerned with protocol (CAN/FlexRay) details and frame encoding. each of which is called a signal. Within the database. and length of the raw bits in the frame. Each cluster name typically is just the database <alias> only. You must select a cluster to specify the signal selection scope. If this VI is not called. For example. User Interface Before using the signal I/O name. You can select a signal from the drop-down list or by typing the name. The physical unit uses a LabVIEW double-precision floating-point numeric type. The signal is the highest level of abstraction for embedded networks.vi: Close the session refnum. XNET Signal I/O Name Each frame contains zero or more values. this menu item opens a dialog to select a cluster. LabVIEW selects the closest match from the list. you must use Select Database to select a cluster within a known database. As you type a name. but when multiple clusters are contained in the database. refer to XNET I/O Names.Chapter 4 NI-XNET API for LabVIEW — Additional Topics • XNET Clear. The list of clusters uses the same list as the XNET Cluster I/O Name. and the third payload byte may represent a pressure. and invoke methods. Because the NI-XNET hardware interface physically connects to a single cluster in your embedded system. The XNET Signal I/O name provides the following menu items in right-click and drop-down menus: • Select Database: In the drop-down list. including stopping all I/O. access properties. the first two bytes of a frame payload may represent a temperature. such as when to use them.<cluster> name is listed. © National Instruments Corporation 4-439 NI-XNET Hardware and Software Manual . this item provides a pull-right menu to select the cluster. followed by a separator (line). When you select the drop-down arrow on the right side of the I/O name. When you use an XNET Session to read/write signal values as physical units. you see a list of all signals within the selected cluster.

If you open the Manage dialog while connected to an RT target. This connects to the RT target over TCP/IP. you can select the objects in that database from any NI-XNET I/O name. Edit XNET Database: If you have selected a cluster using Select Database. If you are using LabVIEW Real-Time (RT). When you select OK. followed by the selected cluster name. NI-XNET adds an alias to the file. Therefore. This is the recommended design for signal names. remove an alias (without deleting the file).com . MyDatabase 2). such as MyDatabase for a file path of C:\Embedded\Vehicle5\MyDatabase. the clusters in the database become available in the Select Database list. You must select the desired cluster when you finish using the NI-XNET Database Editor. After adding the alias. deploy a new database from Windows to the RT target. You can review your list of aliases and associated file paths.Chapter 4 NI-XNET API for LabVIEW — Additional Topics • Browse For Database File: If you have an existing CANdb (. If the alias is not unique. including the signals. after you save from the editor.<signal>\n<dbSelection> Use the first syntax convention when the signal name is unique within the cluster (not used in multiple frames). select this item to launch the NI-XNET Database Editor with that cluster’s database file. you can right-click the RT target within a LabVIEW Project and select the Connect menu item. Manage Database Aliases: Select this menu item to open a dialog to manage aliases. or NI-CAN (. You can use the editor to make changes to the database file. the NI-XNET Database Editor also adds an alias.ncd) database file. • • String Use Use one of two syntax conventions for the XNET Signal I/O name string: • • <signal>\n<dbSelection> <frame>. After adding the alias. it appears in the Select Database list. • New XNET Database: If you do not have an existing database file.dbc). The alias uses the filename. You can use the NI-XNET Database Editor to create objects for the database and then save to a file. which in turn enables the user interface of NI-XNET I/O names to operate remotely. NI-XNET Hardware and Software Manual 4-440 ni.xml). and the first cluster in the database is selected automatically. and undeploy a database (remove the alias and file from the RT target). select this item to launch the NI-XNET Database Editor. The string contains the name of the signal. because it provides a clear and simple syntax. FIBEX (. and add new aliases. When you save the file. Use the file dialog to browse to the database file on your system.dbc. NI-XNET appends a number per LabVIEW conventions (for example. select this item to add an alias to NI-XNET. the dialog provides features to review the list of databases on the RT target. followed by a new line (\n) as a separator.

Signal Out Single-Point. rather than the more complex syntax that includes <dbSelection>.Chapter 4 NI-XNET API for LabVIEW — Additional Topics Use the second syntax convention when the signal name is used in multiple frames. the <signal> name is stored in the database file. resize its constant/control to show multiple lines.). Within XNET Create Session. In LabVIEW 2009 and later. The characters for <dbSelection> are the same as the name you selected using Select Database. followed by a dot separator. This enables the VI end user to focus on selecting the <signal>.vi: The single-point I/O sessions transfer the recent value for a list of signals. NI-XNET opens the database file. which uses the same syntax convention as the XNET Cluster I/O Name. The string contains the name of frame. followed by the text of the first syntax convention (signal name and selected cluster). You can use the XNET Signal I/O name string as follows: • XNET Create Session (Signal In Single-Point. The <signal> name must begin with a letter (uppercase or lowercase) or underscore. Valid characters for <signal> are lowercase letters. The XY I/O sessions transfer a sequence of values for each signal in a list. reads information for the signals. uppercase letters. In LabVIEW 8. but is not required. • © National Instruments Corporation 4-441 NI-XNET Hardware and Software Manual . and the refnum is opened prior to the first use. and other special characters are not supported within the signal name. Signal In Waveform. Generic).6. Signal Out XY. The <signal> name is limited to 128 characters. Signal In XY. and closes the database. Space ( ). including one or more signals. and underscore (_). By appending the cluster name. LabVIEW can open the XNET Signal I/O name automatically. but is used as a string. you must open the refnum manually by calling XNET Database Open (Signal). dot (. the XNET Signal I/O name is passed in as an input. NI-XNET ensures that the entire name is unique in large applications that use multiple NI-XNET interfaces (multiple clusters). For all these instances. The <dbSelection> is appended to the signal name to ensure that the XNET Signal I/O name is unique. numbers.vi is supported for compatibility. Open Refnum: Before using the XNET Signal as a refnum. Wire the I/O name to a property node or VI. When you drop the I/O name onto your front panel.1 and earlier. LabVIEW requires each I/O name to use a unique name. you must open the signal. To view the <dbSelection> when the I/O name is displayed. For all supported database formats. and not a number. The Generic instance provides advanced features to pass in database object names as strings.vi. because each instance is located using its name. This VI wires out an XNET Signal I/O name with the refnum open.vi. The waveform I/O sessions transfer signal data as LabVIEW waveforms. Signal Out Waveform. The manual XNET Database Open (Signal). the control displays only one line by default.

This occurs when the last top-level VI using the database goes idle (aborted or stops executing). Each subframe contains a distinct set of signals. you must close the refnum manually by calling XNET Database Close (Signal). The frame specifies a single signal called the data multiplexer. XNET Database Close (Signal). a subframe with dynamic signals C and D may exist in the same last bytes. so string display or formation is not recommended.1 and earlier.6. For example. scaling formula to physical units. You can use the XNET Frame I/O name string as follows: • Open Refnum: Before using the XNET Subframe as a refnum. User Interface The XNET Subframe I/O name is not intended for use on VI front panels or as a diagram constant. A specific range of bits within the multiplexed frame is designated to contain subframes.Chapter 4 NI-XNET API for LabVIEW — Additional Topics Refnum Use You can use the XNET Signal I/O name refnum as follows: • • XNET Signal Property Node: The signal property node provides information such as the signal position and size in the payload. if the data multiplexer is 1. LabVIEW closes the XNET Signal automatically. referred to as dynamic signals. NI-XNET Hardware and Software Manual 4-442 ni.com . XNET Subframe I/O Name Within your embedded network. This I/O name class is returned as the value of the following properties: • • XNET Frame Mux:Subframes XNET Signal Mux:Subframe String Use NI-XNET determines the XNET Subframe I/O name string syntax internally. In LabVIEW 8.vi: Call this VI when you finish using the XNET signal refnum.vi. the data multiplexer signal value selects the subframe. a subframe with dynamic signals A and B may exist in the last bytes. In LabVIEW 2009 and later. and so on. This syntax may change in future versions. When a frame is transmitted on the network. As a convenience. some frames may use a feature called data multiplexing (also known as mode-dependent messages). if the data multiplexer is 0. this VI provides a feature to close all objects in the database with one call. you must open the subframe. Use the XNET Subframe I/O name to access properties for a specific subframe.

and the refnum is opened prior to the first use. In LabVIEW 2009 and later. call XNET Database Create (Signal). LabVIEW can open the XNET Subframe I/O name automatically. both of which operate on the session. User Interface When you select the drop-down arrow on the right side of the I/O name. In LabVIEW 8. The manual XNET Database Open (Subframe).1 and earlier. you see a list of all terminals any NI-XNET interface uses. In LabVIEW 2009 and later. The terminals are for NI-XNET synchronization features. Refnum Use You can use the XNET Frame I/O name refnum as follows: • XNET Subframe Property Node: The XNET Subframe property node provides the information such as the data multiplexer value for the subframe and the list of dynamic signals within the subframe.vi is supported for compatibility.6.Chapter 4 NI-XNET API for LabVIEW — Additional Topics In LabVIEW 8. Use the XNET Terminal I/O name to select a string input to the XNET Connect Terminals.vi: Call this VI when you finish using the XNET subframe refnum.vi. Wire the I/O name to a property node or VI. you must open the refnum manually by calling XNET Database Open (Subframe). This occurs when the last top-level VI using the database goes idle (aborted or stops executing).vi: If you are creating a new database. LabVIEW closes the XNET Subframe automatically.vi or XNET Disconnect Terminals. This instance creates a dynamic signal contained within the subframe. © National Instruments Corporation 4-443 NI-XNET Hardware and Software Manual . refer to XNET I/O Names.vi using the parent XNET Frame (not the subframe). To create a static signal that exists in all frame values. • XNET Terminal I/O Name Each interface contains various terminals. but not required. This VI wires out an XNET Subframe I/O name with the refnum open.1 and earlier.vi. this VI provides a feature to close all objects in the database with one call. • XNET Database Create (Dynamic Signal).vi. you must close the refnum manually by calling XNET Database Close (Subframe). As a convenience. to connect triggers and timebases (clocks) to/from the interface hardware. XNET Database Close (Subframe). such as when to use them. call this VI to create a new XNET Signal within the frame. For general information about I/O names.6.

vi. slash (/). XNET Disconnect Terminals.vi: Disconnect a pair of terminals on the interface.vi. Refnum Use The XNET Terminal does not provide refnum features such as property nodes.com . the drop-down list still contains terminals for FlexRay interfaces. Valid characters for the name are lowercase letters. numbers. One of the terminals (source or destination) is on the trigger bus (PXI backplane or PCI RTSI cable).vi: Connect a source terminal to a destination terminal on the interface. and underscore (_). You can use the XNET Interface I/O name term as follows: • • XNET Connect Terminals. and other special characters are not supported within the name. The name is not case sensitive. if you have only a CAN device in your system. The list of terminals is not specific to a particular interface. The terminal name scope always is local to the XNET interface used within the session that you pass to XNET Connect Terminals. refer to XNET Connect Terminals. For example. LabVIEW selects the closest match from the list. As you type a name. String Use Use a terminal name from the drop-down list. NI-XNET Hardware and Software Manual 4-444 ni. For a description of each name. and the other is within the XNET interface.Chapter 4 NI-XNET API for LabVIEW — Additional Topics You can select a terminal from the drop-down list or by typing the name. Space ( ). uppercase letters.

It includes information about using NI-XNET within LabWindows/CVI and Microsoft Visual C. expand Libraries and scroll down to NI-XNET. CAN Frame Input Stream with any output example. LabWindows/CVI To view the NI-XNET function panels. In the Library Tree. Getting Started This section helps you get started using NI-XNET for C. To view the NI-XNET examples.. This opens a dialog containing the NI-XNET classes.. You can access the help for each class or function panel by right-clicking the function panel and selecting Class Help. The examples build on the basic concepts to demonstrate more in-depth use cases. Although you can write NI-XNET applications for either protocol.. To use the NI-XNET Library Tree. For CAN (at Hardware Input and Output»CAN»NI-XNET»Basic): • • • CAN Signal Input Single Point with CAN Signal Output Single Point. Examples NI-XNET includes LabWindows/CVI examples that demonstrate a wide variety of use cases. from the LabWindows/CVI Help menu. select Find Examples. and each folder contains shared examples. or Function Help. this organization helps you find examples for your specific hardware product.. When you browse examples by task. You also can use the Library Tree to access all the function panels quickly. © National Instruments Corporation 5-1 NI-XNET Hardware and Software Manual .NI-XNET API for C 5 This chapter explains how to use the NI-XNET API for C and describes the NI-XNET C functions and properties.. NI-XNET examples are under Hardware Input and Output. and C examples. The examples are grouped by protocol in CAN and FlexRay folders. A few examples are suggested to get started with NI-XNET. go to View and make sure that Library Tree is selected.. CAN Signal Input Waveform with CAN Signal Output Waveform.. select Library»NI-XNET.

For compiling applications that use the NI-XNET API.c extension). you must include this statement to add a search directory to find the header file: /I "$(NIEXTCCOMPILERSUPP)include" For linking applications. you must include the nixnet.lib file and the following statement to your linker project options to search for the library: /libpath:"$(NIEXTCCOMPILERSUPP)\lib32\msvc" The reference for each NI-XNET API function is in NI-XNET API for C Reference. Examples NI-XNET includes C examples that demonstrate a wide variety of use cases. FlexRay Frame Input Stream with any output example. include the header file by adding a #include to the beginning of the code. select values using the front panel controls. Visual C++ 6 The NI-XNET software supports Microsoft Visual C/C++ version 6. A description of each example is in comments at the top of the .Chapter 5 NI-XNET API for C For FlexRay (at Hardware Input and Output»FlexRay»Basic): • • • FlexRay Signal Input Single Point with FlexRay Signal Output Single Point.c file. You can find examples for the C language in the MS Visual C subfolder of the \Users\ Public\Documents\National Instruments\NI-XNET\Examples directory on Windows Vista and the \Documents and Settings\All Users\Shared Documents\National Instruments\NI-XNET\Examples directory on Windows XP. then read the instructions on the front panel to run the examples. The NIEXTCCOMPILERSUPP environment variable is provided as an alias to the C language header file and library location. For C applications (files with a . Each example is in a separate folder.h" In your project options for compiling. You can use this variable when compiling and linking an application.h header file in the code.com . such as: #include "nixnet. FlexRay Signal Input Waveform with FlexRay Signal Output Waveform. you must add the nixnet. NI-XNET Hardware and Software Manual 5-2 ni. To run the example. Open an example project by double-clicking its name.

the interface is the object used to communicate with external hardware described in the database. For as long as that CAN card exists in your system. even if you add new CAN cards. if you have a two-port CAN device and a two-port FlexRay device in your system. CAN2. you can write all your applications to assume CAN1 and CAN2. For example. NI-XNET uses the same interface numbers for that device. NI-XNET also uses the term port to refer to the connector on an NI hardware device. programs written to use CAN1 work with either hardware configuration without change. © National Instruments Corporation 5-3 NI-XNET Hardware and Software Manual . The difference between the terms is that port refers to the hardware object (physical). and interface refers to the software object (logical). The number <n> identifies the specific interface within the <protocol> scope. so that your application does not need to change when your hardware configuration changes.Chapter 5 NI-XNET API for C Interfaces What Is an Interface? The interface represents a single CAN or FlexRay connector on an NI hardware device. Within NI-XNET. For example. The numbering starts at 1. the CAN port labeled Port 1 is assigned as interface CAN1. the typical practice is to allow NI-XNET to select the number automatically. Although the physical port is in a different place. if you remove the CAN PXI card and connect a USB device for CAN. FlexRay1. NI-XNET always starts at 1 and increments for each new interface found. The benefit of this separation is that you can use the interface name as an alias to any port. Each interface name uses the following syntax: <protocol><n> The <protocol> is either CAN for a CAN interface or FlexRay for a FlexRay interface. Later on. and your system always uses a single two-port CAN device. Although you can change the interface number <n> within Measurement & Automation Explorer (MAX). If you do not change the number in MAX. the interface names are CAN1. the CAN port on the USB device is assigned as interface CAN1. and FlexRay2. if you have a PXI chassis with a single CAN PXI device in slot 3.

find the desired system under Remote Systems and select Devices and Interfaces under that system. this file is referred to as a database. Databases What Is a Database? For the NI-XNET interface to communicate with hardware products on the external CAN/FlexRay network. NI-XNET must understand the communication in the actual embedded system.com . where the cluster represents a collection of hardware products connected over a shared cabling harness. Each port is listed with the current interface name assignment. such as FlexRay1. The features of NI-XNET devices and interfaces are the same as the local system. The blinking LED assists in identifying a specific port when your system contains multiple instances of the same hardware product (for example. In other words. and one FlexRay cluster Chassis. Each NI-XNET device is listed with the hardware product name. such as CANdb (. NI-XNET Hardware and Software Manual 5-4 ni. you can change one property: the interface name. each cluster represents a single CAN network or FlexRay network. such as NI PCI-8517 FlexRay. where the vehicle contains one CAN cluster Body. To view hardware in a remote LabVIEW Real-Time system. including all devices and interfaces. you also can create the database at run time (in memory). The database contains many object classes. the right window shows a picture of the device with the port circled and the port LED blinking. you can assign a different interface name than the default. each of which describes a distinct entity in the embedded system. For example. Although the database typically is a file.Chapter 5 NI-XNET API for C How Do I View Available Interfaces? Measurement and Automation Explorer (MAX) Use MAX to view your available NI-XNET hardware. When you select a port. Cluster: Each database contains one or more clusters. • • Database: Each database is represented as a distinct instance in NI-XNET. a chassis with five CAN devices). the database may describe a single vehicle. Within NI-XNET.dbc) for CAN or FIBEX (. select Devices and Interfaces under My System. In the selected port’s window on the right. Select each NI-XNET device to view its physical ports. such as the vehicle. For example.xml) for FlexRay. This embedded communication is described within a standardized file. another CAN cluster Powertrain. Therefore. To view hardware in your local Windows system. you can change the interface for physical port 2 of a PCI-8517 to FlexRay1 instead of FlexRay2.

dbc you can add an alias named MyDatabase. each signal specifies its name. A description of each step in the process follows the flowchart. and one or more ECUs receive each frame. The cluster contains one or more ECUs connected over a CAN or FlexRay cable. The physical unit uses a double-precision floating-point numeric type.dbc your application continues to run without change. For example. After you create an alias. Only one ECU in the cluster transmits (sends) each frame. Within the database. Figure 5-1 shows a process for deciding the database source. it exists until you explicitly delete it. The frame bits contain payload data and an identifier that specifies the data (signal) content. It is possible for a single ECU to be contained in multiple clusters. if your application uses the alias MyDatabase and you change its file path to C:\Embedded\Vehicle5\MyDatabase. Signal: Each frame contains zero or more values. and a scaling formula to convert raw bits to/from a physical unit. In addition to improving readability. easier-to-read name for use within your application. • • What Is an Alias? When using a database file with NI-XNET. The alias provides a shorter. Deleting an alias does not delete the database file itself. for the file path C:\Documents and Settings\All Users\Documents\Vehicle5\ MyDatabase. For example. Database Programming The NI-XNET software provides various methods for creating your application database configuration. the aliases from the previous installation remain. Frame: Each frame represents a unique unit of data transfer over the cluster cable. length of the raw bits in the frame. position. but merely the association within NI-XNET. each of which is called a signal. in which case it behaves as a gateway between the clusters. © National Instruments Corporation 5-5 NI-XNET Hardware and Software Manual . the alias concept isolates your application from the specific file path. If you uninstall and reinstall NI-XNET. you can specify the file path or an alias to the file.Chapter 5 NI-XNET API for C • ECU: Each Electronic Control Unit (ECU) represents a single hardware product in the embedded system.

Decision Process for Choosing Database Source Already Have File? If you are testing an ECU used within a vehicle.Chapter 5 NI-XNET API for C Yes Already Have File? No Yes Can I use file as is? No Yes Want to Use a File? No Select From File Edit and Select Create New File Using Editor Create in Memory Figure 5-1. This file likely would be in CANdb or FIBEX format. NI-XNET Hardware and Software Manual 5-6 ni. If you encounter problems. When you have this file. Select From File You can simply pass the names of objects from the database to the List parameter and the database name (alias or filepath) itself to the DatabaseName parameter of nxCreateSession. This uses the selected objects from the database in the session created. the best choice is to assume Yes and begin using NI-XNET with the file. Can I Use File as Is? Is the file up to date with respect to your ECU(s)? If you do not know the answer to this question. using NI-XNET is relatively straightforward. the vehicle maker (or the maker’s supplier) already may have provided a database file.com . you can use the techniques discussed in Edit and Select to update your application without significant redesign.

Chapter 5 NI-XNET API for C Edit and Select There are two options for editing the database objects for the NI-XNET session: edit in memory and edit the file. and storage in a file makes this easier to manage. The NI-XNET Database Editor has features that facilitate this configuration. This changes the representation in memory. the changes in memory (not the original file) are used. using a FIBEX file is recommended. Using this technique. Want to Use a File? If you do not have a usable database file. You can save the changes to the existing file or a new file. Once you have a file. When you have a file with the changes you need. Each class of database object contains required properties that you must set (refer to Required Properties). but does not save the change to the file. © National Instruments Corporation 5-7 NI-XNET Hardware and Software Manual . and save those changes. The database name is :memory:. you can use nxdbSaveDatabase to save the objects to a file. Using this tool. Create New File Using the Database Editor You can use the NI-XNET Database Editor to create a new database file. You configure each object you create using the property node. Edit the File The NI-XNET Database Editor is a tool for editing database files for use with NI-XNET. This enables you to implement a database editor within your application. you select objects in your application as described in Select From File. edit the objects. As a general rule. After you create and configure objects in memory. When you pass the object into nxCreateSession. This special database name specifies a database that does not originate from a file. Edit in Memory Use nxdbFindObject and nxdbSetProperty to change properties of selected objects. FlexRay communication configuration requires a large number of complex properties. you open an existing file. you can choose to create a file or avoid files altogether for a self-contained application. Create in Memory You can use nxdbCreateObject to create new database objects in memory. you can avoid files entirely and make your application self contained. you select objects in your application as described in Select From File. for FlexRay applications.

NI-XNET returns an error. nxReadState includes selections to read the state of communication. (Refer to What Is an Interface?) Database objects: These describe how external hardware communicates. Session Modes The session mode specifies the data type (signals or frames). (Refer to Session Modes. The sessions can use different modes.signalB (a signal in frameA). You can use sessions for multiple hardware interfaces. For example. The limitations on sessions relate primarily to a specific frame or its signals. This combination of sessions is not allowed. For each interface. (Refer to What Is a Database?) Mode: This specifies the direction and representation of I/O data. you can use multiple input sessions and multiple output sessions simultaneously. The Session Modes section has additional links to sections that explain how to read or write I/O data for each mode. and how data is transferred between your application and the network. direction (input or output). if you create a Frame Output Queued session for frameA.com . you can use the session to interact with the network in other ways. For example. Each session configuration includes: • • • Interface: This specifies the National Instruments hardware to use. then create a Signal Output Single-Point session for frameA. In addition to read/write of I/O data. you can use a Signal Input Single-Point session at the same time you use a Frame Input Stream session.) The links above link to detailed information about configuration. NI-XNET Hardware and Software Manual 5-8 ni. The I/O data consists of values for frames or signals. because writing data for the same frame with two sessions would result in inconsistent sequences of data on the network.Chapter 5 NI-XNET API for C Sessions What Is a Session? The NI-XNET session represents a connection between your National Instruments CAN/FlexRay hardware and hardware products on the external CAN/FlexRay network. For example. such as whether communication has stopped due to error detection defined by the protocol standard.

such as Hardware In the Loop (HIL). Signal Input XY Mode: For each frame received. Signal Output XY Mode: Provides a sequence of signal values for transmit using each frame’s timing as the database specifies. This is the recommended mode for writing a sequence of all signal values. Frame Input Stream Mode: Reads all frames received from the network using a single stream. The values are not limited to a single frame in the database. This is the recommended mode for reading a sequence of all signal values. such as Hardware In the Loop (HIL). provides its signals as a value/timestamp pair. but can transmit any frame. This mode typically is used for control or simulation applications. resamples the signal data to a waveform with a fixed sample rate. Signal Output Single-Point Mode: Writes signal values for the next frame transmit. Frame Output Queued Mode: Provides a sequence of values for a single frame. Frame Output Stream Mode: Transmits an arbitrary sequence of frame values using a single stream. • • • • • • • • • • • © National Instruments Corporation 5-9 NI-XNET Hardware and Software Manual . This mode typically is used for control or simulation applications that require lower level access to frames (not signals). This mode typically is used for control or simulation applications.Chapter 5 NI-XNET API for C The mode is an enumeration of the following: • Signal Input Single-Point Mode: Reads the most recent value received for each signal. Signal Output Waveform Mode: Using the time when the signal frame is transmitted according to the database. resamples the signal data from a waveform with a fixed sample rate. Frame Input Queued Mode: Reads data from a dedicated queue per frame. Frame Output Single-Point Mode: Writes frame values for the next transmit. This mode typically is used for control or simulation applications that require lower level access to frames (not signals). CAN identifier). Frame Input Single-Point Mode: Reads the most recent value received for each frame. Signal Input Waveform Mode: Using the time when the signal frame is received. This mode typically is used for synchronizing XNET data with DAQmx analog/digital input channels. This mode enables your application to read a sequence of data specific to a frame (for example. This mode typically is used for analyzing and/or logging all frame traffic in the network. This mode typically is used for synchronizing XNET data with DAQmx analog/digital output channels. for transmit using that frame’s timing as the database specifies.

and nxReadFrame returns values for that frame only. refer to the XNET Frame CAN:Timing Type and FlexRay:Timing Type properties. followed by two calls to nxReadFrame (one for C and one for E). frame C is a cyclic frame that transmits on the network once every 2 ms. This example uses CAN.com .6 Time 0 ms 1 ms 2 ms 3 ms 4 ms 5 ms E1. You specify only one frame for the session. Example In this example network. Each frame contains two signals.2 C3. one in the first byte and another in the second byte.8 E5.4 C5. a CAN identifier). The following figure shows a timeline of a frame transfer on the CAN network. It enables your application to read a sequence of data specific to a frame (for example. These values represent all values received for the frame since the previous call to nxReadFrame. The input data is returned as an array of frame values. create multiple sessions. Read C1.6 E7.2 6 ms 7 ms 8 ms NI-XNET Hardware and Software Manual 5-10 ni. If you need sequential data for multiple frames. Frame E is an event-driven frame.4 C3. one per frame.Chapter 5 NI-XNET API for C Frame Input Queued Mode This mode reads data from a dedicated queue per frame. For information about cyclic and event-driven frames.

accurate to microseconds. The timestamp represents the absolute time when the XNET interface received the frame (end of frame). Each frame is displayed with CAN-specific elements. © National Instruments Corporation 5-11 NI-XNET Hardware and Software Manual . For information about the data returned from the read function.Chapter 5 NI-XNET API for C The following figure shows the data returned from the two calls to nxReadFrame (two different sessions). this mode effectively sorts received frames so you can process them on an individual basis. The example uses hexadecimal C and E as the identifier of each frame. The first call to nxReadFrame returned an array of values for frame C. Compared to the example for the Frame Input Stream Mode. and the second call to nxReadFrame returns an array for frame E. The first two payload bytes contain the signal data. refer to Raw Frame Format.

one in the first byte and another in the second byte. Each frame contains its name (C or E).2 6 ms 7 ms 8 ms NI-XNET Hardware and Software Manual 5-12 ni. followed by a single call to nxReadFrame. The example uses CAN.6 Time 0 ms 1 ms 2 ms 3 ms 4 ms 5 ms E1.4 C5. For information about cyclic and event-driven frames. Example In this example network. one for each frame specified for the session. followed by the value of its two signals. If the interface receives two frames prior to calling nxReadFrame. This mode does not use queues to store each received frame. It typically is used for control or simulation applications that require lower level access to frames (not signals).com .2 C3. that read returns signals for the second frame. Frame E is an event-driven frame.Chapter 5 NI-XNET API for C Frame Input Single-Point Mode This mode reads the most recent value received for each frame. Each frame contains two signals. refer to the XNET Frame CAN:Timing Type and FlexRay:Timing Type properties. 1st Read 2nd Read 3rd Read C1.8 E5. frame C is a cyclic frame that transmits on the network once every 2 ms. The input data is returned as an array of frames. The following figure shows a timeline of a frame transfer on the CAN network.6 E7.

no frame is received prior to the first call to nxReadFrame.Chapter 5 NI-XNET API for C The following figure shows the data returned from each of the three calls to nxReadFrame. frame C contains values 3 and 4 in its payload. You can use only one Frame Input Stream session for a given interface. It typically is used for analyzing and/or logging all frame traffic in the network. your application must evaluate identification in each frame (such as a CAN identifier or FlexRay slot/cycle/channel) to interpret the frame payload data. In the data returned from the second call to nxReadFrame. © National Instruments Corporation 5-13 NI-XNET Hardware and Software Manual . The first reception of frame C values (1 and 2) were lost. and the payload is the Default Payload. payload values 3 and 4 are returned again for frame C. so the timestamp is invalid. Each frame is displayed with CAN-specific elements. The input data is returned as an array of frames. because no new frame has been received since the previous call to nxReadFrame. so both elements return new values. In the data returned from the first call to nxReadFrame. Frame Input Stream Mode This mode reads all frames received from the network using a single stream. because this mode returns the most recent values. refer to Raw Frame Format. For information about the data returned from the read function. In the frame timeline. Because all frames are returned. The timestamp for frame C is the same as the first call to nxReadFrame. both frame C and frame E are received. In the data returned from the third call to nxReadFrame. For frame E. The session contains frame data for two frames: C and E. For this example we assume that the Default Payload is all 0. Time of 0 ms indicates the time at which the session started to receive frames.

then create a Frame Input Stream session. For example. you can use other sessions with different input modes. For example. followed by the value of its two signals. one in the first byte and another in the second byte.Chapter 5 NI-XNET API for C While using the one Frame Input Stream session.4 C3. Example In this example network. Received frames are copied to the Frame Input Stream session in addition to any other applicable input session.com .6 Time 0 ms 1 ms 2 ms 3 ms 4 ms 5 ms E1. The following figure shows a timeline of a frame transfer on the CAN network. if a frame is received in a static slot on both channel A and channel B. Each frame contains its name (C or E).8 E5. This duplication of incoming frames enables you to analyze overall traffic while running a higher level application that uses specific frame or signal data. refer to the XNET Frame CAN:Timing Type and FlexRay:Timing Type properties. When used with a FlexRay interface. Each frame contains two signals.4 C5. frame C is a cyclic frame that transmits on the network once every 2 ms.6 E7. when FrameA is received. frames from both channels are returned. The example uses CAN. For information about cyclic and event-driven frames.2 6 ms 7 ms 8 ms NI-XNET Hardware and Software Manual 5-14 ni. Read C1. Frame E is an event-driven frame. followed by a single call to nxReadFrame.2 C3. if you create a Frame Input Single-Point session for FrameA. two frames are returned from nxReadFrame. its data is returned from the call to nxReadFrame of both sessions.

Chapter 5 NI-XNET API for C The following figure shows the data returned from nxReadFrame. The timestamp represents the absolute time when the XNET interface received the frame (end of frame). accurate to microseconds. This example uses hexadecimal C and E as the identifier of each frame. For information about the data returned from the read function. refer to Raw Frame Format. Frame C and frame E are returned in a single array of frames. © National Instruments Corporation 5-15 NI-XNET Hardware and Software Manual . The signal data is contained in the first two payload bytes. Each frame is displayed with CAN-specific elements.

Each frame contains its name (C or E). so you can leave them uninitialized. such that every value provided is transmitted. The other frame value elements are ignored. refer to the XNET Frame CAN:Timing Type and FlexRay:Timing Type properties. frame C is a cyclic frame that transmits on the network once every 2. you will see unexpected results on the bus. followed immediately by another call for frame E. use a different Frame Output Queued session for each frame or use the Frame Output Stream Mode. Examples In this example network. one for frame C. For information about cyclic and event-driven frames. NI-XNET transmits each frame according to its properties in the database. The following figure shows a timeline of a frame transfer on the CAN network. To transmit sequential values for multiple frames. the number of payload bytes in each frame value must match that frame’s Payload Length property. For this mode. The example uses CAN.5 ms. The timeline begins with two calls to nxWriteFrame. Each frame contains two signals.com . Therefore. The output data is provided as an array of frame values. to be transmitted sequentially for the frame specified in the session. when you call nxWriteFrame. for transmit using that frame’s timing as specified in the database.0 ms.Chapter 5 NI-XNET API for C Frame Output Queued Mode This mode provides a sequence of values for a single frame. If the number of payload bytes you write is different than the frame’s payload. one in the first byte and another in the second byte. followed by the value of its two signals. NI-XNET Hardware and Software Manual 5-16 ni. The frame values for this mode are stored in a queue. This mode allows you to specify only one frame for the session. Frame E is an event-driven frame that uses a transmit time (minimum interval) of 2.

The second array shows data for the session with frame E. © National Instruments Corporation 5-17 NI-XNET Hardware and Software Manual . Each frame is displayed with CAN-specific elements.4 C5. refer to Raw Frame Format. The first array shows data for the session with frame C.8 4 ms 5 ms 6 ms 7 ms 8 ms The following figure shows the data provided to each call to nxWriteFrame.8 Time 0 ms 1 ms 2 ms 3 ms E5.6 E7. For information about the data returned from the write function.Chapter 5 NI-XNET API for C Write C1.6 C5.2 C3.

the frame value with bytes 3. Frame C transmits followed by frame E. The output data is provided as an array of frames. both using the frame values from the first element (index 0 of each array). The other frame value elements are ignored. this frame no longer transmits. If nxWriteFrame is called again. It typically is used for control or simulation applications that require lower level access to frames (not signals). NI-XNET transmits each frame according to its properties in the database. and frame E is limited to an event-driven transmit once every 2.0 ms in the timeline. the frame value with bytes 5. For this mode. when you call nxWriteFrame. so new frame values are required for each transmit.Chapter 5 NI-XNET API for C Assuming the Auto Start? property uses the default of true. According to the database. If nxWriteFrame is called twice before the next transmit. 0. 4 is taken from index 1 of the frame C array and used for transmit of frame C.com . This mode does not use queues to store frame values. 6 is taken from index 2 of the frame C array and used for transmit of frame C.5 ms have elapsed after acknowledgment of the previous transmit of frame E. the new frame value is used. Because there are no more frame values for frame E. the frame value with bytes 5. you will see unexpected results on the bus.0 ms in the timeline. When 2. and every 2. one for each frame specified for the session.0 ms thereafter. At 4. 0 is taken from index 1 of frame E array and used for transmit of frame E. Frame E is event-driven. At 2. it transmits repeatedly.0 ms. the previous frame value is used again at 6. Although there are no more frame values for frame C. NI-XNET Hardware and Software Manual 5-18 ni. the number of payload bytes in each frame value must match that frame’s Payload Length property.5 ms. 8. Because frame C is a cyclic frame. so you can leave them uninitialized. the transmitted frame uses the value from the second call to nxWriteFrame. Frame Output Single-Point Mode This mode writes frame values for the next transmit.0 ms in the timeline. each session starts within the call to nxWriteFrame. frame C transmits once every 2. If the number of payload bytes you write is different than the frame payload. Therefore.

Each frame is displayed with CAN-specific elements.5 ms.2 C3. one in the first byte and another in the second byte.6 E7. Each frame contains its name (C or E). 1st Write 2nd Write 3rd Write C1.4 4 ms 5 ms 6 ms 7 ms 8 ms The following figure shows the data provided to each of the three calls to nxWriteFrame.6 C5.Chapter 5 NI-XNET API for C Example In this example network. frame C is a cyclic frame that transmits on the network once every 2. © National Instruments Corporation 5-19 NI-XNET Hardware and Software Manual . Each frame contains two signals. refer to Raw Frame Format. The session contains frame values for two frames: C and E. refer to the XNET Frame CAN:Timing Type and FlexRay:Timing Type properties. For information about cyclic and event-driven frames.8 Time 0 ms 1 ms 2 ms 3 ms E3. The timeline shows three calls to nxWriteFrame.4 C5. followed by the value of its two signals. For information about the data returned from the write function.0 ms. Frame E is an event-driven frame that uses a transmit time (minimum interval) of 2. The following figure shows a timeline of a frame transfer on the CAN network. The example uses CAN.

frame C transmits using its value (bytes 3.Chapter 5 NI-XNET API for C Assuming the Auto Start? property uses the default of true. The value for frame E in the second call to nxWriteFrame is not used. both using frame values from nxWriteFrame. the session starts within the first call to nxWriteFrame.com . After the second call to nxWriteFrame. Frame C transmits followed by frame E. but frame E does not transmit. Because the third call to nxWriteFrame occurs before the minimum interval elapses for frame E. 0. 0). 4.5 ms has not elapsed since acknowledgment of the previous transmit. its next transmit uses its value (bytes 3. because its minimal interval of 2. NI-XNET Hardware and Software Manual 5-20 ni. 4).

Example In this example CAN database. The timing of each frame as specified in the database is ignored. Frame Output Stream Mode This mode transmits an arbitrary sequence of frame values using a single stream. refer to the XNET Frame CAN:Timing Type property. one in the first byte and another in the second byte. © National Instruments Corporation 5-21 NI-XNET Hardware and Software Manual . For CAN. The frame values for this mode are stored in a queue.5 ms. the first frame value transmits immediately. such that every value provided is transmitted. The data passed to nxWriteFrame is an array of frame values. The following figure shows a timeline of a frame transfer on the CAN network.0 ms. frame values transmit on the network based entirely on the time when you call nxWriteFrame. the CAN frame payload length in the database is ignored. followed by the value of its two signals. Each frame contains two signals. Frame E is an event-driven frame that uses a transmit time (minimum interval) of 2. each of which transmits as soon as possible. if you provide four frame values to the nxWriteFrame. The timeline begins with a single call to nxWriteFrame. 6). This mode is not supported for FlexRay. and nxWriteFrame is always used. it transmits again using the same value (bytes 5. followed by the next three values transmitted back to back. frame C is a cyclic frame that transmits on the network once every 2. Because frame C is cyclic. Each frame contains its name (C or E). but can transmit any frame. For example. Frames transmit sequentially (one after another). 6).Chapter 5 NI-XNET API for C Frame C transmits the third time using the value from the third call to nxWriteFrame (bytes 5. The values are not limited to a single frame in the database. For information about cyclic and event-driven CAN frames. For this mode.

com .6 Time 0 ms 1 ms E3. refer to Raw Frame Format.Chapter 5 NI-XNET API for C Write C1.2 C3.4 2 ms 3 ms 4 ms 5 ms 6 ms 7 ms 8 ms The following figure shows the data provided to the single call to nxWriteFrame. The array provides values for frames C and E.4 E7.8 E5. NI-XNET Hardware and Software Manual 5-22 ni. Each frame is displayed with CAN-specific elements. For information about the data returned from the write function.

because each frame value timestamp is ignored for this mode. Example In this example network. each session starts within the call to nxWriteFrame. such as Hardware In the Loop (HIL). Within each frame values. Use nxReadSignalSinglePoint for this mode. All frame values transmit immediately. Frame E is an event-driven frame. Unlike the Frame Output Queued Mode. Although frame C and E specify a slower timing in the database.Chapter 5 NI-XNET API for C Assuming the Auto Start? property uses the default of true. The example uses CAN. The timelines shows three calls to nxReadSignalSinglePoint. This mode does not use queues to store each received frame. It typically is used for control or simulation applications. The following figure shows a timeline of a frame transfer on the CAN network. Each frame contains two signals. Each frame contains its name (C or E). this mode does not repeat its transmit. For information about cyclic and event-driven frames. Although frame C is specified in the database as a cyclic frame. the Frame Output Stream mode does not use CAN frame properties from the database. this example uses an invalid timestamp value (0). refer to the XNET Frame CAN:Timing Type and FlexRay:Timing Type properties. This is acceptable. that call to nxReadSignalSinglePoint returns signals for the second frame. If the interface receives two frames prior to calling nxReadSignalSinglePoint. the Frame Output Stream mode disregards this timing and transmits the frame values in quick succession. one in the first byte and another in the second byte. frame C is a cyclic frame that transmits on the network once every 2 ms. Signal Input Single-Point Mode This mode reads the most recent value received for each signal. using the same sequence as the array. © National Instruments Corporation 5-23 NI-XNET Hardware and Software Manual . followed by the value of its two signals.

New values are returned for frame E (5 and 6). values 3 and 4 are returned again for the signals of frame C.8 E5. The values of the first reception of frame C (1 and 2) were lost. In the frame timeline. values 3 and 4 are returned for the signals of frame C.com . In the data returned from the second call to nxReadSignalSinglePoint. both frame C and frame E are received. For this example.Chapter 5 NI-XNET API for C 1st Read 2nd Read 3rd Read C1. because no new frame has been received since the previous call to nxReadSignalSinglePoint.2 C3. For frame E.2 6 ms 7 ms 8 ms The following figure shows the data returned from each of the three calls to nxReadSignalSinglePoint. no frame is received prior to the first call to nxReadSignalSinglePoint.6 E7.0. NI-XNET Hardware and Software Manual 5-24 ni. so all signals return new values. The session contains all four signals.6 Time 0 ms 1 ms 2 ms 3 ms 4 ms 5 ms E1.4 C5. so the last two values return the signal Default Values. because this mode returns the most recent values. In the data returned from the third call to nxReadSignalSinglePoint. Time of 0 ms indicates the time at which the session started to receive frames. In the data returned from the first call to nxReadSignalSinglePoint. assume that the Default Value is 0.

this mode resamples the signal data to a waveform with a fixed sample rate. Read C1.6 E7. For information about cyclic and event-driven frames. followed by a single call to nxReadSignalWaveform. Each frame contains its name (C or E). frame C is a cyclic frame that transmits on the network once every 2 ms.8 E5. Use nxReadSignalWaveform for this mode.2 6 ms 7 ms 8 ms © National Instruments Corporation 5-25 NI-XNET Hardware and Software Manual . Example In this example network. refer to the XNET Frame CAN:Timing Type and FlexRay:Timing Type properties. This mode typically is used for synchronizing XNET data with DAQmx analog/digital input channels. one in the first byte and another in the second byte.4 C5. The example uses CAN. followed by the value of its two signals.4 C3. Each frame contains two signals. You specify the resample rate using the XNET Session Resample Rate property. The following figure shows a timeline of a frame transfer on the CAN network. Frame E is an event-driven frame.2 C3.6 Time 0 ms 1 ms 2 ms 3 ms 4 ms 5 ms E1.Chapter 5 NI-XNET API for C Signal Input Waveform Mode Using the time when the signal frame is received.

You can avoid the loss of signal data by setting the session resample rate to a high rate. because the time of each frame reception is resampled into the waveform timing. At time 0 ms. Assuming this is the first call to nxReadSignalWaveform after starting the session.0. once with signal values 7 and 8. if the resample rate is 1000000. t0 provides an absolute timestamp for the first sample. The session contains all four signals and uses the default resample rate of 1000. the first sample of each waveform uses the signal Default Value. NI-XNET timestamps receive frames to an accuracy of 100 ns. this t0 reflects that start of the session. In the data returned from nxReadSignalWaveform. assume the default value is 0.0. you cannot distinguish this from receiving the frame only once. each frame’s signal values are represented in the waveforms without loss of data. frame E is received twice in fast succession. which corresponds to Time 0 ms in the frame timeline. In the frame timeline. These two frames are received within one sample of the waveform (within 1 ms). For example. The effect on the data from nxReadSignalWaveform is that values for the first frame (7 and 8) are lost. no frame has been received. using a high resample rate can result in a large amount of duplicated (redundant) values. if you use a resample rate of 1000000 (1 MHz). This tradeoff between accuracy and efficiency is a disadvantage of the Signal Input Waveform Mode. NI-XNET Hardware and Software Manual 5-26 ni.com . then again with signals 5 and 6. For this example. frame C is received twice with signal values 3 and 4. a frame that occurs once per second results in one million duplicated signal values. In the frame timeline.Chapter 5 NI-XNET API for C The following figure shows the data returned from nxReadSignalWaveform. In the waveform diagram. Therefore. Nevertheless. Therefore.

Example In this example network. The signal value timing is a direct reflection of received frames. Use Signal Input XY Mode when you need to analyze CAN/FlexRay data. and no resampling occurs. accurate to microseconds. For information about cyclic and event-driven frames. Frame E is an event-driven frame. Use nxReadSignalXY for this mode. The data consists of two two-dimensional arrays. this mode provides the frame signals as a timestamp/value pair. When signals exist in different frames.Chapter 5 NI-XNET API for C The Signal Input XY Mode does not have the disadvantages mentioned previously. The timestamp represents the absolute time when the XNET interface received the frame (end of frame). Each frame contains its name (C or E). Each timestamp/value pair represents a value from a received frame. Each frame contains two signals. one for timestamp and one for value. frame C is a cyclic frame that transmits on the network once every 2 ms. This is the recommended mode for reading a sequence of all signal values. In summary. followed by the value of its two signals. The following figure shows a timeline of a frame transfer on the CAN network. followed by a single call to nxReadSignalXY. when reading a sequence of received signal values. Signal Input XY Mode For each frame received. the array size may be different from one signal to another. The received frames for this mode are stored in queues to avoid signal data loss. © National Instruments Corporation 5-27 NI-XNET Hardware and Software Manual . The example uses CAN. Signal Input XY Mode provides the most efficient and accurate representation of a sequence of received signal values. for validation purposes. One of the disadvantages of Signal Input XY Mode is that the samples are not equidistant in time. use Signal Input Waveform Mode when you need to synchronize CAN/FlexRay data with DAQmx analog/digital input waveforms or display CAN/FlexRay data. refer to the XNET Frame CAN:Timing Type and FlexRay:Timing Type properties. one in the first byte and another in the second byte.

6 Time 0 ms 1 ms 2 ms 3 ms 4 ms 5 ms E1. The XY Graph displays the data from nxReadSignalXY. The session contains all four signals.6 E7.4 C5.2 6 ms 7 ms 8 ms The following figure shows the data returned from nxReadSignalXY.8 E5. This display is an accurate representation of signal changes on the network. The timestamp and value arrays are the same size for each signal.com . resulting in four valid values for the first two signals. to microsecond accuracy.4 C3. Frame E was received three times.Chapter 5 NI-XNET API for C Read C1. resulting in three valid values for the second two signals. The timestamp represents the end of frame. NI-XNET Hardware and Software Manual 5-28 ni.2 C3. Frame C was received four times.

4 4 ms 5 ms 6 ms 7 ms 8 ms © National Instruments Corporation 5-29 NI-XNET Hardware and Software Manual . The example uses CAN. Each frame contains two signals. It typically is used for control or simulation applications. the transmitted frame uses signal values from the second call to nxWriteSignalSinglePoint. 1st Write 2nd Write 3rd Write C1.8 Time 0 ms 1 ms 2 ms 3 ms E3.6 E7. one in the first byte and another in the second byte. The timeline shows three calls to nxWriteSignalSinglePoint.0 ms. Example In this example network.6 C5.5 ms. For information about cyclic and event-driven frames. Each frame contains its name (C or E). Use nxWriteSignalSinglePoint for this mode. followed by the value of its two signals. This mode does not use queues to store signal values.4 C5.Chapter 5 NI-XNET API for C Signal Output Single-Point Mode This mode writes signal values for the next frame transmit. The following figure shows a timeline of a frame transfer on the CAN network. refer to the XNET Frame CAN:Timing Type and FlexRay:Timing Type properties. If nxWriteSignalSinglePoint is called twice before the next transmit. such as Hardware In the Loop (HIL).2 C3. frame C is a cyclic frame that transmits on the network once every 2. Frame E is an event-driven frame that uses a transmit time (minimum interval) of 2.

The session contains all four signals. Signal Output Waveform Mode Using the time when the signal frame is transmitted according to the database. this mode resamples the signal data from a waveform with a fixed sample rate.Chapter 5 NI-XNET API for C The following figure shows the data provided to each of the three calls to nxWriteSignalSinglePoint. Because the third call to nxWriteSignalSinglePoint occurs before the minimum interval elapses for frame E. because its minimal interval of 2. This mode typically is used for synchronizing XNET data with DAQmx analog/digital output channels. The resampling translates from the waveform timing to each frame’s transmit timing. You specify the resample rate using the Resample Rate property.com . Frame C transmits followed by frame E. that signal transmits its Default Value.5 ms has not elapsed since acknowledgment of the previous transmit. its next transmit uses its values (3 and 4). the session starts within the first call to nxWriteSignalSinglePoint. Frame C transmits the third time using values from the third call to the nxWriteSignalSinglePoint (5 and 6). If a transmitted frame contains a signal not included in the output session. The values for frame E in the second call to nxWriteSignalSinglePoint are not used. it transmits again using the same values (5 and 6). If a transmitted frame contains bits no signal uses. but frame E does not transmit. frame C transmits using its values (3 and 4). After the second call to nxWriteSignalSinglePoint. The frames for this mode are stored in queues. it uses the most recent signal values in the waveform that correspond to that time. NI-XNET Hardware and Software Manual 5-30 ni. Assuming the Auto Start? property uses the default of true. those bits transmit the Default Payload. both using signal values from the first call to nxWriteSignalSinglePoint. When the time for the frame to transmit occurs. Use nxWriteSignalWaveform for this mode. Because frame C is cyclic.

one in the first byte and another in the second byte.6 4 ms 5 ms 6 ms 7 ms 8 ms The following figure shows the data provided to the call to nxWriteSignalWaveform. refer to the XNET Frame CAN:Timing Type and FlexRay:Timing Type properties.8 C5. The timeline begins with a single call to nxWriteSignalWaveform.6 E5. Each frame contains two signals.0 ms. frame C is a cyclic frame that transmits on the network once every 2.0 samples per second.5 ms.6 E5. followed by the value of its two signals. For information about cyclic and event-driven frames.2 C5.Chapter 5 NI-XNET API for C Example In this example network.6 Time 0 ms 1 ms 2 ms 3 ms E5. Frame E is an event-driven frame that uses a transmit time (minimum interval) of 2. The following figure shows a timeline of a frame transfer on the CAN network. Each frame contains its name (C or E). Write C1. The session contains all four signals and uses the default resample rate of 1000. © National Instruments Corporation 5-31 NI-XNET Hardware and Software Manual . The example uses CAN.6 C7.

so signal values 7 and 8 are discarded. both using signal values from the first sample (index 0 of all four Y arrays). Transmit of frames starts as soon as the XNET session starts. such that every third sample is used to transmit. The frame properties in the database determine each frame’s transmit time.5 ms. and frame E is limited to an event-driven transmit with interval 2.0 ms in the frame timeline. Frame E still has not reached its transmit time of 2. According to the database.Chapter 5 NI-XNET API for C Assuming the Auto Start? property uses the default of true. The waveform elements t0 (timestamp of first sample) and dt (time between samples in seconds) are ignored for the call to nxWriteSignalWaveform. the sample at index 1 occurs at 1. Therefore. Frame C is ready for its next transmit at that time. This behavior continues for Y array indices 4 through 7.com . the sample at index 1 cannot be resampled to a transmitted frame and is discarded. Index 2 in the waveforms occurs at 2. NI-XNET Hardware and Software Manual 5-32 ni. so signal values 5 and 6 are taken from the last two Y arrays and used for transmit of frame E. so signal values 1 and 2 are discarded. Frame C is not ready for its next transmit. For the cyclic frame C.5 ms from the previous acknowledgment. every sample is interpreted as an event.0 ms. frame C transmits once every 2. so signal values 5 and 6 are taken from the first two Y arrays and used for transmit of frame C. Frame C transmits followed by frame E. The session resample rate property determines the time between waveform samples.0 ms in the frame timeline. the session starts within the call to nxWriteSignalWaveform. For the event-driven frame E. frame E is allowed to transmit again. In the waveforms. At index 3. every second sample is used to transmit.

Frame E is an event-driven frame that uses a transmit time (minimum interval) of 2.0 ms thereafter. one in the first byte and another in the second byte. frame C transmits again at 8. Signal Output XY Mode is the recommended mode for writing a sequence of signal values. Examples In this example network.Chapter 5 NI-XNET API for C Although not shown in the frame timeline. and no resampling occurs. Therefore. This mismatch between frame timing and waveform timing is a disadvantage of the Signal Output Waveform mode. followed by the value of its two signals. Unless your application requires correlation of output data with DAQmx waveforms. the array of signal values is mapped to an array of frames to transmit. The example uses CAN. it does not transmit after the timeline shown. such that every signal provided is transmitted in a frame. signals at the same index in the arrays are mapped to the same frame. The timestamp array is unused (reserved). Each signal value is mapped to a frame for transmit. Because the waveform timing is fixed. The timeline begins with a single call to nxWriteSignalXY. Each frame contains two signals. the frame transmits as if each sample was an event. the array size may be different from one cluster (signal) to another. frame C is a cyclic frame that transmits on the network once every 2.0 ms.5 ms. The frames for this mode are stored in queues. This is the recommended mode for writing a sequence of all signal values. The following figure shows a timeline of a frame transfer on the CAN network. the signal values provided to nxWriteSignalXY are mapped directly to transmitted frames. When you use the Signal Output XY Mode. Because frame E is event driven. Each frame contains its name (C or E). refer to the XNET Frame CAN:Timing Type and FlexRay:Timing Type properties. When signals exist in different frames. Frame C repeats signal values 5 and 6 until the next call to nxWriteSignalWaveform. Signal Output XY Mode This mode provides a sequence of signal values for transmit using each frame’s timing as specified in the database. For information about cyclic and event-driven frames. When signals exist in the same frame. When used for event driven frames. you cannot use it to represent events in the data.0 ms and every 2. because no new event has occurred. Use nxWriteSignalXY for this mode. © National Instruments Corporation 5-33 NI-XNET Hardware and Software Manual .

The session contains all four signals. This occurs at 0 ms in the timeline.8 4 ms 5 ms 6 ms 7 ms 8 ms The following figure shows the data provided to nxWriteSignalXY.Chapter 5 NI-XNET API for C Write C1. the session starts within a call to nxWriteSignalXY.6 E7. both using signal values from the first sample (index 0 of all four Y arrays).com . Frame C transmits followed by frame E.4 C5.8 Time 0 ms 1 ms 2 ms 3 ms E5. Assuming the Auto Start? property uses the default of true. NI-XNET Hardware and Software Manual 5-34 ni.6 C5.2 C3.

Chapter 5 NI-XNET API for C According to the database.4 X1. signal values 5 and 6 are taken from index 2 of the first two Y arrays and used for transmit of frame C. Because no new signal value was provided at index 1 in the fourth array.5 ms. Write C1. so the frame transmits again.0 ms in the timeline. and frame E is limited to an event-driven interval of 2. At 4. it represents a new event.6 C7. Frame E is event driven.8 Time 0 ms 1 ms X5. At 3.4 C5. Because frame C is a cyclic frame. If nxWriteSignalXY is called again.2 2 ms 3 ms 4 ms 5 ms 6 ms 7 ms 8 ms © National Instruments Corporation 5-35 NI-XNET Hardware and Software Manual . Each frame contains two signals. this frame no longer transmits. At 2.2 X1. Because this is a new value for frame E. the values of the previous frame are used again at 6.0 ms in the timeline and every 2.8 X7.6 X3. The next example network demonstrates a potential problem that can occur with Signal Output XY mode. The timeline begins with a single call to nxWriteSignalXY. signal value 5 is taken from index 1 of the third Y array. it transmits repeatedly.2 X1.0 ms.0 ms in the timeline. Although there are no more signal values for frame C. frame C is a cyclic frame that transmits on the network once every 2.0 ms. so new signal values are required for each transmit.2 X1.0 ms. In this example network. frame C transmits once every 2.0 ms thereafter.2 C3. Frame X is a cyclic frame that transmits on the network once every 1. Because there are no more signal values for frame E. the new signal values are used. one in the first byte and another in the second byte.5 ms in the timeline. signal values 3 and 4 are taken from index 1 of the first two Y arrays and used for transmit of frame C.2 X1. the second signal of frame E uses the value 8 from the previous transmit.

Chapter 5 NI-XNET API for C The following figure shows the data provided to nxWriteSignalXY. For an event-driven frame. The number of signal values in all four Y arrays is the same. The result is that the last pair of signals for frame X (1 and 2) transmit over and over. NI-XNET Hardware and Software Manual 5-36 ni. The Signal Output XY mode goal is to provide a complete sequence of signal values for each frame. and the overall timeline is not a major consideration. the frames for the last two arrays transmit twice as fast as the frames for the first two arrays. The problem is that because frame X transmits twice as fast as frame C. When you do this. this is not necessarily true for event-driven frames. The session contains all four signals. until the timeline has completed for frame C. If the previous call to nxWriteSignalXY provided eight elements for frame X (last two Y arrays) instead of just four elements. Although you need to resolve this sort of timeline for cyclic frames. each call to nxWriteSignalXY can generate a single event. this would have created a complete 8.0 ms timeline for both frames. The best way to resolve this issue is to provide a different number of values for each signal.com . The four elements of the arrays are mapped to four frames. such that the number of elements corresponds to the timeline for the corresponding frame. you may decide simply to pass either zero or one set of signal values to nxWriteSignalXY. This sort of behavior usually is unintended.

If you assign the interface to Port 2. If you assign the interface to Port 1. © National Instruments Corporation 5-37 NI-XNET Hardware and Software Manual . nxBlink Purpose Blinks LEDs for the XNET interface to identify its physical port in the system. u32 Modifier). Format nxStatus_t _NXFUNC nxBlink ( nxSessionRef_t InterfaceRef. This option turns off both LEDs for the port. Functions This section includes the NI-XNET functions. Both LEDs of the interface’s physical port turn on and off. Inputs nxSessionRef_t InterfaceRef The XNET Interface I/O name. Both LEDs blink green (not red). LEDs 3 and 4 blink. LEDs 1 and 2 blink. Enable (1) Enable blinking for identification. The blinking rate is approximately three times per second. The hardware blinks the LEDs automatically until you disable. u32 Modifier Controls LED blinking: Disable (0) Disable blinking for identification.Chapter 5 NI-XNET API for C NI-XNET API for C Reference This section describes the NI-XNET C functions and properties. so there is no need to call the nxBlink function repetitively.

A value of 0 indicates success. the LEDs for that physical port transition to the In Use state. Each port is labeled on the hardware as Port 1 or Port 2.Chapter 5 NI-XNET API for C Outputs Return Value nxStatus_t The error code the function returns in the event of an error or warning. For example. If you called the nxBlink function previously to enable blinking for identification. LED 1 is the In Use LED. Prior to running your XNET sessions. to indicate a session is in use. Description Each XNET device contains one or two physical ports.com . that LED behavior no longer applies. each with two ports. LEDs 1 and 2 are assigned to Port 1. off otherwise. you can call this function to blink the interface LEDs. The XNET device also provides four LEDs. A positive value indicates a warning. In Use LED: Solid green. A negative value indicates an error. Identification LED State You can use the nxBlink function only in the Identification state. and LEDs 3 and 4 are assigned to physical Port 2. this function helps to identify each interface to associate its software behavior to its hardware connection (port). The In Use LED state remains until all XNET sessions are cleared. to identify it among the six CAN ports. For Port 1. the two interface port LEDs behave as follows: • • Activity LED: Blinks green when communication is progressing. it returns an error. This typically occurs when the application terminates. In Use: LED behavior that XNET sessions control. For the In Use LED state. The LEDs of each port support two states: • • Identification: Blink LEDs to identify the physical port assigned to the interface. In Use LED State When you create an XNET session for the interface. and LED 2 is the Activity LED. NI-XNET Hardware and Software Manual 5-38 ni. If you call this function while one or more XNET sessions for the interface are open (created). because the port’s LEDs are in the In Use state. When your application uses multiple XNET devices. if you have a system with three PCI CAN cards. you can use this function to blink the LEDs for interface CAN4.

the Activity LED blinks as long as the interface state is running (communicating). the Activity LED blinks when any frame is received or transmitted. The Activity LED blinks in a pattern of three cycles: on long time. then pulse on again. For CAN. The entire cycle of three blinks take approximately one second. While the FlexRay interface is communicating. © National Instruments Corporation 5-39 NI-XNET Hardware and Software Manual . frames in static slots are continuously received/transmitted.Chapter 5 NI-XNET API for C For Port 2. then pulse on. and LED 4 is the Activity LED. LED 3 is the In Use LED. For FlexRay.

Inputs nxSessionRef_t SessionRef The reference to the session to clear. A positive value indicates a warning. if you create a session for a frame named frameA using Frame Output Single-Point mode. Description This function stops communication for the session and releases all resources the session uses. then you create a second session for frameA using Frame Output Queued mode. A negative value indicates an error. If you call nxClear before the second nxCreateSession call. Outputs Return Value nxStatus_t The error code the function returns in the event of an error or warning. NI-XNET Hardware and Software Manual 5-40 ni. A value of 0 indicates success. nxClear internally calls nxStop with normal scope. so if this is the last session using the interface. because frameA can be accessed using only one output mode. communication stops.Chapter 5 NI-XNET API for C nxClear Purpose Clears (closes) the XNET session. Format nxStatus_t nxClear ( nxSessionRef_t SessionRef).com . You typically use nxClear when you need to clear the existing session to create a new session that uses the same objects. For example. the second call to nxCreateSession returns an error. you can close the previous use of frameA to create the new session. This session reference is returned from nxCreateSession.

Format nxStatus_t _NXFUNC nxConnectTerminals ( nxSessionRef_t SessionRef. Internal terminals include timebases (clocks) and logical entities such as a start trigger. The XNET terminal represents an external or internal hardware connection point on a National Instruments XNET hardware product. const char * destination). Outputs Return Value nxStatus_t The error code the function returns in the event of an error or warning. const char * destination terminal The connection destination name. const char * source terminal The connection source name. A negative value indicates an error. The terminal inputs use the Terminal I/O names. const char * source. A positive value indicates a warning.Chapter 5 NI-XNET API for C nxConnectTerminals Purpose Connects terminals on the XNET interface. A value of 0 indicates success. External terminals include PXI Trigger lines for a PXI card or RTSI terminals for a PCI card. Description This function connects a source terminal to a destination terminal on the interface hardware. Inputs nxSessionRef_t SessionRef The reference to the session to use for the connection. one of the pair is an internal and the other an external. © National Instruments Corporation 5-41 NI-XNET Hardware and Software Manual . Typically.

these are the PXI Trigger lines. Selects a general-purpose Front Panel Trigger line as the connection source (input). Source Terminal PXI_Trigx Description Selects a general-purpose trigger line as the connection source (input). Source Terminals The following table describes the valid source terminals. For PXI cards. For PCI cards.Chapter 5 NI-XNET API for C Valid Combinations of Source/Destination The following table lists all valid combinations of source terminal and destination terminal. FrontPanel0 FrontPanel1 NI-XNET Hardware and Software Manual 5-42 ni. these are the RTSI lines. Valid only on FlexRay hardware.com . Destination Source PXI_Trigx FrontPanel0 FrontPanel1 PXI_Star1 PXI_Clk101 StartTrigger CommTrigger FlexRayStartCycle2 FlexRayMacrotick2 1MHzTimebase 10MHzTimebase 1 2 PXI_Trigx X X X X       FrontPanel0 FrontPanel1 X X X X      X Start Trigger    X X X X X X X Master Timebase   X  X X X  X X Valid only on PXI hardware.

You can route the start trigger of this XNET card to the start trigger of other XNET or DAQ cards to ensure that sampling begins at the same time on both cards. with both cards using the same PXI Trigger line for the connections. which is the event set when the Start Interface transition occurs. which is the event set when the Comm State Running transition occurs. StartTrigger Selects the start trigger.Chapter 5 NI-XNET API for C Source Terminal PXI_Star Description Selects the PXI star trigger signal. you can use this trigger to allow for the clock under this special circumstance. Because you cannot generate a start trigger to another interface until the synchronization clock is also available. you can synchronize two XNET cards by routing StartTrigger as the source terminal on one XNET card and then routing StartTrigger as the destination terminal on the other XNET card. For example. The communicating trigger is similar to a start trigger. The only valid destination terminal for this source is MasterTimebase. The communicating trigger is the same for all sessions using a given interface. some PXI products can source star trigger from Slot 2 to all higher-numbered slots. which is not available until the interface is properly integrated into the bus. you also must use PXI_Clk10 as the timebase for other PXI cards to perform synchronized input/output. Note: You cannot use this terminal with a PCI device. PXI_Clk10 Selects the PXI 10 MHz backplane clock. The start trigger is the same for all sessions using a given interface. © National Instruments Corporation 5-43 NI-XNET Hardware and Software Manual . CommTrigger Selects the communicating trigger. Within a PXI chassis. When you use PXI_Clk10 as the XNET card timebase. Note: You cannot use this terminal with a PCI device. PXI_Star enables the PXI XNET hardware to receive the star trigger when it is in Slot 3 or higher. You can route the communicating trigger of this XNET card to the start trigger of other XNET or DAQ cards to ensure that sampling begins at the same time on both cards. but is used if your clock source is the FlexRayMacrotick. This routes the 10 MHz PXI backplane clock for use as the XNET card timebase.

This generates a repeating pulse that external hardware can use to synchronize a measurement or other action with each FlexRay cycle. This source terminal routes the XNET card local 1 MHz clock so that other NI cards can use it as a timebase. you can synchronize two XNET cards by connecting 10MHzTimebase to PXI_Trigx on one XNET card and then connecting PXI_Trigx to MasterTimebase on the other XNET card. you would configure the FlexRayMacrotick as the source terminal and route it to a PXI Trigger or front panel terminal. NI-XNET Hardware and Software Manual 5-44 ni. The only valid destination terminals for this source are PXITrigger0–PXITrigger7. Note: You can use this terminal only with a FlexRay device. you can synchronize two XNET cards by connecting 1MHzTimebase to PXI_Trigx on one XNET card and then connecting PXI_Trigx to MasterTimebase on the other XNET card. In this scenario. the Macrotick signal becomes available. For example. 1MHzTimebase Selects the XNET card’s local 1 MHz oscillator.com . You can use this source terminal to synchronize other measurements to the actual time on the FlexRay bus. This routes the XNET card local 10 MHz clock for use as a timebase by other NI cards. and also allows you to read the FlexRay cycle macrotick to do additional synchronization with the FlexRay bus in your application. Note: You can use this terminal only with a FlexRay device. The FlexRay Macrotick is the basic unit of time in a FlexRay network.Chapter 5 NI-XNET API for C Source Terminal FlexRayStartCycle Description Selects the FlexRay Start of Cycles as an advanced trigger source. FlexRayMacrotick Selects the FlexRay Macrotick as a timing source. You also can connect the FlexRayMacrotick to the MasterTimebase. 10MHzTimebase Selects the XNET card’s local 10 MHz oscillator. This configures the counter that timestamps received frames to run synchronized to FlexRay time. After the interface is communicating to the FlexRay network. For example.

10 MHz. these are the RTSI lines. and automatically detects the frequency without any additional configuration. you also can use PXI_Clk10 as the source terminal. you can synchronize with an M-Series DAQ MIO card by routing the AI start trigger of the MIO card to a RTSI line and then routing the same PXI Trigger line with StartTrigger as the destination terminal on the XNET card. © National Instruments Corporation 5-45 NI-XNET Hardware and Software Manual . and then connecting the same PXI_Trig line as the source terminal. these are the PXI Trigger lines. Destination Terminal PXI_Trigx Description Selects a general-purpose trigger line as the connection destination (output). For example. This causes the Start Interface transition to occur. and 20 MHz. Selects the start trigger. For PCI cards. For example. Your XNET hardware supports incoming frequencies of 1 MHz. For PXI cards. Alternately.Chapter 5 NI-XNET API for C Destination Terminals The following table describes the valid destination terminals. FrontPanel0 FrontPanel1 StartTrigger MasterTimebase MasterTimebase instructs the XNET card to use the connection source terminal as the master timebase. The default (disconnected) state of this destination means the start trigger occurs when nxStart is invoked with the scope set to either Normal or Interface Only. reading or writing to a session may start the interface. For PXI form factor hardware. This receives the PXI 10 MHz backplane clock for use as the master timebase. which is the event that allows the interface to begin communication. You can route the start trigger of another XNET or DAQ card to ensure that sampling begins at the same time on both cards. The start trigger occurs on the first source terminal low-to-high transition. The XNET card uses this master timebase for input sampling (including timestamps of received messages) as well as periodic output sampling. you can synchronize a CAN and DAQ M Series MIO card by connecting the 10 MHz oscillator (board clock) of the DAQ card to a PXI_Trig line. The start trigger is the same for all sessions using a given interface. if Auto Start? is enabled. Selects a general-purpose Front Panel Trigger line as the connection destination (output).

If you are using a PCI board. the hardware automatically uses the local oscillator as the default MasterTimebase. In this case. the default connection to the Master Timebase is the local oscillator. If you are using a PXI board. NI-XNET Hardware and Software Manual 5-46 ni. Some chassis allow PXI_Clk10 to be turned off.Chapter 5 NI-XNET API for C Destination Terminal Description MasterTimebase applies separately to each port of a multiport XNET card. if it is available. the default connection to the MasterTimebase is the PXI_Clk10 signal. meaning you could run each port off of a separate incoming (or onboard) timebase signal.com .

const char * List Provides the list of signals or frames for the session. nxSessionRef_t * SessionRef). const char * ClusterName The XNET cluster to use for interface configuration. If it is left blank. const char * Interface. The name must specify a cluster from the database given in the DatabaseName parameter. Format nxStatus_t nxCreateSession ( const char * DatabaseName. the cluster is extracted from the List parameter. The database name must use the <alias> or <filepath> syntax (refer to Databases). this is not allowed for modes of nxMode_FrameInStream or nxMode_FrameOutStream. const char * ClusterName. const char * List. u32 Mode.Chapter 5 NI-XNET API for C nxCreateSession Purpose Creates an XNET session at run time using strings. Inputs const char * DatabaseName The XNET database to use for interface configuration. © National Instruments Corporation 5-47 NI-XNET Hardware and Software Manual .

whichever uniquely identifies a signal within the database given in the DatabaseName parameter.Chapter 5 NI-XNET API for C The List syntax depends on the mode: Mode nxMode_SignalInSinglePoint.<Signal>.<Signal>. whichever uniquely identifies a frame within the database given in the DatabaseName parameter. Each name must be <Frame> or <Cluster>. If more than one name is provided. nxMode_FrameOutQueued nxMode_FrameInSinglePoint.<Signal>.<Frame>. List is empty (“ ”).<Frame>. If more than one name is provided. nxMode_FrameOutSinglePoint NI-XNET Hardware and Software Manual 5-48 ni. a comma must separate each name. whichever uniquely identifies a signal within the database given in the DatabaseName parameter. nxMode_FrameOutStream nxMode_FrameInQueued. nxMode_SignalOutSinglePoint List Syntax List contains one or more XNET Signal names. List contains one or more XNET Frame names.<Frame>. or <Cluster>.<Signal>. Each name must be <Signal>. <Frame>. or <Cluster>. nxMode_SignalOutXY nxMode_FrameInStream. Each name must be <Signal>. List contains only one XNET Frame name.<Frame>. Each name must be <Signal>. nxMode_SignalOutWaveform List contains one or more XNET Signal names. <Frame>. List contains one or more XNET Signal names. Only one name is supported. a comma must separate each name. If more than one name is provided. a comma must separate each name. or <Cluster>. If more than one name is provided.<Signal>. whichever uniquely identifies a frame within the database given in the DatabaseName parameter. nxMode_SignalInXY.com . a comma must separate each name. nxMode_SignalInWaveform. whichever uniquely identifies a signal within the database given in the DatabaseName parameter.<Signal>. <Frame>.<Frame>. Each name must be <Frame> or <Cluster>.

A value of 0 indicates success.Chapter 5 NI-XNET API for C const char * Interface The XNET Interface to use for this session. © National Instruments Corporation 5-49 NI-XNET Hardware and Software Manual . A negative value indicates an error.h: nxMode_SignalInSinglePoint nxMode_SignalInWaveform nxMode_SignalInXY nxMode_SignalOutSinglePoint nxMode_SignalOutWaveform nxMode_SignalOutXY nxMode_FrameInStream nxMode_FrameInQueued nxMode_FrameInSinglePoint nxMode_FrameOutStream nxMode_FrameOutQueued nxMode_FrameOutSinglePoint 0 1 2 3 4 5 6 7 8 9 10 11 Outputs nxSessionRef_t* SessionRef Returns the handle to the session created. Pass this value to any other NI-XNET API functions. Return Value nxStatus_t The error code the function returns in the event of an error or warning. Description This function creates a session using the named database objects specified in List from the database named in DatabaseName. It can be one of the following constants defined in nixnet. u32 Mode The session mode. A positive value indicates a warning.

nxMode_FrameOutSinglePoint ArrayOfDatabaseRef Syntax ArrayOfDatabaseRef contains one or more XNET Signal refs. nxMode_SignalOutWaveform nxMode_SignalInXY. nxMode_FrameOutStream nxMode_FrameInQueued. depending on the mode: Mode nxMode_SignalInSinglePoint. nxMode_SignalOutXY nxMode_FrameInStream. This can be an array of signal references. nxSessionRef_t * SessionRef). nxDatabaseRef_t *ArrayOfDatabaseRef The array of database objects to be used in the session. Inputs u32 NumberOfDatabaseRef The number of references passed in ArrayOfDatabaseRef.com . nxMode_FrameOutQueued nxMode_FrameInSinglePoint. or a single cluster reference. const char * Interface. ArrayOfDatabaseRef contains only one XNET Frame ref.Chapter 5 NI-XNET API for C nxCreateSessionByRef Purpose Creates an XNET session at run time using database references. ArrayOfDatabaseRef contains one or more XNET Frame refs. nxDatabaseRef_t * ArrayOfDatabaseRef. ArrayOfDatabaseRef contains one or more XNET Signal refs. nxMode_SignalOutSinglePoint nxMode_SignalInWaveform. ArrayOfDatabaseRef contains only one XNET Cluster ref. Format nxStatus_t nxCreateSessionByRef ( u32 NumberOfDatabaseRef. u32 Mode. ArrayOfDatabaseRef contains one or more XNET Signal refs. an array of frame references. NI-XNET Hardware and Software Manual 5-50 ni.

Description This function creates a session using the referenced database objects from an open database specified in ArrayOfDatabaseRef. A value of 0 indicates success.h: nxMode_SignalInSinglePoint nxMode_SignalInWaveform nxMode_SignalInXY nxMode_SignalOutSinglePoint nxMode_SignalOutWaveform nxMode_SignalOutXY nxMode_FrameInStream nxMode_FrameInQueued nxMode_FrameInSinglePoint nxMode_FrameOutStream nxMode_FrameOutQueued nxMode_FrameOutSinglePoint 0 1 2 3 4 5 6 7 8 9 10 11 Outputs nxSessionRef_t* SessionRef Returns the handle to the session created. u32 Mode The session mode. It can be one of the following constants defined in nixnet.Chapter 5 NI-XNET API for C const char * Interface The XNET Interface to use for this session. A positive value indicates a warning. © National Instruments Corporation 5-51 NI-XNET Hardware and Software Manual . A negative value indicates an error. Pass this value to any other NI-XNET API functions. Return Value nxStatus_t The error code the function returns in the event of an error or warning.

Chapter 5 NI-XNET API for C nxdbAddAlias Purpose Adds a new alias to a database file. this function changes the previous filepath to the specified filepath. the default baud rate parameter is ignored.com . Outputs Return Value nxStatus_t The error code the function returns in the event of an error or warning. A negative value indicates an error. Use this default baud rate to specify a default CAN baud rate to use with this alias. and NI-XNET uses that baud rate as the default. These database formats are specific to CAN and do not specify a cluster baud rate.dbc) or an NI-CAN database (. The FIBEX database format requires a valid baud rate for every CAN and FlexRay cluster. If the alias name already exists.ncd). NI-XNET Hardware and Software Manual 5-52 ni. the alias name can use special characters such as space and dash. const char * DatabaseFilepath. Format nxStatus_t _NXFUNC nxdbAddAlias ( const char * DatabaseAlias. A positive value indicates a warning. u32 DefaultBaudRate Provides the default baud rate. A value of 0 indicates success. used when filepath refers to a CANdb database (. Inputs const char * DatabaseAlias Provides the desired alias name. If filepath refers to a FIBEX database (. const char * DatabaseFilepath Provides the path to the CANdb or FIBEX file. u32 DefaultBaudRate).xml). Unlike the names of other XNET database objects.

you can pass the new alias to nxdbDeploy to transfer an optimized binary image of the database to the RT target. The alias names provide a shorter name for display. For RT targets.Chapter 5 NI-XNET API for C Description NI-XNET uses alias names for database files. This function is supported on Windows only. After deploying the database. © National Instruments Corporation 5-53 NI-XNET Hardware and Software Manual . allow for changes to the file system without changing the application. you can use the alias name in any application for the Windows host and RT target. and enable efficient deployment to LabVIEW Real-Time (RT) targets.

For the case that different threads of an application are using the same database. Description This function closes a database. nxdbOpenDatabase and nxdbCloseDatabase maintain a reference counter indicating how many times the database is open. A negative value indicates an error. or just the reference counter should be decremented (CloseAllRefs = 0). and close the database independently using CloseAllRefs = 0. even if some threads could not execute nxdbCloseDatabase. Inputs nxDatabaseRef_t DatabaseRef The reference to the database to close. and the database remains open. A positive value indicates a warning.Chapter 5 NI-XNET API for C nxdbCloseDatabase Purpose Closes the database. using CloseAllRefs = 1. When the database is closed completely. which closes access for all other threads. all references to objects in this database become invalid. u32 CloseAllRefs Indicates that a database open multiple times (refer to nxdbOpenDatabase) should be closed completely (CloseAllRefs = 1). for example. Format nxStatus_t _NXFUNC nxdbCloseDatabase ( nxDatabaseRef_t DatabaseRef. A value of 0 indicates success. u32 CloseAllRefs). Only the last call to nxdbCloseDatabase actually closes access to the database. work with it. This may be convenient when.com . Another option is that only one thread executes nxdbCloseDatabase once. the main program needs to stop all running threads and be sure the database is closed properly. Outputs Return Value nxStatus_t The error code the function returns in the event of an error or warning. Every thread can open the database. NI-XNET Hardware and Software Manual 5-54 ni.

Return Value nxStatus_t The error code the function returns in the event of an error or warning. A negative value indicates an error. © National Instruments Corporation 5-55 NI-XNET Hardware and Software Manual . u32 ObjectClass The class of object to be created. You first must open a database file using nxdbOpenDatabase. and underscore (_). and not a number. A value of 0 indicates success. dot (. numbers. A positive value indicates a warning. const char * ObjectName. Inputs nxDatabaseRef_t ParentObjectRef The reference to the parent database object.). Valid characters for the name are lowercase letters. The name must be unique for all database objects of the same class in a database. Format nxStatus_t _NXFUNC nxdbCreateObject ( nxDatabaseRef_t ParentObjectRef. u32 ObjectClass. and other special characters are not supported within the name.Chapter 5 NI-XNET API for C nxdbCreateObject Purpose Creates a new XNET cluster. Space ( ). The name is limited to 128 characters. Outputs nxDatabaseRef_t * DbObjectRef The reference to the newly created database object. uppercase letters. nxDatabaseRef_t * DbObjectRef). The name must begin with a letter (uppercase or lowercase) or underscore. const char * ObjectName The name of the database object to create.

. The ObjectName input becomes the nxProp._Name property of the created object The database object is created and remains in memory until the database is closed.Chapter 5 NI-XNET API for C Description This function creates an XNET database object. This function does not change the open database file on disk. NI-XNET Hardware and Software Manual 5-56 ni. use nxdbSaveDatabase.. To save the newly created object to the file.com .

Inputs nxDatabaseRef_t DbObjectRef References the database object to delete. The objects are deleted from a database in memory. To save the changed database to the file. the references to all deleted objects are closed and no longer can be used.Chapter 5 NI-XNET API for C nxdbDeleteObject Purpose Deletes an XNET database object and all its child objects. A positive value indicates a warning. © National Instruments Corporation 5-57 NI-XNET Hardware and Software Manual . Outputs Return Value nxStatus_t The error code the function returns in the event of an error or warning. This function does not change the open database file on disk. A value of 0 indicates success. use nxdbSaveDatabase. Format nxStatus_t _NXFUNC nxdbDeleteObject ( nxDatabaseRef_t DbObjectRef). A negative value indicates an error. The change is in force until the database is closed. Description This function deletes an XNET database object with all its child objects. Upon deletion.

const char * DatabaseAlias. Inputs const char * IPAddress The target IP address.Chapter 5 NI-XNET API for C nxdbDeploy Purpose Deploys a database to a remote Real-Time (RT) target. u32 WaitForComplete. u32 WaitForComplete Determines whether the function returns directly or waits until the entire transmission is completed. A value of 0 indicates success. you can use the alias name in any application for the Windows host and the LabVIEW RT target. After deploying the database. To deploy a database text file. A positive value indicates a warning. Outputs u32 * PercentComplete Indicates the deployment progress. Format nxStatus_t _NXFUNC nxdbDeploy ( const char * IPAddress. u32 * PercentComplete). Description This function transfers an optimized binary image of the database to the RT target. Return Value nxStatus_t The error code the function returns in the event of an error or warning. NI-XNET Hardware and Software Manual 5-58 ni. A negative value indicates an error. first add an alias using nxdbAddAlias.com . const char * DatabaseAlias Provides the database alias name.

so IPAddress must specify a valid IP address for the RT target. then returns. The return value reflects the deployment status. You must call nxdbDeploy in a loop until PercentComplete is returned as 100. at which time the return value reflects the entire deployment status. If WaitForComplete is true. If WaitForComplete is false. You can find this IP address using MAX.Chapter 5 NI-XNET API for C This function is supported on Windows only. this function waits for the entire transfer to complete. © National Instruments Corporation 5-59 NI-XNET Hardware and Software Manual . especially when the RT target is far away. If the RT target access is password protected. You can use PercentComplete to display transfer progress on your front panel. For an incomplete transfer. use the following syntax for the IP address to deploy an alias: [user:password@]IPaddress. and PercentComplete is 100. This function must access the remote RT target from Windows. the return value returns success. RT database deployments are managed remotely from Windows. this function transfers a portion of the database and returns before it is complete. Remote file transfer can take a few seconds. and PercentComplete is less than 100.

Unlike nxdbCreateObject. Return Value nxStatus_t The error code the function returns in the event of an error or warning.Chapter 5 NI-XNET API for C nxdbFindObject Purpose Finds an object in the database. Format nxStatus_t _NXFUNC nxdbFindObject ( nxDatabaseRef_t ParentObjectRef. this function allows ParentObjectRef to be a grandparent or great-grandparent. NI-XNET Hardware and Software Manual 5-60 ni.com . u32 ObjectClass The class of the object to find. Inputs nxDatabaseRef_t ParentObjectRef The reference to the parent object. const char * ObjectName. A value of 0 indicates success. Outputs nxDatabaseRef_t * DbObjectRef A reference to the found object that you can use in subsequent function calls to reference the object. Description This function finds an object relative to a parent object. A negative value indicates an error. nxDatabaseRef_t * DbObjectRef). const char * ObjectName The name of the object to find. u32 ObjectClass. A positive value indicates a warning.

mySignal. you must include the frame name as a prefix. the ObjectName to search for must be qualified such that it is unique within the scope of ParentObjectRef. NI-XNET supports the following database classes: • • • • • nxClass_Cluster nxClass_Frame nxClass_Signal nxClass_Subframe nxClass_ECU © National Instruments Corporation 5-61 NI-XNET Hardware and Software Manual . You must call this function to get a reference to a database object before you can access it. such as myFrameA. For example. frame for signal). if the class of ParentObjectRef is nxClass_Cluster. If not. assuming that signal name is unique to the cluster.Chapter 5 NI-XNET API for C If ParentObjectRef is a direct parent (for example. If ParentObjectRef is not a direct parent (for example. and the search proceeds quickly. the ObjectName to search for can be short. you can specify ObjectName of mySignal. database for signal). and ObjectClass is nxClass_Signal.

this list always is empty. u32 * NumberOfDatabases). the list is empty. If IPAddress is a valid IP address. u32 SizeofAliasBuffer The size of the buffer provided to take the list of alias names. If no aliases are registered. char * FilepathBuffer. u32 SizeofFilepathBuffer The size of the buffer provided to take the list of filepaths of the database files. You can find this IP address using MAX. If IPAddress is an empty string. Outputs char * AliasBuffer Returns a comma-separated list of strings. on RT targets. this function retrieves aliases and file paths for the remote RT target.Chapter 5 NI-XNET API for C nxdbGetDatabaseList Purpose Gets the current list of databases on a system. NI-XNET Hardware and Software Manual 5-62 ni. This parameter applies to Windows targets only. u32 * NumberOfDatabases Returns the number of databases registered on the system.com . this function retrieves aliases and file paths for the local Windows system. Inputs const char * IPAddress The target IP address. char * FilepathBuffer Returns a comma-separated list of strings that contain the file paths and filenames of the databases assigned to the aliases. Format nxStatus_t _NXFUNC nxdbGetDatabaseList ( const char * IPAddress. char * AliasBuffer. one for every alias registered in the system. u32 SizeofAliasBuffer. the list is empty. If no aliases are registered. one for every alias registered in the system. u32 SizeofFilepathBuffer.

FilepathBuffer returns a comma-separated list of file paths. A negative value indicates an error. FilepathBuffer is empty. This call checks for the existence of the database file and removes any aliases that are no longer valid. This function is supported on Windows only. so that only the alias is needed. Description For a local Windows call (IP address empty). It provides the Windows file path for each corresponding alias. A positive value indicates a warning. For a remote call to RT.Chapter 5 NI-XNET API for C Return Value nxStatus_t The error code the function returns in the event of an error or warning. RT database deployments are managed remotely from Windows. © National Instruments Corporation 5-63 NI-XNET Hardware and Software Manual . The number of elements in this list is the same as in AliasBuffer. A value of 0 indicates success. NI-XNET handles the file system on the RT target automatically.

NI-XNET Hardware and Software Manual 5-64 ni.Chapter 5 NI-XNET API for C nxdbGetDatabaseListSizes Purpose Gets the buffer sizes required to read the current list of databases on a system. If IPAddress is a valid IP address. this function retrieves aliases and file paths for the local Windows system. u32 SizeofFilepathBuffer Size of the buffer needed to take the list of file paths of the database files. Format nxStatus_t _NXFUNC nxdbGetDatabaseListSizes ( const char * IPAddress. A positive value indicates a warning. A value of 0 indicates success. u32 SizeofAliasBuffer Size of the buffer provided to take the list of alias names. Inputs const char * IPAddress The target IP address. u32 SizeofFilepathBuffer Size of the buffer provided to take the list of file paths of the database files. Outputs u32 SizeofAliasBuffer Size of the buffer needed to take the list of alias names. u32 * SizeofAliasBuffer. this function retrieves aliases and file paths for the remote RT target. u32 * SizeofFilepathBuffer). Return Value nxStatus_t The error code the function returns in the event of an error or warning. A negative value indicates an error.com . If IPAddress is an empty string. You can find this IP address using MAX.

Chapter 5 NI-XNET API for C Description For a local Windows call (IP address empty). © National Instruments Corporation 5-65 NI-XNET Hardware and Software Manual . SizeofFilepathBuffer returns the size of a buffer needed to query the list of file paths. so that only the alias is needed. RT database deployments are managed remotely from Windows. NI-XNET handles the file system on the RT target automatically. For a remote call to RT. This function is supported on Windows only. SizeofFilepathBuffer is empty.

com NI-XNET Hardware and Software Manual .Chapter 5 NI-XNET API for C nxdbGetProperty Format nxStatus_t _NXFUNC nxdbGetProperty ( nxDatabaseRef_t DbObjectRef. Return Value nxStatus_t The error code the function returns in the event of an error or warning. u32 PropertyID Specifies the ID of the property to get. A value of 0 indicates success. Refer to the following sections for information about properties you can use with this function: • • • • • • XNET Cluster Properties XNET Database Properties XNET ECU Properties XNET Frame Properties XNET Signal Properties XNET Subframe Properties 5-66 ni. Description This function is used to read properties for an XNET Database object. A negative value indicates an error. Inputs nxDatabaseRef_t DbObjectRef The reference to the database object to get the property value for. Outputs void * PropertyValue A void pointer to a buffer that receives the property value. u32 PropertyID. u32 PropertySize The size of the property to get. void * PropertyValue). A positive value indicates a warning. u32 PropertySize.

A negative value indicates an error. A value of 0 indicates success. Description Use this function to get a property value size in bytes. u32 PropertyID Specifies the ID of the property for which to get the size. u32 PropertySize The size of the property to get. Inputs nxDatabaseRef_t DbObjectRef The reference to the database object for which to get the property value size. Outputs u32 PropertySize The size of the property value in bytes. Refer to the following sections for information about properties you can use with this function: • • • • • • XNET Cluster Properties XNET Database Properties XNET ECU Properties XNET Frame Properties XNET Signal Properties XNET Subframe Properties © National Instruments Corporation 5-67 NI-XNET Hardware and Software Manual .Chapter 5 NI-XNET API for C nxdbGetPropertySize Format nxStatus_t _NXFUNC nxdbGetPropertySize ( nxDatabaseRef_t DbObjectRef. Return Value nxStatus_t The error code the function returns in the event of an error or warning. A positive value indicates a warning. u32 PropertyID. u32 * PropertySize).

When an already open database is opened. Outputs nxDatabaseRef_t * DatabaseRef A reference to the database that you can use in subsequent function calls to reference the database. NI-XNET Hardware and Software Manual 5-68 ni. Return Value nxStatus_t The error code the function returns in the event of an error or warning.Chapter 5 NI-XNET API for C nxdbOpenDatabase Purpose Opens a database file. A negative value indicates an error. the access to this database remains granted. A positive value indicates a warning. Until it is completely closed. A value of 0 indicates success. nxDatabaseRef_t * DatabaseRef). Inputs const char * DatabaseName The cluster to open. A multiple referenced (open) database must be closed as many times as it has been opened.com . this function grants access to the same database and increases an internal reference counter. For more information. and the database uses computer resources (memory and handles). refer to nxdbCloseDatabase. Format nxStatus_t _NXFUNC nxdbOpenDatabase ( const char * DatabaseName. Description This function opens a database.

Use nxdbUndeploy to remove an alias from a Real-Time (RT) target. but does not affect the database text file. © National Instruments Corporation 5-69 NI-XNET Hardware and Software Manual . Format nxStatus_t _NXFUNC nxdbRemoveAlias ( const char * DatabaseAlias). Description This function removes the alias from NI-XNET. and the alias is removed from Windows only (not RT targets). Inputs const char * DatabaseAlias The name of the alias to delete. It just removes the alias association to the database file path. A value of 0 indicates success.Chapter 5 NI-XNET API for C nxdbRemoveAlias Purpose Removes a database alias from the system. Outputs Return Value nxStatus_t The error code the function returns in the event of an error or warning. A positive value indicates a warning. This function is supported on Windows only. A negative value indicates an error.

A negative value indicates an error. const char * DbFilepath).1 file. const char * DbFilepath Contains the pathname to the FIBEX file or is empty (saves to the original file path). For example. If opened as a file path. A positive value indicates a warning. XNET saves to the FIBEX file only features that XNET sessions use to communicate on the network.com . Description This function saves the XNET database current state to a FIBEX 2.0 and offset 0. the target file may be missing details from the original file. The file extension must be . XNET converts this to a linear scaling with factor 1. If the original FIBEX file used a rational equation that cannot be expressed as a linear scaling. Saving a database is not supported under Real-Time (RT). If DbFilepath is empty. Format nxStatus_t _NXFUNC nxdbSaveDatabase ( nxDatabaseRef_t DatabaseRef. If the original file was created using non-XNET software. Inputs nxDatabaseRef_t DatabaseRef References the database.0. the file is saved to the same FIBEX file specified when opened. NI-XNET Hardware and Software Manual 5-70 ni. If the target file exists.0.xml. NI-XNET supports only linear scaling. it uses that file path. A value of 0 indicates success.Chapter 5 NI-XNET API for C nxdbSaveDatabase Purpose Saves the open database to a FIBEX 2.0.1 file. Outputs Return Value nxStatus_t The error code the function returns in the event of an error or warning. it is overwritten. If opened as an alias. it uses the file path registered for that alias. but you can deploy and use a database saved on Windows on a Real-Time (RT) target (refer to nxdbDeploy).

A value of 0 indicates success. A positive value indicates a warning. u32 PropertySize. Inputs nxDatabaseRef_t DbObjectRef The reference to the database object for which to get the property value. A negative value indicates an error. u32 PropertyID.Chapter 5 NI-XNET API for C nxdbSetProperty Format nxStatus_t _NXFUNC nxdbSetProperty ( nxDatabaseRef_t DbObjectRef. Refer to the following sections for information about properties you can use with this function: • • • • • • XNET Cluster Properties XNET Database Properties XNET ECU Properties XNET Frame Properties XNET Signal Properties XNET Subframe Properties 5-71 NI-XNET Hardware and Software Manual © National Instruments Corporation . Return Value nxStatus_t The error code the function returns in the event of an error or warning. Outputs void * PropertyValue A void pointer to a buffer that contains the property value to set. void * PropertyValue). u32 PropertyID Specifies the ID of the property to set. u32 PropertySize The size of the property to set. Description Use this function to write properties for an XNET Database object.

Outputs Return Value nxStatus_t The error code the function returns in the event of an error or warning. RT database deployments are managed remotely from Windows.com . Inputs const char * IPAddress The target IP address. const char * DatabaseAlias). Format nxStatus_t _NXFUNC nxdbUndeploy ( const char * IPAddress. A positive value indicates a warning. A negative value indicates an error. const char * DatabaseAlias Provides the database alias name. This function must access the remote RT target from Windows. you can use the following syntax for the IP address to undeploy an alias: [user:password@]IPaddress. You can find this IP address using MAX. Description This function completely deletes the database file and its alias from the RT target. so IPAddress must specify a valid IP address for the RT target. NI-XNET Hardware and Software Manual 5-72 ni. This function is supported on Windows only.Chapter 5 NI-XNET API for C nxdbUndeploy Purpose Undeploys a database from a remote LabVIEW Real-Time (RT) target. If the RT target access is password protected. A value of 0 indicates success.

Chapter 5 NI-XNET API for C nxDisconnectTerminals Purpose Disconnects terminals on the XNET interface. Therefore. Outputs Return Value nxStatus_t The error code the function returns in the event of an error or warning. const char * source terminal The connection source name. A positive value indicates a warning. NI-XNET automatically disconnects all terminal connections for that interface. const char * destination terminal The connection destination name. To disconnect a terminal. you first must stop the interface using nxStop with the Interface Only scope. Format nxStatus_t _NXFUNC nxDisconnectTerminals ( nxSessionRef_t SessionRef. This function typically is used to change terminal connections dynamically while an application is running. Then you can call nxDisconnectTerminals and © National Instruments Corporation 5-73 NI-XNET Hardware and Software Manual . When the final session for a given interface is cleared. const char * destination). Description This function disconnects a specific pair of source/destination terminals previously connected with nxConnectTerminals. nxDisconnectTerminals is not required for most applications. A negative value indicates an error. Inputs nxSessionRef_t SessionRef The reference to the session to use for the connection. A value of 0 indicates success. const char * source.

Finally. you can call nxStart with the Interface Only scope to restart the interface.com . NI-XNET Hardware and Software Manual 5-74 ni. You can disconnect only a terminal that has been previously connected.Chapter 5 NI-XNET API for C nxConnectTerminals to adjust terminal connections. Attempting to disconnect a nonconnected terminal results in an error.

no frames transmit. If you call nxFlush between nxStop and nxStart. For output sessions. then immediately call nxStop. if you call nxWrite to write three frames. all sessions use queues to store frames. Use nxFlush to empty all values from the session’s queues. © National Instruments Corporation 5-75 NI-XNET Hardware and Software Manual . but not transmitted successfully. Format nxStatus_t _NXFUNC nxFlush ( nxSessionRef_t SessionRef). you obtain the three frames received earlier. A value of 0 indicates success. If you call nxFlush between nxStop and nxStart. Inputs nxSessionRef_t SessionRef The reference to the session to flush. This session is from nxCreateSession. then call nxStop. nxRead returns only frames received after the calling nxStart. the three frames transmit. A negative value indicates an error. the queues store frame values provided to nxWrite. Description With the exception of single-point modes. then call nxRead. the three frames remains in the queue. if you receive three frames. the queues store frame values (or corresponding signal values) that have been received. Outputs Return Value nxStatus_t The error code the function returns in the event of an error or warning. potentially followed by other frames received after calling nxStart. nxStart and nxStop have no effect on these queues. A positive value indicates a warning. For input modes. then call nxStart a few seconds later. As another example. If you call nxStart a few seconds later. but not obtained by calling nxRead. For example.Chapter 5 NI-XNET API for C nxFlush Purpose Flushes (empties) all XNET session queues.

This can be a fixed-size (for example. Outputs void * PropertyValue Returns the value of the desired property. 4 bytes for an u32 property) or variable-sized buffer. u32 PropertyID. u32 PropertySize. Return Value nxStatus_t The error code the function returns in the event of an error or warning. This session is returned from nxCreateSession. Inputs nxSessionRef_t SessionRef The session to get the property from. A positive value indicates a warning.com .Chapter 5 NI-XNET API for C nxGetProperty Purpose Retrieves an XNET session property. If the property has variable size (for example. Format nxStatus_t nxGetProperty ( nxSessionRef_t SessionRef. u32 PropertySize The number of bytes provided for the buffer passed to PropertyValue. u32 PropertyID The ID of the property desired.h. call nxGetPropertySize to retrieve the necessary size of the buffer beforehand. The appropriate constants are listed in the Properties section and defined in nixnet. A negative value indicates an error. NI-XNET Hardware and Software Manual 5-76 ni. A value of 0 indicates success. a string property whose size is determined at runtime). void * PropertyValue).

Chapter 5 NI-XNET API for C Description Refer to the following sections for information about properties you can use with this function: • • • • XNET Device Properties XNET Interface Properties XNET Session Properties XNET System Properties © National Instruments Corporation 5-77 NI-XNET Hardware and Software Manual .

A value of 0 indicates success. Inputs nxSessionRef_t SessionRef The session to get the property from.Chapter 5 NI-XNET API for C nxGetPropertySize Purpose Retrieves the data size of an XNET session property. The appropriate constants are listed in the Properties section and defined in nixnet. the property size returned includes the space for the terminating NUL byte.h. This session is returned from nxCreateSession. Return Value nxStatus_t The error code the function returns in the event of an error or warning. A positive value indicates a warning. Outputs u32 * PropertySize Returns the number of bytes to be provided for the buffer to retrieve the property. Note For string properties. u32 PropertyID. A negative value indicates an error. u32 * PropertySize).com . Pass a buffer of that size to nxGetProperty. Description Refer to the following sections for information about properties you can use with this function: • • • • XNET Device Properties XNET Interface Properties XNET Session Properties XNET System Properties NI-XNET Hardware and Software Manual 5-78 ni. Format nxStatus_t nxGetPropertySize ( nxSessionRef_t SessionRef. u32 PropertyID The ID of the property desired.

not the number of frames. If you want to read a specific number of CAN frames. void * Buffer. so you must use at least that number. within which the first 24 bytes encode the first frame. This number does not represent the number of frames to read. f64 Timeout The time to wait for number to read frame bytes to become available. the data array size is no greater than this number. multiply that number by 24. the buffer might return 80 bytes. Frame Input Queued Mode. this read may return fewer bytes in Buffer. If SizeOfBuffer is positive. for a total of 80 bytes. the first 24 bytes in size. and the next 56 bytes encode the second frame. For example. Therefore. To avoid returning a partial frame. u32 SizeOfBuffer The number of bytes desired.Chapter 5 NI-XNET API for C nxReadFrame Purpose Reads data from a session as an array of raw bytes. During the read. u32 * NumberOfBytesReturned). The session mode must be Frame Input Stream Mode. even when SizeOfBuffer bytes are available from the hardware. The minimum size for a single frame is 24 bytes. As encoded in raw data. Inputs nxSessionRef_t SessionRef The session to read. f64 Timeout. For example. if you pass SizeOfBuffer of 91. and the second 56 bytes in size. CAN frames are always 24 bytes in length. that frame © National Instruments Corporation 5-79 NI-XNET Hardware and Software Manual . or Frame Input Single-Point Mode. FlexRay frames vary in length. assume you pass SizeOfBuffer of 70 bytes and Timeout of 10 seconds. but only the first frame is copied to data. u32 SizeOfBuffer. each frame can vary in length. If the read copied 46 bytes of the second frame (up to the limit of 70). The read returns after the two frames are received. Format nxStatus_t nxReadFrame ( nxSessionRef_t SessionRef. two frames are received. This session is returned from nxCreateSession. the number represents the maximum raw bytes to read.

nxReadFrame waits indefinitely for SizeOfBuffer frame bytes. or Frame Input Single-Point Mode. This frame format is the same for read and write of raw data. or Frame Input Single-Point Mode. If Timeout is zero. and it is also used for log file examples. The default value is 0. To avoid this problem. you must set Timeout to 0. Frame Input Queued Mode. so the session can use either a CAN or FlexRay interface. If Timeout is positive. u32 * NumberOfBytesReturned Returns the number of valid bytes in the Buffer array. If the session mode is Frame Input Single-Point. an error is returned. NI-XNET Hardware and Software Manual 5-80 ni. For an example of how this data applies to network traffic. This input is optional.0. A value of 0 indicates success. nxReadFrame does not wait and immediately returns all available frame bytes up to the limit SizeOfBuffer specifies. The session must use Frame Input Stream Mode. Frame Input Queued Mode. The raw bytes encode one or more frames using the Raw Frame Format. the read always returns complete frames in Buffer. The raw frame format is protocol independent. If the bytes do not arrive prior to the timeout. Outputs void * Buffer Returns an array of bytes. Description The raw bytes encode one or more frames using the Raw Frame Format.com . If Timeout is negative. then returns complete frames up to that number. The data always returns complete frames. Return Value nxStatus_t The error code the function returns in the event of an error or warning.0. The timeout is represented as 64-bit floating-point in units of seconds. Timeout does not apply. A negative value indicates an error. nxReadFrame waits for SizeOfBuffer frame bytes to be received. refer to Frame Input Stream Mode. A positive value indicates a warning.Chapter 5 NI-XNET API for C would be incomplete and therefore difficult to interpret. Because this mode reads the most recent value of each frame.

Frame Input Single-Point Mode: Array of single frame values. one for each frame specified in the list. © National Instruments Corporation 5-81 NI-XNET Hardware and Software Manual .Chapter 5 NI-XNET API for C The raw frames are associated to the session’s list of frames as follows: Frame Input Stream Mode: Array of all frame values received (list ignored). Frame Input Queued Mode: Array of frame values received for the single frame specified in the list.

This session is returned from nxCreateSession. u32 SizeOfValueBuffer Should be set to the size (in bytes) of the array passed to ValueBuffer. Inputs nxSessionRef_t SessionRef The session to read. The session mode must be a Signal Input Single-Point Mode. Each signal value is scaled. an error is returned. the XNET Signal Default Value is returned. and this is too small to fit one element for each signal in the session. Format nxStatus_t nxReadSignalSinglePoint ( nxSessionRef_t SessionRef. refer to Signal Input Single-Point Mode. Each array element corresponds to a signal configured for the session. 64-bit floating point. u32 SizeOfTimestampBuffer). f64 * ValueBuffer. u32 SizeOfValueBuffer. The order of signals in the array corresponds to the order in the session list. If multiple frames for a signal are received since the previous call to nxReadSignalSinglePoint (or session start). an error is returned. NI-XNET Hardware and Software Manual 5-82 ni. If no frame is received for the corresponding signals since you started the session. If this is too small to fit one element for each signal in the session. The data returns the most recent value received for each signal.com . If TimestampBuffer is not NULL. nxTimestamp_t * TimestampBuffer. For an example of how this data applies to network traffic.Chapter 5 NI-XNET API for C nxReadSignalSinglePoint Purpose Reads data from a session of Signal Input Single-Point Mode. Outputs f64* ValueBuffer Returns a one-dimensional array of signal values. only signal data from the most recent frame is returned. u32 SizeOfTimestampBuffer Should be set to the size (in bytes) of the array passed to TimestampBuffer.

then no timestamps are returned. SizeOfTimeStampBuffer also should be passed 0 in this case.Chapter 5 NI-XNET API for C nxTimestamp_t* TimestampBuffer Optionally returns a one-dimensional array of timestamp values of the times when the corresponding signal values arrived. © National Instruments Corporation 5-83 NI-XNET Hardware and Software Manual . Return Value nxStatus_t The error code the function returns in the event of an error or warning. A negative value indicates an error. TimestampBuffer Can be passed as NULL. 1601 12:00 AM UTC. Each timestamp value is the number of 100 ns increments since Jan 1. A positive value indicates a warning. A value of 0 indicates success.

Chapter 5 NI-XNET API for C nxReadSignalWaveform Purpose Reads data from a session of Signal Input Waveform Mode.0 (wait for a specific N). f64 * DeltaTime. u32 * NumberOfValuesReturned). There always is a maximum of N samples per waveform returned. f64 * ValueBuffer. N means the maximum number of samples to read. If Timeout is positive. u32 SizeOfValueBuffer The size (in bytes) of the array passed to ValueBuffer. If the samples do not arrive prior to the timeout. The session mode must be Signal Input Waveform. nxReadSignalWaveform does not wait and immediately returns all available samples up to the limit N specifies. nxTimestamp_t * StartTime. even if NI-XNET Hardware and Software Manual 5-84 ni. then returns that number. If Timeout is negative. It is used to calculate N = trunc (SizeOfValueBuffer / (sizeof (f64) * (number of signals in the session))). nxSessionRef_t SessionRef The session to read. Inputs Note In the following. f64 Timeout The time to wait for N samples to become available. nxReadSignalWaveform waits indefinitely for N samples. It is calculated from SizeOfValueBuffer. Because time determines sample availability. If Timeout is zero. u32 SizeOfValueBuffer. Format nxStatus_t nxReadSignalWaveform ( cnxSessionRef_t SessionRef. f64 Timeout. typical values for this timeout are 0 (return available) or a large positive value such as 100. nxReadSignalWaveform waits for N samples.com . The data represents a waveform of resampled values for each signal in the session. The timeout is represented as 64-bit floating-point in units of seconds. an error is returned. This session is returned from nxCreateSession.

in this case. 1601. in this case. Description The data represents a waveform for each signal in the session. then N samples for the second. DeltaTime can be passed as NULL.Chapter 5 NI-XNET API for C SizeOfValueBuffer is not a multiple of (sizeof (f64) * (number of signals in the session)). N samples are reserved for the first signal in the session. A negative value indicates an error. First. no value is returned. f64* ValueBuffer Returns a two-dimensional array of f64 samples. The value returned is 1.0/Resample Rate. u32* NumberOfValuesReturned The number of waveform samples per signal that have been returned in ValueBuffer. This is always less than or equal to N. no value is returned. f64* DeltaTime Optionally returns the time increment between successive values of the waveform returned in ValueBuffer. refer to Signal Input Waveform Mode. N * (number of signals in the session) * sizeof (f64) should be passed in SizeOfValueBuffer to recalculate N. For an example of how this data applies to network traffic. A positive value indicates a warning. StartTime can be passed as NULL. and so on. Outputs nxTimestamp_t* StartTime Optionally returns the start time of the waveform returned in ValueBuffer. 12:00 AM UTC. no value is returned. given in 100 ns increments since Jan 1. It is the absolute time of the first sample. NumberOfValuesReturned can be passed as NULL. © National Instruments Corporation 5-85 NI-XNET Hardware and Software Manual . in this case. A value of 0 indicates success. Return Value nxStatus_t The error code the function returns in the event of an error or warning.

Inputs Note In the following. nxTimestamp_t * TimestampBuffer. N is calculated from this as: N = trunc (SizeOfValueBuffer / (sizeof (f64) * (number of signals in the session))). you effectively obtain a moving window of signal values. If you increment TimeLimit by a fixed number of seconds for each call to nxReadSignalXY. u32 SizeOfNumPairsBuffer). If TimeLimit is valid. It is the absolute time. The TimeLimit of nxReadSignalXY does not specify a worst-case timeout value. N means the maximum number of samples to read per signal. u32 SizeOfValueBuffer The size (in bytes) of the array passed to ValueBuffer. then returns available values (up to number to read). nxTimestamp_t* TimeLimit The timestamp to wait for before returning signal values. nxSessionRef_t SessionRef The session to read. 1601. The session mode must be Signal Input XY. u32 SizeOfValueBuffer. Format nxStatus_t nxReadSignalXY ( nxSessionRef_t SessionRef. u32 * NumPairsBuffer. nxReadSignalXY waits for the timestamp to occur.Chapter 5 NI-XNET API for C nxReadSignalXY Purpose Reads data from a session of Signal Input XY Mode. The Timeout of other nxRead functions specifies the maximum amount time to wait for a specific (number to read) values. If both SizeOfValueBuffer and SizeOfTimestampBuffer deliver a valid N value (N > 0). f64 * ValueBuffer.com . u32 SizeOfTimestampBuffer. but rather a specific absolute timestamp to wait for. It is calculated from SizeOfValueBuffer and SizeOfTimestampBuffer. 12:00 AM UTC. This session is returned from nxCreateSession. given in 100 ns increments since Jan 1. the smaller of the two values is used to avoid buffer overflows. nxTimestamp_t * TimeLimit. NI-XNET Hardware and Software Manual 5-86 ni.

and so on. If the buffer is too small. N samples are reserved for the first signal in the session. N is calculated from this as: N = trunc (SizeOfTimestampBuffer / (sizeof (f64) * (number of signals in the session))). A negative value indicates an error. u32* NumPairsBuffer Returns a one-dimensional array of signal/timestamp pair counts. refer to Signal Input XY Mode.Chapter 5 NI-XNET API for C u32 SizeOfTimestampBuffer The size (in bytes) of the array passed to TimestampBuffer. A value of 0 indicates success. index NumPairsBuffer[i] (zero based). N * (number of signals in the session) * sizeof (f64) should be passed in SizeOfTimestampBuffer to recalculate N. 12:00 AM UTC. For each signal in the session. The timestamps are given in 100 ns increments since Jan 1. Return Value nxStatus_t The error code the function returns in the event of an error or warning. Outputs f64* ValueBuffer Returns a two-dimensional array of f64 samples. u32 SizeOfNumPairsBuffer The size (in bytes) of the array passed to NumPairsBuffer. Description The data represents an XY plot of timestamp/value pairs for each signal in the session. but not including. First. For an example of how this data applies to network traffic. the samples and timestamps for signal #(i) in the preceding arrays are valid up to. nxTimestamp_t* TimestampBuffer Returns a two-dimensional array of timestamps. N timestamps are reserved for the first signal in the session. First. N * (number of signals in the session) * sizeof (f64) should be passed in SizeOfValueBuffer to recalculate N. If both SizeOfValueBuffer and SizeOfTimestampBuffer deliver a valid N value (N > 0). and so on. 1601. then N timestamps for the second. © National Instruments Corporation 5-87 NI-XNET Hardware and Software Manual . an array element should be provided. A positive value indicates a warning. then N samples for the second. the smaller of the two values is used to avoid buffer overflows. one for each signal in the session. an error is returned. Upon output.

Chapter 5 NI-XNET API for C nxReadState Purpose Reads communication states of an XNET session. This session is returned from nxCreateSession. Outputs void* StateValue Returns the desired state. Formats and values are: StateID = nxState_TimeCurrent: StateValue must point to an nxTimestamp_t buffer. nxStatus_t * Fault). NI-XNET Hardware and Software Manual 5-88 ni. u32 StateID. u32 StateSize Indicates the size of the buffer provided for StateValue. 1601 12:00 AM UTC. Inputs nxSessionRef_t SessionRef The session to read. void * StateValue. u32 StateSize. Possible values are: nxState_TimeCurrent nxState_TimeCommunicating nxState_TimeStart nxState_CANComm nxState_FlexRayComm nxState_FlexRayStats Current interface time Time interface started communicating Time interface was started CAN communication state FlexRay communication state FlexRay statistics The value determines the format output as StateValue. Format nxStatus_t nxReadState ( nxSessionRef_t SessionRef. u32 StateID Indicates the state to be read. It is filled with the current interface time in 100 ns increments since Jan 1.com .

Although communication proceeds. Therefore. It is filled with the time the interface was started in 100 ns increments since Jan 1. 1601 12:00 AM UTC. Bit 0–3 Communication State Error Active (0) Meaning This is the CAN interface initial state. an invalid time is returned (0). It is filled with the time the interface started communicating in 100 ns increments since Jan 1. which is comprised of several bitfields.Chapter 5 NI-XNET API for C StateID = nxState_TimeCommunicating: StateValue must point to an nxTimestamp_t buffer. StateID = nxState_CANComm: StateValue must point to an u32 buffer. If either the receive error counter or transmit error counter increment above 127. This time is usually later than the interface start time (StateID = nxState_TimeStart). 1601 12:00 AM UTC. if the CAN interface transmits a frame with no other device (ECU) connected. with few errors detected. the CAN device generally is assumed to have problems with receiving frames. If the interface is not communicating when this read is called. acknowledgement errors do not increment the transmit error counter. This state reflects normal communication. Error Passive (1) © National Instruments Corporation 5-89 NI-XNET Hardware and Software Manual . StateID = nxState_TimeStart: StateValue must point to an nxTimestamp_t buffer. The CAN interface remains in this state as long as receive error counter and transmit error counter are both below 128. It is filled with a communication state DWORD. You can use macros in nixnet.h to access these bitfields. If the interface is not started when this read is called. it eventually enters error passive state due to retransmissions. because the interface must undergo a communication startup procedure. but does not enter bus off state. the CAN interface transitions into this state. an invalid time is returned (0). When a CAN interface is in error passive state.

it transitions from the Init state to the Error Active state. communication stops for the interface. The interface is essentially off. This is typically referred to as the transceiver chip NERR pin. call nxStart. False indicates normal operation (no error). When the interface stops due to the Bus Off state. 8–11 Last Error Last error specifies the status of the last attempt to receive or transmit a frame (decimal value in parentheses): None (0) Stuff (1) Form (2) The last receive or transmit was successful. All NI-XNET sessions for the interface no longer receive or transmit frame values. More than 5 equal bits have occurred in sequence. False indicates normal operation (awake). which the CAN specification does not allow.com . When the start trigger occurs for the CAN interface. To restart the CAN interface and all its sessions. it remains in that state until you restart. the CAN interface transitions into this state. the CAN interface transitions from either Error Active or Error Passive to the Init state. and true indicates an error.Chapter 5 NI-XNET API for C Bit Bus Off (2) Meaning If the transmit error counter increments above 255. NI-XNET Hardware and Software Manual 5-90 ni. and true indicates sleep. 5 Sleep Sleep indicates whether the transceiver and communication controller are in their sleep state. When the interface stops due to a call to nxStop. When a CAN interface transitions to the bus off state. 4 Transceiver Error Transceiver error indicates whether an error condition exists on the physical transceiver. A fixed format part of the received frame used the wrong format. Communication immediately stops under the assumption that the CAN interface must be isolated from other devices. Init (3) This is the CAN interface initial state on power-up. in that it is not attempting to communicate with other nodes (ECUs).

the interface wanted to send a recessive bit (logical 1).h to access these bitfields. you see this error repeatedly. The counter increases more for an error than it is decreased for success. During a frame transmit (with the exception of the arbitration ID field). © National Instruments Corporation 5-91 NI-XNET Hardware and Software Manual . and the frame transmit retries indefinitely. It is filled with a communication state DWORD. but the monitored bus value was recessive (logical 1). Bit 1 (4) During a frame transmit (with the exception of the arbitration ID field). the transmit error counter no longer is valid. The CRC contained within a received frame does not match the CRC calculated for the incoming bits. but the monitored bus value was dominant (logical 0). the interface wanted to send a dominant bit (logical 0). StateID = nxState_FlexRayComm: StateValue must point to an u32 buffer. which is comprised of several bitfields. You can use macros in nixnet. If you call the appropriate nxWrite function and do not have a cable connected. This ensures that the counter generally increases when a certain ratio of frames (roughly 1/8) encounter errors. or the cable is connected to a node that is not communicating. The counter increments when an error is detected for a received frame and decrements when a frame is received successfully. 24–31 Receive Error Counter The receive error counter begins at 0 when communication starts on the CAN interface. The counter increments when an error is detected for a transmitted frame and decrements when a frame transmits successfully. The CAN communication state eventually transitions to Error Passive. The counter increases more for an error than it is decreased for success.Chapter 5 NI-XNET API for C Bit Ack (3) Meaning Another node (ECU) did not acknowledge the frame transmit. This ensures that the counter generally increases when a certain ratio of frames (roughly 1/8) encounter errors. When communication state transitions to Bus Off. Bit 0 (5) CRC (6) 16–23 Transmit Error Counter The transmit error counter begins at 0 when communication starts on the CAN interface.

If the integration succeeds. the interface transitions to Normal Active. In the Ready state. but frame transmission is disabled due to degraded synchronization with the cluster remainder. the interface can transition to Normal Active. up to 200 ms. If synchronization continues to degrade. If synchronization improves. Communication halted due to synchronization problems. the interface can transition from this state to Normal Passive. the interface transitions to this Ready state. To restart the FlexRay interface. all NI-XNET sessions for the interface stop. This integration process can take several FlexRay cycles. it first enters Config state to validate the FlexRay cluster and interface properties. If synchronization problems occur. When the interface starts. you can use nxReadState to read the time when the FlexRay entered Normal Active. If integration succeeds.com . The NI-XNET interface is adequately synchronized to the cluster to allow continued frame transmission without disrupting the transmissions of other nodes (ECUs). When the FlexRay interface is in Halt state. the FlexRay interface attempts to integrate (synchronize) with other nodes in the network cluster. Frame reception is allowed. The interface is essentially off. You can use nxReadState to read the time when the FlexRay interface entered Ready.Chapter 5 NI-XNET API for C Bit 0–3 POC State Meaning POC state specifies the FlexRay interface state (decimal value in parentheses): Default Config (0) This is the FlexRay interface initial state on power-up. Ready (1) Normal Passive (3) Halt (4) NI-XNET Hardware and Software Manual 5-92 ni. Normal Active (2) This is the normal operation state. and no frame values are received or transmitted. Assuming the properties are valid. you must restart the NI-XNET sessions. it transitions from Halt to Default Config state. If you clear (close) all NI-XNET sessions for the interface. in that it is not configured and is not attempting to communicate with other nodes (ECUs). the interface transitions to Halt.

h). which displays invalid configuration properties. StateID = nxState_FlexRayStats: StateValue must point to an nxFlexRayStats_t buffer (defined in nixnet. This count increments while the FlexRay interface is in POC state Error Passive.Chapter 5 NI-XNET API for C Bit Config (15) Meaning This state is transitional when configuration is valid. 8-12 Passive to Active Count Passive to active count returns the number of consecutive even/odd cycle pairs that have occurred with successful clock synchronization. the FlexRay interface POC state transitions from Normal Passive to Halt state. In the FlexRay specification. the interface POC state transitions to Normal Active. If no fault is returned. For more information about the FlexRay POC state. In the FlexRay specification. the FlexRay interface POC state transitions from Normal Active to Normal Passive state. © National Instruments Corporation 5-93 NI-XNET Hardware and Software Manual . check your FlexRay cluster and interface properties. If this count reaches the value in the XNET Cluster FlexRay:Max Without Clock Correction Fatal property. If the count reaches the value in the XNET Session Interface:FlexRay:Allow Passive to Active property. The values are: u32 NumSyntaxErrorChA The number of syntax errors that have occurred on channel A since communication started. If this count reaches the value in the XNET Cluster FlexRay:Max Without Clock Correction Passive property. refer to Appendix B. Check the fault? output for a fault. If you detect this state after starting the interface. Summary of the FlexRay Standard. this value is referred to as vClockCorrectionFailed. this value is referred to as vAllowPassiveToActive. You can check the validity of these properties using the NI-XNET Database Editor. 4–7 Clock Correction Failed Clock correction failed returns the number of consecutive even/odd cycle pairs that have occurred without successful clock synchronization. this value is referred to as the Protocol Operation Control (POC) state. It is filled with communication statistics values. In the FlexRay specification. it typically indicates a problem with the configuration.

the Startup indicator (bit) is 1 while the Sync indicator is 0. In a dynamic segment. A content error occurs if: • • • • • • • In a static segment. In a static segment. u32 NumSlotBoundaryViolationChA The number of slot boundary violations that have occurred on channel A since communication started. u32 NumSyntaxErrorChB The number of syntax errors that have occurred on channel B since communication started. or network idle time. In a dynamic segment. the Sync indicator is 1. A frame is received within the slot after reception of a semantically correct frame (two frames in one slot). the Null indicator is 0. A symbol is decoded in the static segment. Two or more symbols are received within the symbol window. dynamic segment. the Startup indicator is 1. a frame payload length does not match the global cluster property.com . u32 NumContentErrorChA The number of content errors that have occurred on channel A since communication started.Chapter 5 NI-XNET API for C A syntax error occurs if: • • • • • • A node starts transmitting while the channel is not in the idle state. NI-XNET Hardware and Software Manual 5-94 ni. u32 NumContentErrorChB The number of content errors that have occurred on channel B since communication started. There is a decoding error. A frame is decoded in the symbol window or in the network idle time. The frame ID encoded in the frame header does not match the current slot. The cycle count encoded in the frame header does not match the current cycle count. A slot boundary violation error occurs if the interface does not consider the channel to be idle at the boundary of a slot (either beginning or end). In a dynamic segment.

Because the state reflects the CAN interface. so that it does not introduce errors into the flow of your code. A positive value indicates a warning. because this may cause your application to stop. For more information about these statistics. If no fault occurred. you intentionally may introduce noise into the CAN cables to test how your ECU behaves under these conditions. A fault is an error that occurs asynchronously to the NI-XNET application calls. A negative value indicates an error. refer to Appendix B. yet easy to use alongside the common practice of checking the communication state. Summary of the FlexRay Standard. as long as the session interface is CAN. Your application can use nxReadState to check for problems on the CAN network independently from other aspects of your application. To obtain a fault description. nxReadState provides a detection method distinct from the status of NI-XNET function calls. For example. A value of 0 indicates success. The fault cause may be related to CAN communication. Your application can use nxReadState to read the CAN network state quickly as data. pass the fault code to nxStatusToString. Description You can use nxReadState with any XNET session mode. nxStatus_t* Fault Returns a numeric code you can use to obtain a description of the fault. you do not want the status of NI-XNET functions to return errors. such as a fault in the onboard processor. © National Instruments Corporation 5-95 NI-XNET Hardware and Software Manual . but it also can be related to XNET hardware.Chapter 5 NI-XNET API for C u32 NumSlotBoundaryViolationChB The number of slot boundary violations that have occurred on channel B since communication started. Return Value nxStatus_t The error code the function returns in the event of an error or warning. the fault code is 0. When you do this. it can apply to multiple sessions. Although faults are extremely rare.

Format nxStatus_t nxSetProperty ( nxSessionRef_t SessionRef. Inputs nxSessionRef_t SessionRef The session to set the property for. u32 PropertySize The number of bytes provided for the buffer passed to PropertyValue.h. void * PropertyValue Contains the value to set for the desired property. u32 PropertySize. void * PropertyValue). A positive value indicates a warning. This can be a fixed-size (for example. u32 PropertyID. Description Refer to the following sections for information about properties you can use with this function: • • • • XNET Device Properties XNET Interface Properties XNET Session Properties XNET System Properties 5-96 ni.Chapter 5 NI-XNET API for C nxSetProperty Purpose Sets an XNET session property. for a string property). The appropriate constants are listed in the Properties section and defined in nixnet. 4 bytes for an u32 property) or variable-sized buffer (for example. A value of 0 indicates success.com NI-XNET Hardware and Software Manual . Outputs Return Value nxStatus_t The error code the function returns in the event of an error or warning. u32 PropertyID The ID of the property to set. This session is returned from nxCreateSession. A negative value indicates an error.

This session is returned from nxCreateSession. This is equivalent to calling nxStart with the Session Only Scope followed by calling nxStart with the Interface Only Scope. When you are ready for all sessions to start communicating on the associated interface. Normal (0) The session is started followed by starting the interface. A value of 0 indicates success. After the interface starts communicating. If the underlying interface is not previously started. start each session with the Session Only Scope. To have multiple sessions start at exactly the same time.Chapter 5 NI-XNET API for C nxStart Purpose Starts communication for the specified XNET session. A positive value indicates a warning. the interface is placed into the Started state (refer to State Models). © National Instruments Corporation 5-97 NI-XNET Hardware and Software Manual . Starting a previously started interface is considered a no-op. all previously started sessions can transfer data to and from the bus. u32 Scope Describes the impact of this operation on the underlying state models for the session and its interface. Starting a previously started session is considered a no-op. call nxStart with the Interface Only Scope. u32 Scope). If the interface is in the Stopped state before this function runs. Inputs nxSessionRef_t SessionRef The session to start. The session is placed into the Started state (refer to State Models). Session Only (1) Interface Only (2) Return Value nxStatus_t The error code the function returns in the event of an error or warning. and no communication occurs with the bus. Format nxStatus_t nxStart ( nxSessionRef_t SessionRef. A negative value indicates an error. the interface remains in the Stopped state.

For each physical interface. refer to the XNET Frame Default Payload and XNET Signal Default Value properties. refer to State Models. all contained frames or signals are placed in a state where they are ready to communicate. For more information about the automatic start feature. refer to the Auto Start? property. For more information. the NI-XNET hardware is divided into two logical units: • • Sessions: You can create one or more sessions. this function is optional. You can start each logical unit separately.Chapter 5 NI-XNET API for C Description Because the session is started automatically by default. This function is for more advanced applications to start multiple sessions in a specific order. each of which contains frames or signals to be transmitted (or received) on the bus. If an output session starts before you write data. When a session is started. or you read an input session before it receives a frame. NI-XNET Hardware and Software Manual 5-98 ni.com . When the interface is started. it takes data from all started sessions to communicate with other nodes on the bus. Interface: The interface physically connects to the bus and transmits (or receives) data for the sessions. default data is used. For a specification of the state models for the session and interface.

char * StatusDescription). © National Instruments Corporation 5-99 NI-XNET Hardware and Software Manual .Chapter 5 NI-XNET API for C nxStatusToString Format void _NXFUNC nxStatusToString ( nxStatus_t Status. SizeofString is the size allocated for the string. u32 SizeofString. Inputs nxStatus_t Status The status code to be explained. NI-XNET status descriptions are limited to 512 characters. A positive value indicates a warning. Description This function converts a status code returned from a function into a descriptive string. Return Value nxStatus_t The error code the function returns in the event of an error or warning. A value of 0 indicates success. u32 SizeofString The size of the string provided to store the explanation of the status code. Outputs char * StatusDescription The string in which the explanation of the status code will be stored. A negative value indicates an error.

com .Chapter 5 NI-XNET API for C nxStop Purpose Stops communication for the specified XNET session. This session is returned from nxCreateSession. If any other sessions are running on the interface. Session Only (1) Interface Only (2) NI-XNET Hardware and Software Manual 5-100 ni. This Scope generally is not necessary. but data from this session does not transfer. This prevents all communication on the bus. Inputs nxSessionRef_t SessionRef The session to stop. u32 Scope Describes the impact of this operation on the underlying state models for the session and its interface. to avoid disruption of communication on the other sessions. CAN baud rate). as the Normal Scope only stops the interface if there are no other running sessions. this call is treated just like the Session Only Scope. This allows you modify certain properties that require the interface to be stopped (for example. If this is the last session stopped on the interface. the interface remains in that state and communication continues. The session is placed in the Stopped state (refer to State Models). Format nxStatus_t nxStop ( nxSessionRef_t SessionRef. If the interface was in the Started or Running state before this function is called. Normal (0) The session is stopped. All sessions remain in the Started state. To have multiple sessions stop at exactly the same time. first stop the interface with the Interface Only Scope and then stop each session with either the Normal or Session Only Scope. for all sessions. the interface is also stopped. u32 Scope). The underlying interface is placed in the Stopped state (refer to State Models).

For each physical interface. When the interface is stopped. When a session is stopped. A negative value indicates an error. You can stop each logical unit separately. refer to State Models.Chapter 5 NI-XNET API for C Return Value nxStatus_t The error code the function returns in the event of an error or warning. each of which contains frames or signals to be transmitted (or received) on the bus. this function is optional. For a specification of the state models for the session and interface. A value of 0 indicates success. A positive value indicates a warning. the NI-XNET hardware is divided into two logical units: • • Sessions: You can create one or more sessions. it no longer takes data from sessions to communicate with other nodes on the bus. © National Instruments Corporation 5-101 NI-XNET Hardware and Software Manual . all contained frames or signals are placed in a state where they are no longer ready to communicate. Description Because the session is stopped automatically when cleared (closed). Interface: The interface physically connects to the bus and transmits (or receives) data for the sessions.

Inputs nxSessionRef_t SystemRef The reference to the system session to close. A value of 0 indicates success.com . A negative value indicates an error. NI-XNET Hardware and Software Manual 5-102 ni. Outputs Return Value nxStatus_t The error code the function returns in the event of an error or warning.Chapter 5 NI-XNET API for C nxSystemClose Format nxStatus_t _NXFUNC nxSystemClose ( nxSessionRef_t SystemRef). Description This function is used to close a system session. A positive value indicates a warning.

Return Value nxStatus_t The error code the function returns in the event of an error or warning. The system session is not used to read/write on the network (as with sessions created using nxCreateSession). or nxPropIntf_. A positive value indicates a warning. Outputs nxSessionRef_t * SystemRef The reference to the opened system session. Description This function opens a special system session. nxBlink: Blink LED(s) on the interface. Use the system session to interact with the NI driver and interface hardware. nxPropDev_. A negative value indicates an error. For example. you can traverse through properties to find all NI-XNET interfaces in your system. nxGetPropertySize: Get a string property size. The following functions are supported for the system session: • • • nxGetProperty: Get a property with prefix nxPropSys_. © National Instruments Corporation 5-103 NI-XNET Hardware and Software Manual . A value of 0 indicates success.Chapter 5 NI-XNET API for C nxSystemOpen Format nxStatus_t _NXFUNC nxSystemOpen ( nxSessionRef_t * SystemRef).

A positive value indicates a warning. Outputs u32 * ParamOut An optional parameter that provides simple data to qualify the condition that occurred.com . f64 Timeout Specifies the maximum amount of time in seconds to wait. u32 ParamIn. u32 Condition. u32 Condition Specifies the condition to wait for. A value of 0 indicates success. NI-XNET Hardware and Software Manual 5-104 ni. u32 * ParamOut). Inputs nxSessionRef_t SessionRef The session to which the wait is applied. A negative value indicates an error.Chapter 5 NI-XNET API for C nxWait Purpose Waits for previously written data to be transmitted on the cluster. Format nxStatus_t _NXFUNC nxWait ( nxSessionRef_t SessionRef. u32 ParamIn An optional parameter that provides simple data to qualify the condition. Return Value nxStatus_t The error code the function returns in the event of an error or warning. f64 Timeout.

• • • Timeout = 0.0: Wait Timeout seconds for Condition.0: Do not wait. Timeout is specified as floating-point (f64) seconds. Refer to the help for each Condition for a description of applicable ParamOut values.0 for an event-based Condition. © National Instruments Corporation 5-105 NI-XNET Hardware and Software Manual . If the event occurred in the past. using a constant with prefix nxCondition_. pass it as 0. ParamIn is an optional parameter that provides simple data to qualify the condition. If Timeout is 0. If the condition does not use ParamOut. ParamOut is an optional parameter that returns simple data to qualify the condition that occurred. nxTimeout_Infinite.0: Wait indefinitely for Condition. you want to wait for a specific state to occur. If the Condition is event based. Timeout of 0. an error always is returned. The Condition can be either state based or event based. Timeout < 0.Chapter 5 NI-XNET API for C Description This function waits for a condition to occur for the session. Timeout > 0. The Timeout parameter specifies the time to wait for the condition before returning an error. If the Condition is state based. pass it as NULL. Refer to the help for each Condition for a description of applicable ParamIn values. return error if Condition not met. you want to wait for the next occurrence of an event. nxTimeout_None. The Condition parameter specifies what to wait for. If the condition does not use ParamIn.0 is supported for state-based Condition only. it is not relevant.

Frame Output Queued Mode. This session is returned from nxCreateSession. u32 NumberOfBytesForFrames The size (in bytes) of the buffer passed to Buffer. This frame format is the same for read and write of raw data and also is used for log file examples. NI-XNET Hardware and Software Manual 5-106 ni. For an example of how this data applies to network traffic. For example. or Frame Output Single-Point Mode. the payload length in the raw frame data must match the payload length property for the frame. For information about which elements of the raw frame are applicable. Frame Output Queued Mode. You typically do this when you are reading raw frame data from a logfile and want to avoid iterating through the data to detect the start and end of each frame. The data you write is queued up for transmit on the network. if a complete raw frame is 24 bytes. refer to Raw Frame Format.com . f64 Timeout). when you write CAN frames for a Frame Output Queued session. To write more data. Format nxStatus_t nxWriteFrame ( nxSessionRef_t SessionRef. The session mode must be Frame Output Stream Mode. representing frames to transmit.Chapter 5 NI-XNET API for C nxWriteFrame Purpose Writes data to a session as an array of raw bytes. Using the default queue configuration for this mode. For example. or Frame Output Single-Point Mode. u32 NumberOfBytesForFrames. refer to Frame Output Stream Mode. then write the next 12 bytes. This is used to calculate the number of frames to transmit. If needed. refer to the XNET Session Number of Values Unused property to determine the actual amount of queue space available for writing. void * Buffer. void * Buffer Provides the array of bytes. Inputs nxSessionRef_t SessionRef The session to write. you can write data for a partial frame. you can write 12 bytes. you can safely write 1536 frames if you have a sufficiently long timeout. The raw bytes encode one or more frames using the Raw Frame Format.

If Timeout is positive. nxWriteFrame does not wait and immediately returns with a timeout error if all data cannot be queued. none of the data is queued. a timeout error is returned. nxWriteFrame waits indefinitely for space to become available in queues.0. or Frame Output Single-Point. Timeout does not apply. The raw frames are associated to the session’s list of frames as follows: • • • Frame Output Stream Mode: Array of all frame values for transmit (list ignored). if a timeout error occurs. Frame Output Single-Point Mode: Array of single frame values. so the session can use either a CAN or FlexRay interface. A value of 0 indicates success. Return Value nxStatus_t The error code the function returns in the event of an error or warning. one for each frame specified in the list. A negative value indicates an error. Because this mode writes the most recent value of each frame. A positive value indicates a warning. If Timeout is 0. If the space is not available prior to the timeout. Regardless of the timeout used. The timeout is represented as 64-bit floating-point in units of seconds. If the session mode is Frame Output Single-Point. Frame Output Queued Mode: Array of frame values to transmit for the single frame specified in the list. The session must use a mode of Frame Output Stream. The raw frame format is protocol independent. Description The raw bytes encode one or more frames using the Raw Frame Format. you must set Timeout to 0. Frame Output Queued. © National Instruments Corporation 5-107 NI-XNET Hardware and Software Manual . nxWriteFrame waits up to that timeout for space to become available in queues.Chapter 5 NI-XNET API for C f64 Timeout The time to wait for the raw data to be queued up for transmit. so you can attempt to call nxWriteFrame again at a later time with the same data. If Timeout is negative.

f64 * ValueBuffer. The order of signals in the array corresponds to the order in the session list.Chapter 5 NI-XNET API for C nxWriteSignalSinglePoint Purpose Writes data to a session of Signal Output Single-Point Mode. u32 SizeOfValueBuffer Should be set to the size (in bytes) of the array passed to ValueBuffer. 64-bit floating point. the transmitted frame uses signal values from the second call to nxWriteSignalSinglePoint. an error is returned. For an example of how this data applies to network traffic. A positive value indicates a warning. Each signal value is scaled. A negative value indicates an error.com . u32 SizeOfValueBuffer). refer to Signal Output Single-Point Mode. A value of 0 indicates success. This session is returned from nxCreateSession. Format nxStatus_t nxWriteSignalSinglePoint ( nxSessionRef_t SessionRef. Inputs nxSessionRef_t SessionRef The session to write. Each array element corresponds to a signal configured for the session. Return Value nxStatus_t The error code the function returns in the event of an error or warning. If this is too small to fit one element for each signal in the session. The data provides the value for the next transmit of each signal. If nxWriteSignalSinglePoint is called twice before the next transmit. NI-XNET Hardware and Software Manual 5-108 ni. The session mode must be Signal Output Single-Point. f64 * ValueBuffer Provides a one-dimensional array of signal values.

If Timeout is positive. f64 * ValueBuffer. then N samples for the second.Chapter 5 NI-XNET API for C nxWriteSignalWaveform Purpose Writes data to a session of Signal Output Waveform Mode. nxWriteSignalWaveform waits indefinitely for space to become available in queues. you can safely write 64 elements if you have a sufficiently long timeout. N samples are reserved for the first signal in the session. none of the data is queued. The timeout is represented as 64-bit floating-point in units of seconds. nxWriteSignalWaveform does not wait and immediately returns an error if all data cannot be queued. To write more data. If the space is not available prior to the timeout. f64* ValueBuffer Provides a two-dimensional array of f64 samples. If Timeout is negative. The timeout does not wait for frames to be transmitted on the network (refer to nxWait). if a timeout error occurs. First. refer to the © National Instruments Corporation 5-109 NI-XNET Hardware and Software Manual . The data represents a waveform of resampled values for each signal in the session. nxWriteSignalWaveform waits up to that timeout for space to become available in queues. f64 Timeout. This session is returned from nxCreateSession. a timeout error is returned. The data you write is queued for transmit on the network. Using the default queue configuration for this mode. If Timeout is 0. and assuming a 1000 Hz resample rate. f64 Timeout The time to wait for the data to be queued for transmit. Regardless of the timeout used. Format nxStatus_t nxWriteSignalWaveform ( nxSessionRef_t SessionRef. u32 SizeOfValueBuffer). The session mode must be Signal Output Waveform. so you can attempt to call nxWriteSignalWaveform again at a later time with the same data. Inputs nxSessionRef_t SessionRef The session to write. and so on. N * (number of signals in the session) * sizeof (f64) should be passed in SizeOfValueBuffer to recalculate N.

Each array element corresponds to a signal configured for the session. The number of samples to be written (N) per signal is calculated from this size. A negative value indicates an error. Description The data represents a waveform for each signal in the session. The order of signals in the array corresponds to the order in the session list. A value of 0 indicates success. Set this to (N) * (number of signals in the session) * sizeof (f64).Chapter 5 NI-XNET API for C XNET Session Number of Values Unused property to determine the actual amount of queue space available for writing. NI-XNET Hardware and Software Manual 5-110 ni. A positive value indicates a warning. refer to Signal Output Waveform Mode.com . For an example of how this data applies to network traffic. u32 SizeOfValueBuffer Should be set to the size (in bytes) of the array passed to ValueBuffer. Return Value nxStatus_t The error code the function returns in the event of an error or warning.

N * (number of signals in the session) * sizeof (f64) should be passed in SizeOfValueBuffer to recalculate N. u32 * NumPairsBuffer. nxWriteSignalXY waits indefinitely for space to become available in queues. The data represents a sequence of signal values for transmit using each frame’s timing as the database specifies. then N samples for the second. If Timeout is negative. If Timeout is 0. u32 SizeOfTimestampBuffer. The timeout is represented as 64-bit floating-point in units of seconds.Chapter 5 NI-XNET API for C nxWriteSignalXY Purpose Writes data to a session of Signal Output XY Mode. so you can attempt to call nxWriteSignalXY again at a later time with the same data. Format nxStatus_t nxWriteSignalXY ( nxSessionRef_t SessionRef. f64 Timeout. if a timeout error occurs. f64 * ValueBuffer. The session mode must be Signal Output XY. nxTimestamp_t * TimestampBuffer. N samples are reserved for the first signal in the session. © National Instruments Corporation 5-111 NI-XNET Hardware and Software Manual . u32 SizeOfValueBuffer. nxWriteSignalXY does not wait and immediately returns with a timeout error if all data cannot be queued. none of the data is queued. f64 Timeout The time to wait for the data to be queued for transmit. and so on. a timeout error is returned. If the space is not available prior to the timeout. nxWriteSignalXY waits up to that timeout for space to become available in queues. f64* ValueBuffer Provides a two-dimensional array of f64 samples. Inputs nxSessionRef_t SessionRef The session to write. The timeout does not wait for frames to be transmitted on the network (refer to nxWait). This session is returned from nxCreateSession. Regardless of the timeout used. First. u32 SizeOfNumPairsBuffer). If Timeout is positive.

N timestamps are reserved for the first signal in the session. For each signal in the session. but not including. you can safely write 64 elements if you have a sufficiently long timeout. Description The data represents an XY plot of timestamp/value pairs for each signal in the session. it is not used in the current implementation of NI-XNET. A value of 0 indicates success. Return Value nxStatus_t The error code the function returns in the event of an error or warning. index NumPairsBuffer[i] (zero based) and are written up to that point. A negative value indicates an error. A positive value indicates a warning. To write more data. an array element should be provided. u32 SizeOfNumPairsBuffer The size (in bytes) of the array passed to NumPairsBuffer. This value is for future expansion. For an example of how this data applies to network traffic. the samples and timestamps for signal #(i) in the preceding arrays are valid up to. The timestamps are given in 100 ns increments since Jan 1. u32* NumPairsBuffer Provides an one-dimensional array of signal/timestamp pair counts. Pass 0 on input. refer to Signal Output XY Mode. First. refer to the XNET Session Number of Values Unused property to determine the actual amount of queue space available for writing. an error is returned. N * (number of signals in the session) * sizeof (f64) should be passed in SizeOfTimestampBuffer to recalculate N. Pass NULL on input. Upon input. If the buffer is too small. one for each signal in the session. 1601. nxTimestamp_t* TimestampBuffer Provides a two-dimensional array of timestamps. 12:00 AM UTC. then N timestamps for the second and so on. u32 SizeOfValueBuffer The size (in bytes) of the array passed to ValueBuffer.Chapter 5 NI-XNET API for C The data you write is queued for transmit on the network. it is not used in the current implementation of NI-XNET. u32 SizeOfTimestampBuffer The size (in bytes) of the array passed to TimestampBuffer. Using the default queue configuration for this mode.com . NI-XNET Hardware and Software Manual 5-112 ni. This array is for future expansion.

50000. or 10000000. 400000. XNET Cluster Properties This section includes the XNET Cluster properties. this rate can be 33333. If you need values other than these. 160000. 62500. 800000. FlexRay For FlexRay. Some transceivers may support only a subset of these values. © National Instruments Corporation 5-113 NI-XNET Hardware and Software Manual . This baud rate represents the rate from the database. 200000. 40000. use the custom settings as described in the XNET Session Interface:Baud Rate property. this rate must be 2500000. or 1000000. 100000. 250000. Use a session interface property (for example. so it is read-only from the session. Baud Rate Data Type u32 Direction Read/Write Required? Default No 0 Property Class XNET Cluster Property ID nxPropClst_BaudRate Description The Baud Rate property sets the baud rate all cluster nodes use. 5000000. 83333. XNET Session Interface:Baud Rate) to override the database baud rate with an application-specific baud rate. 500000. CAN For CAN. 80000.Chapter 5 NI-XNET API for C Properties This section includes the XNET properties. 125000.

com . You can change this behavior by setting the XNET Database ShowInvalidFromOpen? property to true. You can pass the value to the error code input of nxStatusToString to convert it to a text description of the configuration problem.Chapter 5 NI-XNET API for C Comment Data Type char * Direction Read/Write Required? Default No Empty String Property Class XNET Cluster Property ID nxPropClst_Comment Description A comment describing the cluster object. A comment is a string containing up to 65535 characters. NI-XNET Hardware and Software Manual 5-114 ni. the cluster still is returned from the Clusters property even if ShowInvalidFromOpen? is false. Configuration Status Data Type i32 Direction Read Only Required? Default N/A N/A Property Class XNET Cluster Property ID nxPropClst_ConfigStatus Description The cluster object configuration status. Configuration Status returns an NI-XNET error code. By default. When the configuration status of a cluster becomes invalid after the database has been opened. incorrectly configured clusters in the database are not returned from the XNET Database Clusters property because they cannot be used in the bus communication.

An ECU is assigned to a cluster when the ECU object is created. Returns an array of references to all ECUs defined in this cluster. use nxdbCreateObject. use nxdbDeleteObject. The parent database is defined when the cluster object is created.Chapter 5 NI-XNET API for C Database Data Type nxDatabaseRef_t Direction Read Only Required? N/A Default N/A Property Class XNET Cluster Property ID nxPropClst_DatabaseRef Description Refnum to the cluster parent database. To add an ECU to a cluster. To remove an ECU from the cluster. © National Instruments Corporation 5-115 NI-XNET Hardware and Software Manual . ECUs Data Type Direction Required? N/A Default N/A nxDatabaseRef_t * Read Only Property Class XNET Cluster Property ID nxPropClst_ECURefs Description ECUs in this cluster. You cannot change this assignment afterwards. You cannot change it afterwards.

For more information about using database files and in-memory databases. and you create an XNET session that uses this cluster. This property is required. The property does not contain a default in this case. NI-XNET Hardware and Software Manual 5-116 ni. The action point is that point within a given slot where the actual transmission of a frame starts. so you must set a valid value prior to creating a session. the session returns an error. refer to Databases. The file formats require a valid value in the text for this property. If the property does not contain a valid value. Set a value in LabVIEW using the property node. To ensure that the property contains a valid value.Chapter 5 NI-XNET API for C FlexRay:Action Point Offset Data Type u32 Direction Read/Write Required? Default Yes Read from Database Property Class XNET Cluster Property ID nxPropClst_FlexRayActPtOff Description This property specifies the number of macroticks (MT) that the action point is offset from the beginning of a static slot or symbol window. This property corresponds to the global cluster parameter gdActionPointOffset in the FlexRay Protocol Specification. to allow for a clock drift between the network nodes. you can do one of the following: • • Use a database file (or alias) to create the session. This is slightly later than the start of the slot. This is needed when you create your own in-memory database (:memory:) rather than use a file.com . The range for this property is 1–63 MT.

refer to Databases. A receiving FlexRay interface considers the CAS to be valid if the pattern’s low level is within 29 gdBit (cdCASRxLowMin) and CAS Rx Low Max. For more information about using database files and in-memory databases. and you create an XNET session that uses this cluster. the session returns an error. © National Instruments Corporation 5-117 NI-XNET Hardware and Software Manual . so you must set a valid value prior to creating a session. This property is required. To ensure that the property contains a valid value. Set a value in LabVIEW using the property node. If the property does not contain a valid value. This is needed when you create your own in-memory database (:memory:) rather than use a file. you can do one of the following: • • Use a database file (or alias) to create the session. The values for this property are in the range 67–99 gdBit. This property corresponds to the global cluster parameter gdCASRxLowMax in the FlexRay Protocol Specification. The CAS symbol is transmitted by the FlexRay interface (node) during the symbol window within the communication cycle.Chapter 5 NI-XNET API for C FlexRay:CAS Rx Low Max Data Type u32 Direction Read/Write Required? Default Yes Read from Database Property Class XNET Cluster Property ID nxPropClst_FlexRayCASRxLMax Description This property specifies the upper limit of the collision avoidance symbol (CAS) acceptance window. The property does not contain a default in this case. The file formats require a valid value in the text for this property.

NI-XNET Hardware and Software Manual 5-118 ni. This property corresponds to the global cluster parameter gChannels in the FlexRay Protocol Specification.Chapter 5 NI-XNET API for C FlexRay:Channels Data Type u32 Direction Read/Write Required? Default Yes Read from Database Property Class XNET Cluster Property ID nxPropClst_FlexRayChannels Description This property specifies the FlexRay channels used in the cluster. Frames defined in this cluster are expected to use the channels this property specifies. The property does not contain a default in this case. and you create an XNET session that uses this cluster. This is needed when you create your own in-memory database (:memory:) rather than use a file. A FlexRay cluster supports two independent network wires (channels A and B). so you must set a valid value prior to creating a session. The file formats require a valid value in the text for this property. the session returns an error. you can do one of the following: • • Use a database file (or alias) to create the session. refer to Databases. Set a value in LabVIEW using the property node. Refer to the XNET Frame FlexRay:Channel Assignment property. If the property does not contain a valid value. The values (enumeration) for this property are: 1 2 3 Channel A only Channel B only Channels A and B This property is required. You can choose to use both or only one in your cluster.com . For more information about using database files and in-memory databases. To ensure that the property contains a valid value.

Set a value in LabVIEW using the property node. based on the longest microtick used in the cluster. For more information about using database files and in-memory databases. The property does not contain a default in this case. If the property does not contain a valid value. This property corresponds to the global cluster parameter gdClusterDriftDamping in the FlexRay Protocol Specification. Use this global FlexRay parameter to compute the local cluster drift damping factor for each cluster node. This property is required.Chapter 5 NI-XNET API for C FlexRay:Cluster Drift Damping Data Type u32 Direction Read/Write Required? Default Yes Read from Database Property Class XNET Cluster Property ID nxPropClst_FlexRayClstDriftDmp Description This property specifies the cluster drift damping factor. © National Instruments Corporation 5-119 NI-XNET Hardware and Software Manual . the session returns an error. The values for this property are in the range 0–5 MT. so you must set a valid value prior to creating a session. This is needed when you create your own in-memory database (:memory:) rather than use a file. The file formats require a valid value in the text for this property. You can access the local cluster drift for the XNET FlexRay interface from the XNET Session Interface:FlexRay:Cluster Drift Damping property. and you create an XNET session that uses this cluster. you can do one of the following: • • Use a database file (or alias) to create the session. refer to Databases. To ensure that the property contains a valid value.

The property does not contain a default in this case. NI-XNET Hardware and Software Manual 5-120 ni. This property corresponds to the global cluster parameter gColdStartAttempts in the FlexRay Protocol Specification. This property is required. refer to Databases. and you create an XNET session that uses this cluster. This is needed when you create your own in-memory database (:memory:) rather than use a file. Set a value in LabVIEW using the property node. To ensure that the property contains a valid value. you can do one of the following: • • Use a database file (or alias) to create the session.Chapter 5 NI-XNET API for C FlexRay:Cold Start Attempts Data Type u32 Direction Read/Write Required? Default Yes Read from Database Property Class XNET Cluster Property ID nxPropClst_FlexRayColdStAts Description This property specifies the maximum number of times a node in this cluster can start the cluster by initiating schedule synchronization. For more information about using database files and in-memory databases. The file formats require a valid value in the text for this property. so you must set a valid value prior to creating a session. The values for this property are in the range 2–31.com . If the property does not contain a valid value. This global cluster parameter is applicable to all cluster notes that can perform a coldstart (send startup frames). the session returns an error.

Set a value in LabVIEW using the property node. The communication cycle counts increment from 0–63. To ensure that the property contains a valid value. the session returns an error. If the property does not contain a valid value. you can do one of the following: • • Use a database file (or alias) to create the session. the frame transmissions restart with the first frame in the next cycle. and you create an XNET session that uses this cluster. © National Instruments Corporation 5-121 NI-XNET Hardware and Software Manual . so you must set a valid value prior to creating a session. refer to Databases. The property does not contain a default in this case. All frame transmissions complete within a cycle. This is needed when you create your own in-memory database (:memory:) rather than use a file. The range for this property is 10–16000 µs. For more information about using database files and in-memory databases. After this time. after which the cycle count resets back to 0. expressed in microseconds. This property corresponds to the global cluster parameter gdCycle in the FlexRay Protocol Specification. This property is required. The file formats require a valid value in the text for this property.Chapter 5 NI-XNET API for C FlexRay:Cycle Data Type u32 Direction Read/Write Required? Default Yes Read from Database Property Class XNET Cluster Property ID nxPropClst_FlexRayCycle Description This property specifies the duration of one FlexRay communication cycle.

Chapter 5

NI-XNET API for C

FlexRay:Dynamic Segment Start
Data Type u32 Direction Read Only Required? Default Yes Calculated from Other Cluster Properties

Property Class
XNET Cluster

Property ID
nxPropClst_FlexRayDynSegStart

Description
This property specifies the start of the dynamic segment, expressed as the number of macroticks (MT) from the start of the cycle. The range for this property is 8–15998 MT. This property is calculated from other cluster properties. It is based on the total static segment size. It is set to 0 if the FlexRay:Number of Minislots property is 0 (no dynamic segment exists).

NI-XNET Hardware and Software Manual

5-122

ni.com

Chapter 5

NI-XNET API for C

FlexRay:Dynamic Slot Idle Phase
Data Type u32 Direction Read/Write Required? Default Yes Read from Database

Property Class
XNET Cluster

Property ID
nxPropClst_FlexRayDynSlotIdlPh

Description
This property specifies the dynamic slot idle phase duration. This property corresponds to the global cluster parameter gdDynamicSlotIdlePhase in the FlexRay Protocol Specification. The values for this property are in the range 0–2 minislots. This property is required. If the property does not contain a valid value, and you create an XNET session that uses this cluster, the session returns an error. To ensure that the property contains a valid value, you can do one of the following: • • Use a database file (or alias) to create the session. The file formats require a valid value in the text for this property. Set a value in LabVIEW using the property node. This is needed when you create your own in-memory database (:memory:) rather than use a file. The property does not contain a default in this case, so you must set a valid value prior to creating a session. For more information about using database files and in-memory databases, refer to Databases.

© National Instruments Corporation

5-123

NI-XNET Hardware and Software Manual

Chapter 5

NI-XNET API for C

FlexRay:Latest Guaranteed Dynamic Slot
Data Type u32 Direction Read Only Required? Default Yes Calculated from Other Cluster Properties

Property Class
XNET Cluster

Property ID
nxPropClst_FlexRayLatestGuarDyn

Description
This property specifies the highest slot ID in the dynamic segment that still can transmit a full-length (for example, Payload Length Dynamic Maximum) frame, provided all previous slots in the dynamic segment have transmitted full-length frames also. A larger slot ID cannot be guaranteed to transmit a full-length frame in each cycle (although a frame might go out depending on the dynamic segment load). The range for this property is 2–2047 slots. This read-only property is calculated from other cluster properties. If the Number of Minislots is zero, no dynamic slots exist, and this property returns 0. Otherwise, the Number of Minislots is used along with Payload Length Dynamic Maximum to determine the latest dynamic slot guaranteed to transmit in the next cycle. In other words, when all preceding dynamic slots transmit with Payload Length Dynamic Maximum, this dynamic slot also can transmit with Payload Length Dynamic Maximum, and its frame ends prior to the end of the dynamic segment.

NI-XNET Hardware and Software Manual

5-124

ni.com

Chapter 5

NI-XNET API for C

FlexRay:Latest Usable Dynamic Slot
Data Type u32 Direction Read Only Required? Default Yes Calculated from Other Cluster Properties

Property Class
XNET Cluster

Property ID
nxPropClst_FlexRayLatestUsableDyn

Description
This property specifies the highest slot ID in the dynamic segment that can still transmit a full-length (that is, Payload Length Dynamic Maximum) frame, provided no other frames have been sent in the dynamic segment. A larger slot ID cannot transmit a full-length frame (but could probably still transmit a shorter frame). The range for this property is 2–2047. This read-only property is calculated from other cluster properties. If the Number of Minislots is zero, no dynamic slots exist, and this property returns 0. Otherwise, Number of Minislots is used along with Payload Length Dynamic Maximum to determine the latest dynamic slot that can be used when all preceding dynamic slots are empty (zero payload length). In other words, this property is calculated under the assumption that all other dynamic slots use only one minislot, and this dynamic slot uses the number of minislots required to deliver the maximum payload. The frame for this dynamic slot must end prior to the end of the dynamic segment. Any frame transmitted in a preceding dynamic slot is likely to preclude this slot’s frame.

© National Instruments Corporation

5-125

NI-XNET Hardware and Software Manual

Chapter 5

NI-XNET API for C

FlexRay:Listen Noise
Data Type u32 Direction Read/Write Required? Default Yes Read from Database

Property Class
XNET Cluster

Property ID
nxPropClst_FlexRayLisNoise

Description
This property specifies the upper limit for the startup and wakeup listen timeout in the presence of noise. It is used as a multiplier for the Interface:FlexRay:Listen Timeout property. This property corresponds to the global cluster parameter gListenNoise in the FlexRay Protocol Specification. The values for this property are in the range 2–16. This property is required. If the property does not contain a valid value, and you create an XNET session that uses this cluster, the session returns an error. To ensure that the property contains a valid value, you can do one of the following: • • Use a database file (or alias) to create the session. The file formats require a valid value in the text for this property. Set a value in LabVIEW using the property node. This is needed when you create your own in-memory database (:memory:) rather than use a file. The property does not contain a default in this case, so you must set a valid value prior to creating a session. For more information about using database files and in-memory databases, refer to Databases.

NI-XNET Hardware and Software Manual

5-126

ni.com

Chapter 5

NI-XNET API for C

FlexRay:Macro Per Cycle
Data Type u32 Direction Read/Write Required? Default Yes Read from Database

Property Class
XNET Cluster

Property ID
nxPropClst_FlexRayMacroPerCycle

Description
This property specifies the number of macroticks in a communication cycle. For example, if the FlexRay cycle has a duration of 5 ms (5000 µs), and the duration of a macrotick is 1 µs, the XNET Cluster FlexRay:Macro Per Cycle property is 5000. This property corresponds to the global cluster parameter gMacroPerCycle in the FlexRay Protocol Specification. The macrotick (MT) is the basic timing unit in the FlexRay cluster. Nearly all timing-dependent properties are expressed in terms of macroticks. The range for this property is 10–16000 MT. This property is required. If the property does not contain a valid value, and you create an XNET session that uses this cluster, the session returns an error. To ensure that the property contains a valid value, you can do one of the following: • • Use a database file (or alias) to create the session. The file formats require a valid value in the text for this property. Set a value in LabVIEW using the property node. This is needed when you create your own in-memory database (:memory:) rather than use a file. The property does not contain a default in this case, so you must set a valid value prior to creating a session. For more information about using database files and in-memory databases, refer to Databases.

© National Instruments Corporation

5-127

NI-XNET Hardware and Software Manual

Chapter 5

NI-XNET API for C

FlexRay:Macrotick
Data Type f64 Direction Read Only Required? Default Yes Calculated from Other Cluster Parameters

Property Class
XNET Cluster

Property ID
nxPropClst_FlexRayMacrotick

Description
This property specifies the duration of the clusterwide nominal macrotick, expressed in microseconds. This property corresponds to the global cluster parameter gdMacrotick in the FlexRay Protocol Specification. The macrotick (MT) is the basic timing unit in the FlexRay cluster. Nearly all timing-dependent properties are expressed in terms of macroticks. The range for this property is 1–6 µs. This property is calculated from the XNET Cluster FlexRay:Cycle and FlexRay:Macro Per Cycle properties and rounded to the nearest permitted value.

NI-XNET Hardware and Software Manual

5-128

ni.com

Chapter 5

NI-XNET API for C

FlexRay:Max Without Clock Correction Fatal
Data Type u32 Direction Read/Write Required? Default Yes Read from Database

Property Class
XNET Cluster

Property ID
nxPropClst_FlexRayMaxWoClkCorFat

Description
This property defines the number of consecutive even/odd cycle pairs with missing clock correction terms that cause the controller to transition from the Protocol Operation Control status of Normal Active or Normal Passive to the Halt state. Use this global parameter as a threshold for testing the clock correction failure counter. This property corresponds to the global cluster parameter gMaxWithoutClockCorrectionFatal in the FlexRay Protocol Specification. The values for this property are in the range 1–15 even/odd cycle pairs. This property is required. If the property does not contain a valid value, and you create an XNET session that uses this cluster, the session returns an error. To ensure that the property contains a valid value, you can do one of the following: • • Use a database file (or alias) to create the session. The file formats require a valid value in the text for this property. Set a value in LabVIEW using the property node. This is needed when you create your own in-memory database (:memory:) rather than use a file. The property does not contain a default in this case, so you must set a valid value prior to creating a session. For more information about using database files and in-memory databases, refer to Databases.

© National Instruments Corporation

5-129

NI-XNET Hardware and Software Manual

Chapter 5

NI-XNET API for C

FlexRay:Max Without Clock Correction Passive
Data Type u32 Direction Read/Write Required? Default Yes Read from Database

Property Class
XNET Cluster

Property ID
nxPropClst_FlexRayMaxWoClkCorPas

Description
This property defines the number of consecutive even/odd cycle pairs with missing clock correction terms that cause the controller to transition from the Protocol Operation Control status of Normal Active to Normal Passive. Use this global parameter as a threshold for testing the clock correction failure counter.
Note

This property, Max Without Clock Correction Passive, <= Max Without Clock Correction Fatal <= 15.

This property corresponds to the global cluster parameter
gMaxWithoutClockCorrectionPassive in the FlexRay Protocol Specification.

The values for this property are in the range 1–15 even/odd cycle pairs. This property is required. If the property does not contain a valid value, and you create an XNET session that uses this cluster, the session returns an error. To ensure that the property contains a valid value, you can do one of the following: • • Use a database file (or alias) to create the session. The file formats require a valid value in the text for this property. Set a value in LabVIEW using the property node. This is needed when you create your own in-memory database (:memory:) rather than use a file. The property does not contain a default in this case, so you must set a valid value prior to creating a session. For more information about using database files and in-memory databases, refer to Databases.

NI-XNET Hardware and Software Manual

5-130

ni.com

Chapter 5

NI-XNET API for C

FlexRay:Minislot
Data Type u32 Direction Read/Write Required? Default Yes Read from Database

Property Class
XNET Cluster

Property ID
nxPropClst_FlexRayMinislot

Description
This property specifies the duration of a minislot, expressed in macroticks (MT). This property corresponds to the global cluster parameter gdMinislot in the FlexRay Protocol Specification. In the dynamic segment of the FlexRay cycle, frames can have variable payload length. Minislots are the dynamic segment time increments. In a minislot, a dynamic frame can start transmission, but it usually spans several minislots. If no frame transmits, the slot counter (slot ID) is incremented to allow for the next frame. The total dynamic segment length is determined by multiplying this property by the FlexRay:Number of Minislots property. The total dynamic segment length must be shorter than the Macro Per Cycle property minus the total static segment length. The range for this property is 2–63 MT. This property is required. If the property does not contain a valid value, and you create an XNET session that uses this cluster, the session returns an error. To ensure that the property contains a valid value, you can do one of the following: • • Use a database file (or alias) to create the session. The file formats require a valid value in the text for this property. Set a value in LabVIEW using the property node. This is needed when you create your own in-memory database (:memory:) rather than use a file. The property does not contain a default in this case, so you must set a valid value prior to creating a session. For more information about using database files and in-memory databases, refer to Databases.

© National Instruments Corporation

5-131

NI-XNET Hardware and Software Manual

Chapter 5

NI-XNET API for C

FlexRay:Minislot Action Point Offset
Data Type u32 Direction Read/Write Required? Default Yes Read from Database

Property Class
XNET Cluster

Property ID
nxPropClst_FlexRayMinislotActPt

Description
This property specifies the number of macroticks (MT) the minislot action point is offset from the beginning of a minislot. This property corresponds to the global cluster parameter gdMinislotActionPointOffset in the FlexRay Protocol Specification. The action point is that point within a given slot where the actual transmission of a frame starts. This is slightly later than the start of the slot to allow for a clock drift between the network nodes. The range for this property is 1–31 MT. This property is required. If the property does not contain a valid value, and you create an XNET session that uses this cluster, the session returns an error. To ensure that the property contains a valid value, you can do one of the following: • • Use a database file (or alias) to create the session. The file formats require a valid value in the text for this property. Set a value in LabVIEW using the property node. This is needed when you create your own in-memory database (:memory:) rather than use a file. The property does not contain a default in this case, so you must set a valid value prior to creating a session. For more information about using database files and in-memory databases, refer to Databases.

NI-XNET Hardware and Software Manual

5-132

ni.com

Chapter 5

NI-XNET API for C

FlexRay:Network Management Vector Length
Data Type u32 Direction Read/Write Required? Default Yes Read from Database

Property Class
XNET Cluster

Property ID
nxPropClst_FlexRayNMVecLen

Description
This property specifies the length of the Network Management vector (NMVector) in a cluster. Only frames transmitted in the static segment of the communication cycle use the NMVector. The NMVector length specifies the number of bytes in the payload segment of the FlexRay frame transmitted in the status segment that can be used as the NMVector. This property corresponds to the global cluster parameter gNetworkManagementVectorLength in the FlexRay Protocol Specification. The range for this property is 0–12 bytes. This property is required. If the property does not contain a valid value, and you create an XNET session that uses this cluster, the session returns an error. To ensure that the property contains a valid value, you can do one of the following: • • Use a database file (or alias) to create the session. The file formats require a valid value in the text for this property. Set a value in LabVIEW using the property node. This is needed when you create your own in-memory database (:memory:) rather than use a file. The property does not contain a default in this case, so you must set a valid value prior to creating a session. For more information about using database files and in-memory databases, refer to Databases.

© National Instruments Corporation

5-133

NI-XNET Hardware and Software Manual

Chapter 5

NI-XNET API for C

FlexRay:NIT
Data Type u32 Direction Read/Write Required? Default Yes Read from Database

Property Class
XNET Cluster

Property ID
nxPropClst_FlexRayNIT

Description
This property is the Network Idle Time (NIT) duration, expressed in macroticks (MT). This property corresponds to the global cluster parameter gdNIT in the FlexRay Protocol Specification. The NIT is a period at the end of a FlexRay communication cycle where no frames are transmitted. The network nodes use it to re-sync their clocks to the common network time. Configure the NIT to be the Macro Per Cycle property minus the total static and dynamic segment lengths minus the optional symbol window duration. The range for this property is 2–805 MT. This property is required. If the property does not contain a valid value, and you create an XNET session that uses this cluster, the session returns an error. To ensure that the property contains a valid value, you can do one of the following: • • Use a database file (or alias) to create the session. The file formats require a valid value in the text for this property. Set a value in LabVIEW using the property node. This is needed when you create your own in-memory database (:memory:) rather than use a file. The property does not contain a default in this case, so you must set a valid value prior to creating a session. For more information about using database files and in-memory databases, refer to Databases.

NI-XNET Hardware and Software Manual

5-134

ni.com

Chapter 5

NI-XNET API for C

FlexRay:NIT Start
Data Type u32 Direction Read Only Required? Default Yes Calculated from Other Cluster Properties

Property Class
XNET Cluster

Property ID
nxPropClst_FlexRayNITStart

Description
This property specifies the start of the Network Idle Time (NIT), expressed as the number of macroticks (MT) from the start of the cycle. The NIT is a period at the end of a FlexRay communication cycle where no frames are transmitted. The network nodes use it to re-sync their clocks to the common network time. The range for this property is 8–15998 MT. This property is calculated from other cluster properties. It is the total size of the static and dynamic segments plus the symbol window length, which is optional in a FlexRay communication cycle.

© National Instruments Corporation

5-135

NI-XNET Hardware and Software Manual

Chapter 5

NI-XNET API for C

FlexRay:Number of Minislots
Data Type u32 Direction Read/Write Required? Default Yes Read from Database

Property Class
XNET Cluster

Property ID
nxPropClst_FlexRayNumMinislt

Description
This property specifies the number of minislots in the dynamic segment. This property corresponds to the global cluster parameter gNumberOfMinislots in the FlexRay Protocol Specification. In the FlexRay cycle dynamic segment, frames can have variable payload lengths. Minislots are the dynamic segment time increments. In a minislot, a dynamic frame can start transmission, but it usually spans several minislots. If no frame transmits, the slot counter (slot ID) is incremented to allow for the next frame. The total dynamic segment length is determined by multiplying this property by the Minislot property. The total dynamic segment length must be shorter than the Macro Per Cycle property minus the total static segment length. The range for this property is 0–7986. This property is required. If the property does not contain a valid value, and you create an XNET session that uses this cluster, the session returns an error. To ensure that the property contains a valid value, you can do one of the following: • • Use a database file (or alias) to create the session. The file formats require a valid value in the text for this property. Set a value in LabVIEW using the property node. This is needed when you create your own in-memory database (:memory:) rather than use a file. The property does not contain a default in this case, so you must set a valid value prior to creating a session. For more information about using database files and in-memory databases, refer to Databases.

NI-XNET Hardware and Software Manual

5-136

ni.com

Chapter 5

NI-XNET API for C

FlexRay:Number of Static Slots
Data Type u32 Direction Read/Write Required? Default Yes Read from Database

Property Class
XNET Cluster

Property ID
nxPropClst_FlexRayNumStatSlt

Description
This property specifies the number of static slots in the static segment. This property corresponds to the global cluster parameter gNumberOfStaticSlots in the FlexRay Protocol Specification. Each static slot is used to transmit one (static) frame on the bus. The total static segment length is determined by multiplying this property by the Static Slot property. The total static segment length must be shorter than the Macro Per Cycle property. The range for this property is 2–1023. This property is required. If the property does not contain a valid value, and you create an XNET session that uses this cluster, the session returns an error. To ensure that the property contains a valid value, you can do one of the following: • • Use a database file (or alias) to create the session. The file formats require a valid value in the text for this property. Set a value in LabVIEW using the property node. This is needed when you create your own in-memory database (:memory:) rather than use a file. The property does not contain a default in this case, so you must set a valid value prior to creating a session. For more information about using database files and in-memory databases, refer to Databases.

© National Instruments Corporation

5-137

NI-XNET Hardware and Software Manual

NI-XNET Hardware and Software Manual 5-138 ni.com . The range for this property is 9–15999 MT. This property corresponds to the global cluster parameter gOffsetCorrectionStart in the FlexRay Protocol Specification. The NIT is a period at the end of a FlexRay communication cycle where no frames are transmitted. For more information about using database files and in-memory databases. expressed as the number of macroticks (MT) from the start of the cycle. If the property does not contain a valid value. the session returns an error. The file formats require a valid value in the text for this property. you can do one of the following: • • Use a database file (or alias) to create the session. but can deviate from that value. refer to Databases. This property is required. The Offset Correction Start is usually configured to be NIT Start + 1. and you create an XNET session that uses this cluster. The network nodes use it to re-sync their clocks to the common network time. so you must set a valid value prior to creating a session. The property does not contain a default in this case.Chapter 5 NI-XNET API for C FlexRay:Offset Correction Start Data Type u32 Direction Read/Write Required? Default Yes Read from Database Property Class XNET Cluster Property ID nxPropClst_FlexRayOffCorSt Description This property specifies the start of the offset correction phase within the Network Idle Time (NIT). Set a value in LabVIEW using the property node. To ensure that the property contains a valid value. This is needed when you create your own in-memory database (:memory:) rather than use a file.

Chapter 5 NI-XNET API for C FlexRay:Payload Length Dynamic Maximum Data Type u32 Direction Read/Write Required? Default Yes Read from Database Property Class XNET Cluster Property ID nxPropClst_FlexRayPayldLenDynMax Description This property specifies the maximum of the payload lengths of all dynamic frames. the maximum of the frames is returned again. But this setting is lost once the database is closed. You may temporarily set this to a larger value (if it is not yet the maximum). The value returned for this property is the maximum of the payload lengths of all frames defined for the dynamic segment in the database. and you create an XNET session that uses this cluster. the session returns an error. Use this property to calculate the XNET Cluster FlexRay:Latest Usable Dynamic Slot and FlexRay:Latest Guaranteed Dynamic Slot properties. refer to Databases. Set a value in LabVIEW using the property node. so you must set a valid value prior to creating a session. The range for this property is 0–254 bytes (even numbers only). If the property does not contain a valid value. you can do one of the following: • • Use a database file (or alias) to create the session. and after a reopen. The property does not contain a default in this case. © National Instruments Corporation 5-139 NI-XNET Hardware and Software Manual . The file formats require a valid value in the text for this property. The changed value is returned from the FlexRay:Payload Length Dynamic Maximum property until the database is closed. and then this value is returned for this property. To ensure that the property contains a valid value. For more information about using database files and in-memory databases. In the FlexRay cycle dynamic segment. This is needed when you create your own in-memory database (:memory:) rather than use a file. frames can have variable payload length. This property is required.

com .Chapter 5 NI-XNET API for C FlexRay:Payload Length Maximum Data Type u32 Direction Read Only Required? Default Yes Calculated from Other Cluster Properties Property Class XNET Cluster Property ID nxPropClst_FlexRayPayldLenMax Description This property returns the payload length of any frame (static or dynamic) in this cluster with the longest payload. The range for this property is 0–254 bytes (even numbers only). NI-XNET Hardware and Software Manual 5-140 ni. The payload specifies that the frame transfers the data.

Set a value in LabVIEW using the property node. If the property does not contain a valid value. and you create an XNET session that uses this cluster. refer to Databases.Chapter 5 NI-XNET API for C FlexRay:Payload Length Static Data Type u32 Direction Read/Write Required? Default Yes Read from Database Property Class XNET Cluster Property ID nxPropClst_FlexRayPayldLenSt Description This property specifies the payload length of a static frame. This property corresponds to the global cluster parameter gPayloadLengthStatic in the FlexRay Protocol Specification. For more information about using database files and in-memory databases. All static frames in a cluster have the same payload length. the session returns an error. © National Instruments Corporation 5-141 NI-XNET Hardware and Software Manual . you can do one of the following: • • Use a database file (or alias) to create the session. This is needed when you create your own in-memory database (:memory:) rather than use a file. To ensure that the property contains a valid value. This property is required. The property does not contain a default in this case. The range for this property is 0–254 bytes (even numbers only). The file formats require a valid value in the text for this property. so you must set a valid value prior to creating a session.

Chapter 5 NI-XNET API for C FlexRay:Static Slot Data Type u32 Direction Read/Write Required? Default Yes Read from Database Property Class XNET Cluster Property ID nxPropClst_FlexRayStatSlot Description This property specifies the duration of a slot in the static segment in macroticks (MT). refer to Databases. For more information about using database files and in-memory databases. This property corresponds to the global cluster parameter gdStaticSlot in the FlexRay Protocol Specification. The total static segment length is determined by multiplying this property by the FlexRay:Number of Static Slots property. Each static slot is used to transmit one (static) frame on the bus. The total static segment length must be shorter than the FlexRay:Macro Per Cycle property. as well as maximum propagation delay. If the property does not contain a valid value. Set a value in LabVIEW using the property node. To ensure that the property contains a valid value. The property does not contain a default in this case. therefore. the duration of a static frame is the same. you can do one of the following: • • Use a database file (or alias) to create the session. The file formats require a valid value in the text for this property.com . NI-XNET Hardware and Software Manual 5-142 ni. the session returns an error. so you must set a valid value prior to creating a session. and you create an XNET session that uses this cluster. all frames must have the same payload length. The range for this property is 4–661 MT. This is needed when you create your own in-memory database (:memory:) rather than use a file. This property is required. The static slot duration takes into account the XNET Cluster FlexRay:Payload Length Static and FlexRay:Action Point Offset properties. In the FlexRay cycle static segment.

The property does not contain a default in this case. expressed in macroticks (MT). © National Instruments Corporation 5-143 NI-XNET Hardware and Software Manual . If the property does not contain a valid value. This property corresponds to the global cluster parameter gdSymbolWindow in the FlexRay Protocol Specification. The symbol window is optional for a given cluster (the Symbol Window property can be zero). so you must set a valid value prior to creating a session. This property is required. A symbol transmission starts at the action point offset within the symbol window. The range for this property is 0–142 MT. The file formats require a valid value in the text for this property. and you create an XNET session that uses this cluster. To ensure that the property contains a valid value. the session returns an error. you can do one of the following: • • Use a database file (or alias) to create the session. Set a value in LabVIEW using the property node. refer to Databases. The symbol window is a slot after the static and dynamic segment.Chapter 5 NI-XNET API for C FlexRay:Symbol Window Data Type u32 Direction Read/Write Required? Default Yes Read from Database Property Class XNET Cluster Property ID nxPropClst_FlexRaySymWin Description This property specifies the symbol window duration. and is used to transmit Collision Avoidance symbols (CAS) and/or Media Access Test symbols (MTS). This is needed when you create your own in-memory database (:memory:) rather than use a file. For more information about using database files and in-memory databases.

com . This property is calculated from other cluster properties. The range for this property is 8–15998 MT.Chapter 5 NI-XNET API for C FlexRay:Symbol Window Start Data Type u32 Direction Read Only Required? Default Yes Calculated from Other Cluster Properties Property Class XNET Cluster Property ID nxPropClst_FlexRaySymWinStart Description This property specifies the macrotick offset at which the symbol window begins from the start of the cycle. It is based on the total static and dynamic segment size. It is set to zero if the Symbol Window property is 0 (no symbol window exists). a channel sends a single Media Test Access Symbol (MTS). NI-XNET Hardware and Software Manual 5-144 ni. During the symbol window.

you can do one of the following: • • Use a database file (or alias) to create the session. Sync frames define the zero points for the clock drift measurement. This is needed when you create your own in-memory database (:memory:) rather than use a file. so you must set a valid value prior to creating a session. The file formats require a valid value in the text for this property. For more information about using database files and in-memory databases. There must be at least two startup nodes in a network. This property is required. This property corresponds to the global cluster parameter gSyncNodeMax in the FlexRay Protocol Specification. © National Instruments Corporation 5-145 NI-XNET Hardware and Software Manual .Chapter 5 NI-XNET API for C FlexRay:Sync Node Max Data Type u32 Direction Read/Write Required? Default Yes Read from Database Property Class XNET Cluster Property ID nxPropClst_FlexRaySyncNodeMax Description This property specifies the maximum number of nodes that may send frames with the sync frame indicator bit set to one. The property does not contain a default in this case. The range for this property is 2–15. and you create an XNET session that uses this cluster. Set a value in LabVIEW using the property node. Startup frames are special sync frames transmitted first after a network startup. the session returns an error. refer to Databases. If the property does not contain a valid value. To ensure that the property contains a valid value.

You must set this property to be greater than the expected worst case truncation of a frame.Chapter 5 NI-XNET API for C FlexRay:TSS Transmitter Data Type u32 Direction Read/Write Required? Default Yes Read from Database Property Class XNET Cluster Property ID nxPropClst_FlexRayTSSTx Description This property specifies the number of bits in the Transmission Start Sequence (TSS). The amount of truncation depends on the nodes involved and the channel topology layout. A frame transmission may be truncated at the beginning. so you must set a valid value prior to creating a session. To ensure that the property contains a valid value. NI-XNET Hardware and Software Manual 5-146 ni. This property is required. to cause the star to properly set up input and output connections). For more information about using database files and in-memory databases. the purpose of the TSS is to “open the gates” of an active star (that is. The range for this property is 3–15 bit. the session returns an error. For example. During this setup.com . If the property does not contain a valid value. an active star truncates a number of bits at the beginning of a communication element. and you create an XNET session that uses this cluster. This is needed when you create your own in-memory database (:memory:) rather than use a file. refer to Databases. Set a value in LabVIEW using the property node. you can do one of the following: • • Use a database file (or alias) to create the session. The TSS prevents the frame or symbol content from being truncated. The file formats require a valid value in the text for this property. This property corresponds to the global cluster parameter gdTSSTransmitter in the FlexRay Protocol Specification. The property does not contain a default in this case.

clock differences. Set a value in LabVIEW using the property node. the session returns an error. and other effects can deform the transmitted wakeup pattern. Collisions. This property corresponds to the global cluster parameter gdWakeupSymbolRxIdle in the FlexRay Protocol Specification. The property does not contain a default in this case. © National Instruments Corporation 5-147 NI-XNET Hardware and Software Manual . For more information about using database files and in-memory databases. and you create an XNET session that uses this cluster. you can do one of the following: • • Use a database file (or alias) to create the session. The range for this property is 14–59 gdBit (bit duration). refer to Databases.Chapter 5 NI-XNET API for C FlexRay:Wakeup Symbol Rx Idle Data Type u32 Direction Read/Write Required? Default Yes Read from Database Property Class XNET Cluster Property ID nxPropClst_FlexRayWakeSymRxIdl Description This property specifies the number of bits the node uses to test the idle portion duration of a received wakeup symbol. so you must set a valid value prior to creating a session. This is needed when you create your own in-memory database (:memory:) rather than use a file. To ensure that the property contains a valid value. If the property does not contain a valid value. The file formats require a valid value in the text for this property. This property is required.

This lower limit of zero bits must be received for the receiver to detect the low portion. To ensure that the property contains a valid value. refer to Databases. clock differences. The property does not contain a default in this case. This is needed when you create your own in-memory database (:memory:) rather than use a file. the session returns an error. you can do one of the following: • • Use a database file (or alias) to create the session. For more information about using database files and in-memory databases. Set a value in LabVIEW using the property node. The range for this property is 10–55 gdBit (bit duration). and you create an XNET session that uses this cluster.Chapter 5 NI-XNET API for C FlexRay:Wakeup Symbol Rx Low Data Type u32 Direction Read/Write Required? Default Yes Read from Database Property Class XNET Cluster Property ID nxPropClst_FlexRayWakeSymRxLow Description This property specifies the number of bits the node uses to test the low portion duration of a received wakeup symbol. and other effects can deform the transmitted wakeup pattern. If the property does not contain a valid value. The file formats require a valid value in the text for this property. This property is required. This property corresponds to the global cluster parameter gdWakeupSymbolRxLow in the FlexRay Protocol Specification. so you must set a valid value prior to creating a session. NI-XNET Hardware and Software Manual 5-148 ni. Active starts.com .

Set a value in LabVIEW using the property node. Detection of a wakeup requires a low and idle period from one WUS (wakeup symbol) and a low period from another WUS. This is needed when you create your own in-memory database (:memory:) rather than use a file. The range for this property is 76–301 gdBit (bit duration). To ensure that the property contains a valid value. Clock differences and other effects can deform the transmitted wakeup pattern. the session returns an error.Chapter 5 NI-XNET API for C FlexRay:Wakeup Symbol Rx Window Data Type u32 Direction Read/Write Required? Default Yes Read from Database Property Class XNET Cluster Property ID nxPropClst_FlexRayWakeSymRxWin Description This property specifies the size of the window used to detect wakeups. you can do one of the following: • • Use a database file (or alias) to create the session. so you must set a valid value prior to creating a session. If the property does not contain a valid value. © National Instruments Corporation 5-149 NI-XNET Hardware and Software Manual . refer to Databases. and you create an XNET session that uses this cluster. The property does not contain a default in this case. This property corresponds to the global cluster parameter gdWakeupSymbolRxWindow in the FlexRay Protocol Specification. to be detected entirely within a window of this size. The file formats require a valid value in the text for this property. For more information about using database files and in-memory databases. This property is required.

you can do one of the following: • • Use a database file (or alias) to create the session. Set a value in LabVIEW using the property node. and you create an XNET session that uses this cluster. For more information about using database files and in-memory databases. This property is required. The property does not contain a default in this case. If the property does not contain a valid value. This property corresponds to the global cluster parameter gdWakeupSymbolTxIdle in the FlexRay Protocol Specification.Chapter 5 NI-XNET API for C FlexRay:Wakeup Symbol Tx Idle Data Type u32 Direction Read/Write Required? Default Yes Read from Database Property Class XNET Cluster Property ID nxPropClst_FlexRayWakeSymTxIdl Description This property specifies the number of bits the node uses to transmit the wakeup symbol idle portion. so you must set a valid value prior to creating a session. The range for this property is 45–180 gdBit (bit duration). the session returns an error. To ensure that the property contains a valid value. The file formats require a valid value in the text for this property.com . refer to Databases. NI-XNET Hardware and Software Manual 5-150 ni. This is needed when you create your own in-memory database (:memory:) rather than use a file.

and you create an XNET session that uses this cluster. © National Instruments Corporation 5-151 NI-XNET Hardware and Software Manual . The file formats require a valid value in the text for this property. To ensure that the property contains a valid value. The property does not contain a default in this case. This is needed when you create your own in-memory database (:memory:) rather than use a file. This property corresponds to the global cluster parameter gdWakeupSymbolTxLow in the FlexRay Protocol Specification. you can do one of the following: • • Use a database file (or alias) to create the session. The range for this property is 15–60 gdBit (bit duration). This property is required. If the property does not contain a valid value. refer to Databases. For more information about using database files and in-memory databases. Set a value in LabVIEW using the property node. the session returns an error.Chapter 5 NI-XNET API for C FlexRay:Wakeup Symbol Tx Low Data Type u32 Direction Read/Write Required? Default Yes Read from Database Property Class XNET Cluster Property ID nxPropClst_FlexRayWakeSymTxLow Description This property specifies the number of bits the node uses to transmit the wakeup symbol low phase. so you must set a valid value prior to creating a session.

To remove a frame from a cluster. Returns an array of refnums to all frames defined in this cluster. You cannot change this assignment afterwards. A frame is assigned to a cluster when the frame object is created. To add a frame to a cluster. NI-XNET Hardware and Software Manual 5-152 ni. use nxdbCreateObject.com .Chapter 5 NI-XNET API for C Frames Data Type nxDatabaseRef_t * Direction Read Only Required? N/A Default N/A Property Class XNET Cluster Property ID nxPropClst_FrmRefs Description Frames in this cluster. use nxdbDeleteObject.

and not a number. the short name comes from the file (CAN_Cluster for CANdb). The short name is limited to 128 characters.Chapter 5 NI-XNET API for C Name (Short) Data Type char * Direction Read/Write Required? Default Yes Defined in Create Object Property Class XNET Cluster Property ID nxPropClst_Name Description String identifying the cluster object.). such as the database name. If you use a file. it comes from the Name input of nxdbCreateObject. This short name does not include qualifiers to ensure that it is unique. Space ( ). dot (. © National Instruments Corporation 5-153 NI-XNET Hardware and Software Manual . Valid characters for the short name are lowercase letters. and other special characters are not supported within the name. numbers. and underscore (_). If you create the cluster yourself. It is for display purposes. uppercase letters. A cluster name must be unique for all clusters in a database. The short name must begin with a letter (uppercase or lowercase) or underscore. You can write this property to change the cluster’s short name.

To remove a signal from a cluster. NI-XNET Hardware and Software Manual 5-154 ni. use nxdbDeleteObject.com . You cannot change this assignment afterwards. The values (enumeration) for this property are: 0 1 CAN FlexRay Signals Data Type nxDatabaseRef_t * Direction Read Only Required? N/A Default N/A Property Class XNET Cluster Property ID nxPropClst_SigRefs Description This property returns refnums to all XNET Signals defined in this cluster. use nxdbCreateObject. To add a signal to a cluster. A signal is assigned to a cluster when the signal object is created.Chapter 5 NI-XNET API for C Protocol Data Type u32 Direction Read/Write Required? Default No CAN Property Class XNET Cluster Property ID nxPropClst_Protocol Description Determines the cluster protocol.

© National Instruments Corporation 5-155 NI-XNET Hardware and Software Manual . Clusters Data Type nxDatabaseRef_t * Direction Read Only Required? N/A Default N/A Property Class XNET Database Property ID nxPropDatabase_ClstRefs Description Returns an array of refnums to XNET Clusters in this database.ncd and . FIBEX files can contain any number of clusters. A cluster is assigned to a database when the cluster object is created. CAN databases (.dbc) contain only one cluster with the name CAN_Cluster. You cannot change this assignment afterwards.Chapter 5 NI-XNET API for C XNET Database Properties This section includes the XNET Database properties.

but the frame is returned from XNET Cluster Frames. the Configuration Status returns an error. and XNET Frame Signals properties. and signals are incorrectly defined and therefore cannot be used in the bus communication. and XNET Signal Configuration Status properties return an error code that explains the problem. XNET Cluster Frames. even if ShowInvalidFromOpen? is false and Configuration Status returns an error code. The false setting is recommended when you use the database to create XNET sessions. and signals are not returned in the XNET Database Clusters. and XNET Frame Signals properties.Chapter 5 NI-XNET API for C ShowInvalidFromOpen? Data Type Boolean Direction Read/Write Required? Default No False Property Class XNET Database Property ID nxPropDatabase_ShowInvalidFromOpen Description Shows frames and signals that are invalid at database open time. For example. NI-XNET Hardware and Software Manual 5-156 ni. For invalid objects. then you set the Start Bit beyond the payload length. Configuration Status returns success (no error). XNET Cluster Frames. you must set the property to true prior to reading the XNET Database Clusters. frames. this property always is set to false. After opening a database. XNET Cluster Frames. frames. and XNET Frame Signals properties. XNET Frame Configuration Status. frames. In case the database was opened to correct invalid configuration (for example. Clusters. in a database editor). and signals that became invalid after the database is opened are still returned from the XNET Database Clusters.com . Invalid clusters. meaning that invalid clusters. the XNET Cluster Configuration Status. if you open the frame with valid properties. For valid objects.

Form Factor Data Type u32 Direction Read Only Required? Default No N/A Property Class XNET Device Property ID nxPropDev_FormFac Description Returns the XNET board physical form factor. Enumeration PXI PCI Value 0 1 Interfaces Data Type u32[] Direction Read Only Required? Default No N/A Property Class XNET Device Property ID nxPropDev_IntfRefs Description Returns an array of handles to all interfaces associated with this physical hardware device. © National Instruments Corporation 5-157 NI-XNET Hardware and Software Manual .Chapter 5 NI-XNET API for C XNET Device Properties This section includes the XNET Device properties.

com . NI-XNET Hardware and Software Manual 5-158 ni. returns 2 for an NI PCI-8517 two-port FlexRay device. returns NI PCI-8517 (2 ports) for an NI PCI-8517 device. Remarks For example.Chapter 5 NI-XNET API for C Number of Ports Data Type u32 Direction Read Only Required? Default No N/A Property Class XNET Device Property ID nxPropDev_NumPorts Description Returns the number of physical port connectors on the XNET board. Remarks For example. Product Name Data Type cstr Direction Read Only Required? Default No N/A Property Class XNET Device Property ID nxPropDev_Name Description Returns the XNET device product name.

returns 8517 for an NI PCI-8517 two-port FlexRay device. Convert the return value from this property to hex to match the label. Remarks The serial number is written in hex on a label on the physical XNET board. © National Instruments Corporation 5-159 NI-XNET Hardware and Software Manual . Serial Number Data Type u32 Direction Read Only Required? Default No N/A Property Class XNET Device Property ID nxPropDev_SerNum Description Returns the serial number associated with the XNET device.Chapter 5 NI-XNET API for C Product Number Data Type u32 Direction Read Only Required? Default No N/A Property Class XNET Device Property ID nxPropDev_ProductNum Description Returns the numeric portion of the XNET device product name. Remarks For example.

com . The parent cluster is determined when the ECU object is created.Chapter 5 NI-XNET API for C XNET ECU Properties This section includes the XNET ECU properties. You cannot change it afterwards. NI-XNET Hardware and Software Manual 5-160 ni. Comment Data Type char * Direction Read/Write Required? Default No Empty String Property Class XNET ECU Property ID nxPropECU_Comment Description Comment describing the ECU object. A comment is a string containing up to 65535 characters. Cluster Data Type nxDatabaseRef_t Direction Read Only Required? N/A Default N/A Property Class XNET ECU Property ID nxPropECU_ClstRef Description Refnum to the parent cluster to which the ECU is connected.

You can change this behavior by setting the XNET Database ShowInvalidFromOpen? property to true. © National Instruments Corporation 5-161 NI-XNET Hardware and Software Manual . Configuration Status returns an NI-XNET error code. incorrectly configured ECUs in the database are not returned from the XNET Cluster ECUs property because they cannot be used in the bus communication. When the configuration status of an ECU became invalid after the database is opened. the ECU still is returned from the ECUs property even if ShowInvalidFromOpen? is false. You can pass the value to the nxStatusToString error code input to convert the value to a text description of the configuration problem. By default.Chapter 5 NI-XNET API for C Configuration Status Data Type i32 Direction Read Only Required? Default N/A N/A Property Class XNET ECU Property ID nxPropECU_ConfigStatus Description The ECU object configuration status.

it is empty.Chapter 5 NI-XNET API for C FlexRay:Coldstart? Data Type Boolean Direction Read Only Required? Default N/A N/A Property Class XNET ECU Property ID nxPropECU_FlexRayIsColdstart Description Indicates that the ECU is sending a startup frame. If the ECU transmits a frame (refer to the XNET ECU Frames Transmitted property) with the XNET Frame FlexRay:Startup? property set to true.com . It returns true when one of the frames this ECU transmits (refer to the XNET ECU Frames Transmitted property) has the XNET Frame FlexRay:Startup? property set to true. This property is valid only for ECUs connected to a FlexRay bus. An ECU can send only one startup frame on the FlexRay bus. this property returns this frame. Otherwise. You can determine the frame transmitting the startup using the XNET ECU FlexRay:Startup Frame property. NI-XNET Hardware and Software Manual 5-162 ni. This property is valid only for ECUs connected to a FlexRay bus. FlexRay:Startup Frame Data Type nxDatabaseRef_t Direction Read Only Required? N/A Default N/A Property Class XNET ECU Property ID nxPropECU_FlexRayStartupFrameRef Description Returns the refnum to the startup frame the ECU sends.

All frames an ECU receives in a given cluster must be defined in the same cluster. Frames Transmitted Data Type nxDatabaseRef_t * Direction Read/Write Required? No Default Empty Array Property Class XNET ECU Property ID nxPropECU_FrmsTx Description Returns an array of refnums to frames the ECU transmits. This property defines all frames the ECU transmits. All frames an ECU transmits in a given cluster must be defined in the same cluster. This property defines all frames the ECU receives.Chapter 5 NI-XNET API for C Frames Received Data Type Direction Required? No Default Empty Array nxDatabaseRef_t * Read/Write Property Class XNET ECU Property ID nxPropECU_RxFrmRefs Description Returns an array of refnums to frames the ECU receives. © National Instruments Corporation 5-163 NI-XNET Hardware and Software Manual .

Valid characters for the short name are lowercase letters. You can write this property to change the ECU’s short name.com . The short name must begin with a letter (uppercase or lowercase) or underscore. Space ( ). and other special characters are not supported within the name. dot (.Chapter 5 NI-XNET API for C Name (Short) Data Type char * Direction Read/Write Required? Default Yes Defined in Create Object Property Class XNET ECU Property ID nxPropECU_Name Description String identifying the ECU object.). and underscore (_). An ECU name must be unique for all ECUs in a cluster. This short name does not include qualifiers to ensure that it is unique. It is for display purposes. such as the database and cluster name. NI-XNET Hardware and Software Manual 5-164 ni. and not a number. numbers. The short name is limited to 128 characters. uppercase letters.

Chapter 5 NI-XNET API for C XNET Frame Properties This section includes the XNET Frame properties. CAN:Extended Identifier? Data Type Boolean Direction Read/Write Required? Default No False Property Class XNET Frame Property ID nxPropFrm_CANExtID Description This property determines whether the XNET Frame Identifier property in a CAN cluster represents a standard 11-bit (false) or extended 29-bit (true) arbitration ID. © National Instruments Corporation 5-165 NI-XNET Hardware and Software Manual .

The transmitting ECU ignores CAN remote frames received for this frame. it describes the transfer between ECUs in the network. The XNET Frame CAN:Transmit Time property defines the time between cycles. an output session acts as the transmitting ECU. Because this property specifies the behavior of the frame’s transfer within the embedded system (for example. For NI-XNET. The transmitting ECU ignores CAN remote frames received for this frame. Receiving ECU refers to an ECU that receives the CAN data frame (and possibly transmits the associated CAN remote frame). The CAN timing types (decimal value in parentheses) are: nxFrmCANTiming_CyclicData (0) The transmitting ECU transmits the CAN data frame in a cyclic (periodic) manner. a vehicle). NI-XNET Hardware and Software Manual 5-166 ni. and an input session acts as a receiving ECU. When you use the frame within an NI-XNET session. nxFrmCANTiming_EventData (1) The transmitting ECU transmits the CAN data frame in an event-driven manner. For a description of how these CAN timing types apply to the NI-XNET session mode. refer to CAN Timing Type and Session Mode. The XNET Frame CAN:Transmit Time property defines the minimum interval.Chapter 5 NI-XNET API for C CAN:Timing Type Data Type u32 Direction Read/Write Required? Default No Event Data (If Not in Database) Property Class XNET Frame Property ID nxPropFrm_CANTimingType Description Specifies the CAN frame timing. nxFrmCANTiming_CyclicRemote (2) The receiving ECU transmits the CAN remote frame in a cyclic (periodic) manner. The XNET Frame CAN:Transmit Time property defines the time between cycles. The transmitting ECU responds to each CAN remote frame by transmitting the associated CAN data frame. transmitting ECU refers to the ECU that transmits the CAN data frame (and possibly receives the associated CAN remote frame). In the following description.com . the event occurs when you call nxWrite.

For NI-XNET. If NI-XNET finds an attribute named GenMsgSendType. that attribute is the default value of this property. so the default (initial) value is obtained from the file. If you are using an . which you can change in your application. change this property to the desired timing type.ncd database or an in-memory database (XNET Create Frame). If you are using a FIBEX database.dbc) database. this property’s default value is Cyclic Data. Within your application. this property uses a default value of Event Data. The transmitting ECU responds to each CAN remote frame by transmitting the associated CAN data frame. it is Event Data. this property uses a default value of Event Data.Chapter 5 NI-XNET API for C nxFrmCANTiming_EventRemote (3) The receiving ECU transmits the CAN remote frame in an event-driven manner. The XNET Frame CAN:Transmit Time property defines the minimum interval. otherwise. If the CANdb file does not use the GenMsgSendType attribute. the event occurs when you call nxWrite. If the GenMsgSendType attribute begins with cyclic. this property is a required part of the XML schema for a frame. If you are using a CANdb (. this property is an optional attribute in the file. © National Instruments Corporation 5-167 NI-XNET Hardware and Software Manual .

Chapter 5

NI-XNET API for C

CAN:Transmit Time
Data Type Double Direction Read/Write Required? Default No 0.1 (If Not in Database)

Property Class
XNET Frame

Property ID
nxPropFrm_CANTxTime

Description
Specifies the time between consecutive frames from the transmitting ECU. The data type is 64-bit floating point (DBL). The units are in seconds. Although the fractional part of the DBL data type can provide resolution of picoseconds, the NI-XNET CAN transmit supports an accuracy of 500 µs. Therefore, when used within an NI-XNET output session, this property is rounded to the nearest 500 µs increment (0.0005). For an XNET Frame CAN:Timing Type of Cyclic Data or Cyclic Remote, this property specifies the time between consecutive data/remote frames. A time of 0.0 is invalid. For an XNET Frame CAN:Timing Type of Event Data or Event Remote, this property specifies the minimum time between consecutive data/remote frames when the event occurs quickly. This is also known as the debounce time or minimum interval. The time is measured from the end of previous frame (acknowledgment) to the start of the next frame. A time of 0.0 specifies no minimum (back to back frames allowed). If you are using a FIBEX database, this property is a required part of the XML schema for a frame, so the default (initial) value is obtained from the file. If you are using a CANdb (.dbc) database, this property is an optional attribute in the file. If NI-XNET finds an attribute named GenMsgCycleTime, that attribute is interpreted as a number of milliseconds and used as the default value of this property. If the CANdb file does not use the GenMsgCycleTime attribute, this property uses a default value of 0.1 (100 ms), which you can change in your application. If you are using a .ncd database or an in-memory database (XNET Create Frame), this property uses a default value of 0.1 (100 ms). Within your application, change this property to the desired time.

NI-XNET Hardware and Software Manual

5-168

ni.com

Chapter 5

NI-XNET API for C

Cluster
Data Type nxDatabaseRef_t Direction Read Only Required? N/A Default N/A

Property Class
XNET Frame

Property ID
nxPropFrm_ClusterRef

Description
This property returns the refnum to the parent cluster in which the frame has been created. You cannot change the parent cluster after the frame object has been created.

Comment
Data Type char * Direction Read/Write Required? Default No Empty String

Property Class
XNET Frame

Property ID
nxPropFrm_Comment

Description
Comment describing the frame object. A comment is a string containing up to 65535 characters.

© National Instruments Corporation

5-169

NI-XNET Hardware and Software Manual

Chapter 5

NI-XNET API for C

Configuration Status
Data Type i32 Direction Read Only Required? Default N/A N/A

Property Class
XNET Frame

Property ID
nxPropFrm_ConfigStatus

Description
The frame object configuration status. Configuration Status returns an NI-XNET error code. You can pass the value to the nxStatusToString error code input to convert the value to a text description of the configuration problem. By default, incorrectly configured frames in the database are not returned from the XNET Cluster Frames property because they cannot be used in the bus communication. You can change this behavior by setting the XNET Database ShowInvalidFromOpen? property to true. When a frame configuration status became invalid after the database is opened, the frame still is returned from the XNET Cluster Frames property even if ShowInvalidFromOpen? is false. Examples of invalid frame configuration: • • • • A required property of the frame or an object contained in this frame has not been defined. For example, Frame Payload Length. The number of bytes specified for this frame is incorrect. CAN frames must use 0 to 8 bytes. FlexRay frames must use 0 to 254 bytes (even numbers only). The CAN arbitration ID is invalid. The standard ID is greater than 0x7FF (11 bits) or the extended ID is greater than 0x1FFFFFFF (29 bits). The FlexRay frame is specified to use channels not defined in the cluster. For example, the XNET Cluster FlexRay:Channels property is set to Channel A only, but the XNET Frame FlexRay:Channel Assignment property is set to Channel A and B. The XNET Frame FlexRay:Channel Assignment property in this dynamic FlexRay frame is set to Channel A and B, but dynamic frames can be sent on only one channel (A or B).

NI-XNET Hardware and Software Manual

5-170

ni.com

Chapter 5

NI-XNET API for C

Default Payload
Data Type u8 * Direction Read/Write Required? Default No Array of All 0

Property Class
XNET Frame

Property ID
nxPropFrm_DefaultPayload

Description
The frame default payload, specified as an array of bytes (U8). The number of bytes in the array must match the XNET Frame Payload Length property. This property’s initial value is an array of all 0. For the database formats NI-XNET supports, this property is not provided in the database file. When you use this frame within an NI-XNET session, this property’s use varies depending on the session mode. The following sections describe this property’s behavior for each session mode.

Frame Output Single-Point and Frame Output Queued Modes
Use this property when a frame transmits prior to a call to nxWrite. This can occur when you set the XNET Session Auto Start? property to false and call nxStart prior to nxWrite. When Auto Start? is true (default), the first call to nxWrite also starts frame transmit, so this property is not used. The following frame configurations potentially can transmit prior to a call to nxWrite: • • • • XNET Frame CAN:Timing Type of Cyclic Data. XNET Frame CAN:Timing Type of Cyclic Remote (for example, a remote frame received prior to a call to nxWrite). XNET Frame CAN:Timing Type of Event Remote (for example, a remote frame received prior to a call to nxWrite). XNET Frame CAN:Timing Type of Cyclic.

© National Instruments Corporation

5-171

NI-XNET Hardware and Software Manual

Chapter 5

NI-XNET API for C

The following frame configurations cannot transmit prior to a call to nxWrite, so this property is not used: • • XNET Frame CAN:Timing Type of Event Data. XNET Frame FlexRay:Timing Type of Event.

Frame Output Stream Mode
This property is not used. Transmit is limited to frames provided to nxWrite.

Signal Output Single-Point, Signal Output Waveform, and Signal Output XY Modes
Use this property when a frame transmits prior to a call to nxWrite. Refer to Frame Output Single-Point and Frame Output Queued Modes for a list of applicable frame configurations. This property is used as the initial payload, then each XNET Signal Default Value is mapped into that payload, and the result is used for the frame transmit.

Frame Input Stream and Frame Input Queued Modes
This property is not used. These modes do not return data prior to receiving frames.

Frame Input Single-Point Mode
This property is used for frames nxRead returns prior to receiving the first frame.

Signal Input Single-Point, Signal Input Waveform, and Signal Input XY Modes
This property is not used. Each XNET Signal Default Value is used when nxRead is called prior to receiving the first frame.

NI-XNET Hardware and Software Manual

5-172

ni.com

Chapter 5

NI-XNET API for C

FlexRay:Base Cycle
Data Type u32 Direction Read/Write Required? Default Yes N/A

Property Class
XNET Frame

Property ID
nxPropFrm_FlexRayBaseCycle

Description
The first communication cycle in which a frame is sent. In FlexRay, a communication cycle contains a number of slots in which a frame can be sent. Every node on the bus provides a 6-bit cycle counter that counts the cycles from 0 to 63 and then restarts at 0. The cycle number is common for all nodes on the bus. NI-XNET has two mechanisms for changing the frame sending frequency: • • If the frame should be sent faster than the cycle period, use In-Cycle Repetition (refer to the XNET Frame FlexRay:In Cycle Repetitions:Identifiers property). If the frame should be sent slower than the cycle period, use this property and the XNET Frame FlexRay:Cycle Repetition property.

The second method is called cycle multiplexing. It allows sending multiple frames in the same slot, but on different cycle counters. If a frame should be sent in every cycle, set this property to 0 and the XNET Frame FlexRay:Cycle Repetition property to 1. For cycle multiplexing, set the FlexRay:Cycle Repetition property to 2, 4, 8, 16, 32, or 64. Example: • • FrameA and FrameB are both sent in slot 12. FrameA: The FlexRay:Base Cycle property is 0 and XNET Frame FlexRay:Cycle Repetition property is 2. This frame is sent when the cycle counter has the value 0, 2, 4, 6, .... FrameB: The FlexRay:Base Cycle property is 1 and XNET Frame FlexRay:Cycle Repetition property is 2. This frame is sent when the cycle counter has the value 1, 3, 5, 7, ....

© National Instruments Corporation

5-173

NI-XNET Hardware and Software Manual

Chapter 5

NI-XNET API for C

This property is required. If the property does not contain a valid value, and you create an XNET session that uses this frame, the session returns an error. To ensure that the property contains a valid value, you can do one of the following: • • Use a database file (or alias) to create the session. The file formats require a valid value in the text for this property. Set a value in LabVIEW using the property node. This is needed when you create your own in-memory database (:memory:) rather than use a file. The property does not contain a default in this case, so you must set a valid value prior to creating a session. For more information about using database files and in-memory databases, refer to Databases.

NI-XNET Hardware and Software Manual

5-174

ni.com

Chapter 5

NI-XNET API for C

FlexRay:Channel Assignment
Data Type u32 Direction Read/Write Required? Default Yes N/A

Property Class
XNET Frame

Property ID
nxPropFrm_FlexRayChAssign

Description
This property determines on which FlexRay channels the frame must be transmitted. A frame can be transmitted only on existing FlexRay channels, configured in the XNET Cluster FlexRay:Channels property. Frames in the dynamic FlexRay segment cannot be sent on both channels; they must use either channel A or B. Frames in the dynamic segment use slot IDs greater than the number of static slots cluster parameter. This property is required. If the property does not contain a valid value, and you create an XNET session that uses this frame, the session returns an error. To ensure that the property contains a valid value, you can do one of the following: • • Use a database file (or alias) to create the session. The file formats require a valid value in the text for this property. Set a value in LabVIEW using the property node. This is needed when you create your own in-memory database (:memory:) rather than use a file. The property does not contain a default in this case, so you must set a valid value prior to creating a session. For more information about using database files and in-memory databases, refer to Databases.

© National Instruments Corporation

5-175

NI-XNET Hardware and Software Manual

Chapter 5

NI-XNET API for C

FlexRay:Cycle Repetition
Data Type u32 Direction Read/Write Required? Default Yes N/A

Property Class
XNET Frame

Property ID
nxPropFrm_FlexRayCycleRep

Description
The number of cycles after which a frame is sent again. In FlexRay, a communication cycle contains a number of slots in which a frame can be sent. Every node on the bus provides a 6-bit cycle counter that counts the cycles from 0 to 63 and then restarts at 0. The cycle number is common for all nodes on the bus. NI-XNET has two mechanisms for changing the frame sending frequency: • • If the frame should be sent faster than the cycle period, use In-Cycle Repetition (refer to the XNET Frame FlexRay:In Cycle Repetitions:Identifiers property). If the frame should be sent slower than the cycle period, use the XNET Frame FlexRay:Base Cycle property and this property.

The second method is called cycle multiplexing. It allows sending multiple frames in the same slot, but on different cycle counters. If a frame should be sent in every cycle, set the XNET Frame FlexRay:Base Cycle property property to 0 and this property to 1. For cycle multiplexing, set this property to 2, 4, 8, 16, 32, or 64. Examples: • • FrameA and FrameB are both sent in slot 12. FrameA: The XNET Frame FlexRay:Base Cycle property is set to 0 and FlexRay:Cycle Repetition property is set to 2. This frame is sent when the cycle counter has the value 0, 2, 4, 6, .... FrameB: The XNET Frame FlexRay:Base Cycle property is set to 1 and FlexRay:Cycle Repetition property is set to 2. This frame is sent when the cycle counter has the value 1, 3, 5, 7, ....

NI-XNET Hardware and Software Manual

5-176

ni.com

Chapter 5

NI-XNET API for C

This property is required. If the property does not contain a valid value, and you create an XNET session that uses this frame, the session returns an error. To ensure that the property contains a valid value, you can do one of the following: • • Use a database file (or alias) to create the session. The file formats require a valid value in the text for this property. Set a value in LabVIEW using the property node. This is needed when you create your own in-memory database (:memory:) rather than use a file. The property does not contain a default in this case, so you must set a valid value prior to creating a session. For more information about using database files and in-memory databases, refer to Databases.

© National Instruments Corporation

5-177

NI-XNET Hardware and Software Manual

Chapter 5

NI-XNET API for C

FlexRay:In Cycle Repetitions:Channel Assignments
Data Type u32 * Direction Read/Write Required? Default No Empty Array

Property Class
XNET Frame

Property ID
nxPropFrm_FlexRayInCycRepChAssigns

Description
FlexRay channels for in-cycle frame repetition. A FlexRay frame can be sent multiple times per cycle. The XNET Frame FlexRay:Channel Assignment property defines the first channel assignment in the cycle. This property defines subsequent channel assignments. The XNET Frame FlexRay:In Cycle Repetitions:Identifiers property defines the corresponding slot IDs. Both properties are arrays of maximum three values, determining the slot ID and channel assignments for the frame. Values at the same array position are corresponding; therefore, both arrays must have the same size. You must set the XNET Frame FlexRay:Channel Assignment property before setting this property. The FlexRay:Channel Assignment is a required property that is undefined when a new frame is created. When FlexRay:Channel Assignment is undefined, setting FlexRay:In Cycle Repetitions:Channel Assignments returns an error.

NI-XNET Hardware and Software Manual

5-178

ni.com

Chapter 5

NI-XNET API for C

FlexRay:In Cycle Repetitions:Enabled?
Data Type Boolean Direction Read Only Required? Default No False

Property Class
XNET Frame

Property ID
nxPropFrm_FlexRayInCycRepEnabled

Description
FlexRay in-cycle frame repetition is enabled. A FlexRay frame can be sent multiple times per cycle. The XNET Frame Identifier property defines the first slot ID in the cycle. The XNET Frame FlexRay:In Cycle Repetitions:Identifiers property can define the subsequent slot IDs, and the FlexRay:In Cycle Repetitions:Channel Assignments property defines the corresponding FlexRay channels. Both properties are arrays of maximum three values determining the slot ID and FlexRay channels for the frame. Values at the same array position are corresponding; therefore, both arrays must have the same size. This property returns true when at least one in-cycle repetition has been defined, which means that both the FlexRay:In Cycle Repetitions:Identifiers and XNET Frame FlexRay:In Cycle Repetitions:Channel Assignments arrays are not empty. This property returns false when at least one of the previously mentioned arrays is empty. In this case, in-cycle-repetition is not used.

© National Instruments Corporation

5-179

NI-XNET Hardware and Software Manual

Chapter 5

NI-XNET API for C

FlexRay:In Cycle Repetitions:Identifiers
Data Type u32 * Direction Read/Write Required? Default No Empty Array

Property Class
XNET Frame

Property ID
nxPropFrm_FlexRayInCycRepIDs

Description
FlexRay in-cycle repetition slot IDs. A FlexRay frame can be sent multiple times per cycle. The XNET Frame Identifier property defines the first slot ID in the cycle. The FlexRay:In Cycle Repetitions:Identifiers property defines subsequent slot IDs. The XNET Frame FlexRay:In Cycle Repetitions:Channel Assignments property defines the corresponding FlexRay channel assignments. Both properties are arrays of maximum three values, determining the subsequent slot IDs and channel assignments for the frame. Values at the same array position are corresponding; therefore, both arrays must have the same size. You must set the XNET Frame Identifier property before setting the FlexRay:In Cycle Repetitions:Identifiers property. Identifier is a required property that is undefined when a new frame is created. When Identifier is undefined, setting in-cycle repetition slot IDs returns an error.

NI-XNET Hardware and Software Manual

5-180

ni.com

Chapter 5

NI-XNET API for C

FlexRay:Payload Preamble?
Data Type Boolean Direction Read/Write Required? Default No False

Property Class
XNET Frame

Property ID
nxPropFrm_FlexRayPreamble

Description
This property determines whether payload preamble is used in a FlexRay frame: • • For frames in the static segment, it indicates that the network management vector is transmitted at the beginning of the payload. For frames in the dynamic segment, it indicates that the message ID is transmitted at the beginning of the payload.

© National Instruments Corporation

5-181

NI-XNET Hardware and Software Manual

Chapter 5

NI-XNET API for C

FlexRay:Startup?
Data Type Boolean Direction Read/Write Required? Default No False

Property Class
XNET Frame

Property ID
nxPropFrm_FlexRayStartup

Description
This property determines whether the frame is a FlexRay startup frame. FlexRay startup frames always are FlexRay sync frames also: • • • • When this property is set to true, the XNET Frame FlexRay:Sync? property automatically is set to true. When this property is set to false, the XNET Frame FlexRay:Sync? property is not changed. When the XNET Frame FlexRay:Sync? property is set to false, this property automatically is set to false. When the XNET Frame FlexRay:Sync? property is set to true, this property is not changed.

An ECU can send only one startup frame. The startup frame, if an ECU transmits it, is returned from the XNET ECU FlexRay:Startup Frame property.

NI-XNET Hardware and Software Manual

5-182

ni.com

Chapter 5

NI-XNET API for C

FlexRay:Sync?
Data Type Boolean Direction Read/Write Required? Default No False

Property Class
XNET Frame

Property ID
nxPropFrm_FlexRayStartup

Description
This property determines whether the frame is a FlexRay sync frame. FlexRay startup frames always are FlexRay sync frames also: • • • • When this property is set to false, the XNET Frame FlexRay:Startup? property is automatically set to false. When this property is set to true, the XNET Frame FlexRay:Startup? property is not changed. When the XNET Frame FlexRay:Startup? property is set to true, this property is set to true. When the XNET Frame FlexRay:Startup? property is set to false, this property is not changed.

An ECU can send only one sync frame.

© National Instruments Corporation

5-183

NI-XNET Hardware and Software Manual

Event means the frame transmits in the minislot when the event is pending for the cycle. For a description of how these FlexRay timing types apply to the NI-XNET session mode.Chapter 5 NI-XNET API for C FlexRay:Timing Type Data Type u32 Direction Read/Write Required? Default No Cyclic in Static Segment. Event in Dynamic Segment Property Class XNET Frame Property ID nxPropFrm_FlexRayTimingType Description Specifies the FlexRay frame timing (decimal value in parentheses): nxFrmFlexRayTiming_Cyclic (0) Payload data transmits on every occurrence of the frame’s slot.com . This property’s default value for the dynamic segment is Event. the frame is static. Dynamic Cyclic means the frame transmits in its minislot on every cycle. If new data is not provided for the cycle. the previous payload data transmits again. This property’s default value for the static segment is Cyclic. Event means a null frame is transmitted when no event is pending for the cycle. Within the ECU that transmits the frame. nxFrmFlexRayTiming_Event (1) Payload data transmits in an event-driven manner. NI-XNET Hardware and Software Manual 5-184 ni. refer to FlexRay Timing Type and Session Mode. Static Cyclic means no null frame is transmitted. the event typically is associated with the availability of new data. This property’s behavior depends on the FlexRay segment where the frame is located: static or dynamic. If the frame’s Identifier (slot) is less than or equal to the cluster’s Number Of Static Slots.

To decrease a frame’s sending frequency and share the same slot for different frames depending on the cycle counter. this is the standard CAN identifier with a size of 11 bits. this is the Slot ID in which the frame is sent. When the XNET Frame CAN:Extended Identifier? property is set to true. The slot ID determines whether a FlexRay frame is sent in a static or dynamic segment. otherwise. When the XNET Frame CAN:Extended Identifier? property is set to false. However. this is the Arbitration ID.Chapter 5 NI-XNET API for C Identifier Data Type u32 Direction Read/Write Required? Default Yes N/A Property Class XNET Frame Property ID nxPropFrm_ID Description Determines the frame identifier. which results in allowed range of 0–2047. If the slot ID is less than or equal to the XNET Cluster FlexRay:Number of Static Slots property. CAN For CAN frames. which results in allowed range of 0–536870911. this is the extended CAN identifier with a size of 29 bits. You also can send a FlexRay frame in multiple slots per cycle. the frame is sent in the communication cycle static segment. You can define subsequent slot IDs for the frame in the XNET Frame FlexRay:In Cycle Repetitions:Identifiers property. the CAN standard disallows identifiers in which the first 7 bits are all recessive. © National Instruments Corporation 5-185 NI-XNET Hardware and Software Manual . Use this concept to increase a frame’s sending frequency. so the working range of identifiers is 0–2031. FlexRay For FlexRay frames. refer to the XNET Frame FlexRay:Base Cycle and XNET Frame FlexRay:Cycle Repetition properties. it is sent in the dynamic segment. The valid value range for a FlexRay Slot ID is 1–2047.

you can do one of the following: • • Use a database file (or alias) to create the session. The file formats require a valid value in the text for this property. this is reported as an error in the XNET Cluster Configuration Status property. Set a value in LabVIEW using the property node. To ensure that the property contains a valid value. so you must set a valid value prior to creating a session.com . For more information about using database files and in-memory databases. This property is required. and you create an XNET session that uses this frame. NI-XNET Hardware and Software Manual 5-186 ni. refer to Databases. If the property does not contain a valid value. The property does not contain a default in this case. the session returns an error.Chapter 5 NI-XNET API for C If the frame identifier is not in the allowed range. This is needed when you create your own in-memory database (:memory:) rather than use a file.

Mux:Is Data Multiplexed? Data Type Boolean Direction Read Only Required? Default No False Property Class XNET Frame Property ID nxPropFrm_MuxIsMuxed Description Frame is data multiplexed. Use the XNET Frame Mux:Is Data Multiplexed? property to determine whether the frame contains a multiplexer signal.Chapter 5 NI-XNET API for C Mux:Data Multiplexer Signal Data Type nxDatabaseRef_t Direction Read Only Required? N/A Default N/A Property Class XNET Frame Property ID nxPropFrm_MuxDataMuxSigRef Description Data multiplexer signal in the frame. © National Instruments Corporation 5-187 NI-XNET Hardware and Software Manual . the property returns 0. This property returns a refnum to the data multiplexer signal. If the data multiplexer is not defined in the frame. Frames containing a multiplexer contain subframes that allow using bits of the frame payload for different information (signals) depending on the multiplexer value. A frame can contain only one data multiplexer signal. This property returns true if the frame contains a multiplexer signal. You can create a data multiplexer signal by creating a signal and then setting the XNET Signal Mux:Data Multiplexer? property to true.

You can create static signals by specifying the frame as the parent object. this property returns the same array as the XNET Frame Signals property. as opposed to dynamic signals. If the frame is not multiplexed. Static signals are contained in every frame transmitted. NI-XNET Hardware and Software Manual 5-188 ni. A subframe defines a group of signals transmitted using the same multiplexer value.Chapter 5 NI-XNET API for C Mux:Static Signals Data Type Direction Required? N/A Default N/A nxDatabaseRef_t * Read Only Property Class XNET Frame Property ID nxPropFrm_MuxStaticSigRefs Description Static signals in the frame.com . You can create dynamic signals by specifying a subframe as the parent. which are transmitted depending on the multiplexer value. Returns an array of refnums to signals in the frame that do not depend on the multiplexer value. Mux:Subframes Data Type nxDatabaseRef_t * Direction Read Only Required? N/A Default N/A Property Class XNET Frame Property ID nxPropFrm_MuxSubframeRefs Description Returns an array of references to subframes in the frame. Only one subframe at a time is transmitted in the frame. A subframe is defined by creating a subframe object as a child of a frame.

The short name must begin with a letter (uppercase or lowercase) or underscore. You can write this property to change the frame’s short name. The short name is limited to 128 characters. and underscore (_). dot (. It is for display purposes. Space ( ). and other special characters are not supported within the name. Valid characters for the short name are lowercase letters.Chapter 5 NI-XNET API for C Name (Short) Data Type char * Direction Read/Write Required? Default Yes Defined in Create Object Property Class XNET Frame Property ID nxPropFrm_Name Description String identifying a frame object. numbers.). uppercase letters. © National Instruments Corporation 5-189 NI-XNET Hardware and Software Manual . and not a number. This short name does not include qualifiers to ensure that it is unique. such as the database and cluster name. A frame name must be unique for all frames in a cluster.

To ensure that the property contains a valid value. For FlexRay. so you must set a valid value prior to creating a session. this is 0–8. and the payload of all static slots must be the same. If the property does not contain a valid value. The file formats require a valid value in the text for this property. and you create an XNET session that uses this frame.com . all frames use an even payload (16-bit words). so its value can be odd. this property specifies the number of payload bytes used within the frame. As encoded on the FlexRay bus. it is valid for this property to be 15. which specifies that the last 3 bytes are unused. Nevertheless. if a FlexRay cluster uses static slots of 18 bytes. refer to Databases. NI-XNET Hardware and Software Manual 5-190 ni. the session returns an error. For more information about using database files and in-memory databases. this is 0–254. For example. This property is required. The property does not contain a default in this case. This is needed when you create your own in-memory database (:memory:) rather than use a file. For CAN. Set a value in LabVIEW using the property node.Chapter 5 NI-XNET API for C Payload Length Data Type u32 Direction Read/Write Required? Default Yes N/A Property Class XNET Frame Property ID nxPropFrm_PayloadLen Description Number of bytes of data in the payload. you can do one of the following: • • Use a database file (or alias) to create the session.

including static and dynamic signals and the multiplexer signal. You can add signals to a frame using nxdbCreateObject and remove them using nxdbDeleteObject. © National Instruments Corporation 5-191 NI-XNET Hardware and Software Manual .Chapter 5 NI-XNET API for C Signals Data Type nxDatabaseRef_t * Direction Read Only Required? N/A Default N/A Property Class XNET Frame Property ID nxPropFrm_SigRefs Description Refnums to all signals in the frame. This property is read only. This property returns an array with references to all signals in the frame.

Chapter 5 NI-XNET API for C XNET Interface Properties This section includes the XNET Interface properties. To prevent reflections. NI-XNET Hardware and Software Manual 5-192 ni. This enumeration determines whether the XNET board can add termination to the bus. termination can be present as external resistance or resistance the XNET board applies internally.Termination Capability Data Type u32 Direction Read Only Required? Default No N/A Property Class XNET Interface Property ID nxPropIntf_CANTermCap Description Returns an enumeration indicating whether the XNET interface can terminate the CAN bus. To select the CAN transceiver termination.com . Enumeration No Yes Value 0 1 Remarks Signal reflections on the CAN bus can cause communication failure. CAN. refer to XNET Session Interface:CAN:Termination.

and Single Wire (SW).Chapter 5 NI-XNET API for C CAN. © National Instruments Corporation 5-193 NI-XNET Hardware and Software Manual . Enumeration High-Speed (HS) Low-Speed (LS) XS (HS or LS or SW) Value 0 1 2 Remarks The XS value in the enumeration indicates the board has the physical transceivers for High-Speed (HS).Transceiver Capability Data Type u32 Direction Read Only Required? Default No N/A Property Class XNET Interface Property ID nxPropIntf_CANTcvrCap Description Returns an enumeration indicating the CAN bus physical transceiver support. Low-Speed (LS). This value is switchable through the XNET Session Interface:CAN:Transceiver Type property.

com . this property returns the XNET device handle. Name Data Type cstr Direction Read Only Required? Default No N/A Property Class XNET Interface Property ID nxPropIntf_Name Description Returns the string name assigned to the XNET interface handle.Chapter 5 NI-XNET API for C Device Data Type u32 Direction Read Only Required? Default No N/A Property Class XNET Interface Property ID nxPropIntf_DevRef Description From the XNET Interface handle. Remarks This string is used for identification in MAX. This property determines the physical XNET device through the XNET Device Serial Number property for a given XNET Interface handle. Remarks The XNET device handle returned is the physical XNET board that contains the XNET interface. NI-XNET Hardware and Software Manual 5-194 ni.

plus its protocol name. This number. Remarks The XNET driver assigns each port connector in the system a unique number XNET driver. For example: XNET Interface String Name Number CAN1 FlexRay3 1 3 © National Instruments Corporation 5-195 NI-XNET Hardware and Software Manual .Chapter 5 NI-XNET API for C Number Data Type u32 Direction Read Only Required? Default No N/A Property Class XNET Interface Property ID nxPropIntf_Num Description Returns unique number associated with the XNET interface. is the interface name string.

Chapter 5 NI-XNET API for C Port Number Data Type u32 Direction Read Only Required? Default No N/A Property Class XNET Interface Property ID nxPropIntf_PortNum Description Returns the physical port number printed near the connector on the XNET device. along with the XNET Device Serial Number property. Note It is easier to find the physical location of an XNET interface with nxBlink. NI-XNET Hardware and Software Manual 5-196 ni. Remarks The port numbers on an XNET board are physically identified with numbering. to associate an XNET interface with a physical (XNET board and port) combination.com . Use this property.

Chapter 5 NI-XNET API for C Protocol Data Type u32 Direction Read Only Required? Default No N/A Property Class XNET Interface Property ID nxPropIntf_Protocol Description Returns the protocol supported by the interface as an enumeration. Enumeration CAN FlexRay Value 0 1 Remarks The protocol enumeration will match the protocol portion of the XNET interface name string: XNET Interface String Name Protocol CAN1 FlexRay3 0 1 © National Instruments Corporation 5-197 NI-XNET Hardware and Software Manual .

start always is performed within the first call to the appropriate nxRead function (if not already started using nxStart). If you need to call the appropriate nxWrite function multiple times prior to starting the session.Chapter 5 NI-XNET API for C XNET Session Properties This section includes the XNET Session properties. and if the interface is not already started. or if you are starting multiple sessions simultaneously. Auto Start? Data Type Boolean Direction Read/Write Required? Default No True Property Class XNET Session Property ID nxPropSession_AutoStart Description Automatically starts the output session on the first call to the appropriate nxWrite function. as long as the first call to the appropriate nxWrite function contains valid data. For input sessions. NI-XNET Hardware and Software Manual 5-198 ni.com . After calling the appropriate nxWrite function as desired. you can leave this property at its default value of true. This starts the session itself. it starts the interface also. it is equivalent to nxStart with scope set to Normal. you can call nxStart to start the session(s). This is done because there is no known use case for reading a stopped input session. When automatic start is performed. you can set this property to false. For output sessions.

Chapter 5 NI-XNET API for C ClusterName Data Type cstr Direction Read Only Required? Default N/A N/A Property Class XNET Session Property ID nxPropSession_ClusterName Description This property returns the cluster (network) used with nxCreateSession. © National Instruments Corporation 5-199 NI-XNET Hardware and Software Manual . DatabaseName Data Type cstr Direction Read Only Required? Default N/A N/A Property Class XNET Session Property ID nxPropSession_DatabaseName Description This property returns the database used with nxCreateSession.

B. The actual hardware interpretation of this value is one more than the programmed value. Interface:Baud Rate Data Type u32 Direction Read/Write Required? Yes (If Not in Database) Default 0 (If Not in Database) Property Class XNET Session Property ID nxPropSession_IntfBaudRate Description Note You can modify this property only when the interface is stopped. If more than one session exists for the interface. The baud rate format in advanced mode is 0x8ABCDDDD. 500000). The Interface:Baud Rate property sets the CAN or FlexRay interface baud rate. The default value for this interface property is the same as the cluster’s baud rate in the database. NI-XNET Hardware and Software Manual 5-200 ni. – – Valid programmed values are 0–3. where A. CAN When the upper bit (0x80000000) is clear. C. the remaining bits provide fields for more advanced CAN communication baud rate programming. Your application can set this interface baud rate to override the value in the database. changing an interface property affects all the sessions. this is a numeric baud rate (for example. or when no database is used. and DDDD are defined as follows: • A is the (Re-)Synchronization Jump Width (SJW).Chapter 5 NI-XNET API for C Interface Properties Properties in the Interface category apply to the interface and not the session. When the upper bit is set.com .

This is the combination of the Prop_Seg and Phase_Seg1 time from ISO 11898–1.1. due to the + 1) B = TSEG2 = 0x1 (0x02 in hardware. – – – Valid programmed values are 0–7. 12. and D values: • • • • A = SJW = 0x0 (0x01 in hardware. The actual hardware interpretation of this value is one more than the programmed value. – – – • DDDD is the bit time quantum.1 Bit Encoding/Decoding. – – An advanced baud rate example is 0x8014007D. which is the time segment after the sample point. The actual hardware interpretation of this value is one more than the programmed value.Chapter 5 NI-XNET API for C • B is the Time Segment 2 (TSEG2). Valid programmed values are 0–0xFA00. the total time for a bit in this example is 8 * 125 ns = 1000 ns = 1 µs. due to the + 1) D = tq = 0x7D (125 ns in hardware) Each time quanta is 125 ns.1 Bit Encoding/Decoding. This is used to program the baud rate prescaler.4. B. • C is the Time Segment 1 (TSEG1). This is the time quantum from ISO 11898–1. This example breaks down into the following A. So. 12. the nominal time segments length is Sync_Seg(Fixed at 1) + (Prop_Seg + Phase_Seg1)(B) + Phase_Seg2(C) = 1 + 2 + 5 = 8. From IS0 11898–1. 12. 12.4.4.4. C. A 1 µs bit time is equivalent to a 1 MHz baud rate. This is the Phase_Seg2 time from ISO 11898–1.1 Bit Encoding/Decoding. Valid programmed values are 1–0xF (1–15 decimal).2 Programming of Bit Time. in increments of 0x7D (125 decimal) ns. due to the + 1) C = TSEG 1 = 0x4 (0x05 in hardware. © National Instruments Corporation 5-201 NI-XNET Hardware and Software Manual . which is the time segment before the sample point.

which can be useful for debugging scenarios when you do not want to interfere with a communicating network cluster.com . the interface can neither transmit CAN frames nor acknowledge a received CAN frame. the interface can transmit CAN frames and acknowledge received CAN frames. Properties in the Interface category apply to the interface and not the session. The Listen Only? property configures whether the CAN interface transmits any information to the CAN bus.Chapter 5 NI-XNET API for C CAN Interface Properties This category includes CAN-specific interface properties. When this property is true. NI-XNET Hardware and Software Manual 5-202 ni. Interface:CAN:Listen Only? Data Type Boolean Direction Read/Write Required? Default No False Property Class XNET Session Property ID nxPropSession_IntfCANLstnOnly Description Note You can modify this property only when the interface is stopped. changing an interface property affects all the sessions. The true value enables passive monitoring of network traffic. When this property is false. If more than one session exists for the interface.

The Single Shot Transmit? property configures whether the CAN interface retries failed transmissions. If a CAN frame is not transmitted successfully. © National Instruments Corporation 5-203 NI-XNET Hardware and Software Manual .11 Automatic Retransmission). failed transmissions do not retry. no further transmissions are attempted. When this property is false. the interface attempts to retransmit the frame as soon as the bus is idle again.Chapter 5 NI-XNET API for C Interface:CAN:Single Shot Transmit? Data Type Boolean Direction Read/Write Required? Default No False Property Class XNET Session Property ID nxPropSession_IntfCANSingShot Description Note You can modify this property only when the interface is stopped. failed transmissions retry as specified by the CAN protocol (ISO 11898-1. If a CAN frame is not transmitted successfully. 6. When this property is true. This retransmit process continues until the frame is successfully transmitted.

However. if the existing network has an overall network termination of 125 Ω or less.com . NI-XNET Hardware and Software Manual 5-204 ni.11 kΩ option. you should select the default 1. However. The enumeration is generic and supports two values: Off and On. Low-Speed/Fault-Tolerant CAN Every node on a Low-Speed CAN network requires termination for each CAN data line (CAN_H and CAN_L). NI-XNET allows you to configure termination within the node to simplify testing. High-Speed CAN High-Speed CAN networks are typically terminated on the bus itself instead of within a node. Value Off On Meaning Disabled Enabled Description Termination is disabled. In general. as described below. If your bus already has the correct amount of termination. Otherwise. and the Off and On values have different meanings. Refer to Termination for more information about low-speed termination. different CAN hardware has different termination requirements. leave this property in the default state of Off.99 kΩ option. set this property to On. turn on termination to enable the 4. However. if you require termination. This configuration allows the Low-Speed/Fault-Tolerant CAN port to provide fault detection and recovery.Chapter 5 NI-XNET API for C Interface:CAN:Termination Data Type u32 Direction Read/Write Required? Default No Off (0) Property Class XNET Session Property ID nxPropSession_IntfCANTerm Description The Termination property configures the onboard termination of the NI-XNET interface CAN connector (port). Termination (120 Ω) is enabled.

© National Instruments Corporation 5-205 NI-XNET Hardware and Software Manual .Chapter 5 NI-XNET API for C Value Off On Meaning 1. Termination is set to 4. and no additional configuration is supported. Single-Wire CAN The ISO standard requires Single-Wire transceivers to have a 9.11 kΩ 4.11 kΩ.99 kΩ Description Termination is set to 1.09 kΩ resistor.99 kΩ.

as well as configuring other special modes. If the transceiver is in the Sleep mode. this performs a local wakeup of the transceiver and CAN controller chip. Sleep This state sets the transceiver and CAN controller chip to Sleep (or stand