From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

Open LDF Database File (.ldf)

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

    Driver

  • Other

Code and Documents

Attachment

Overview

This VI demonstrates how to open and output signal names of a LDF database file using using the LDF Starter Kit VIs.

 

Description

This example uses the LDF Starter Kit VIs to read content from a LDF database file. Read content can be determined by one of the following options:

Signals, Frames, Signal_encoding_types, Diagnostic_frames, Node_attributes, Schedule_tables, Sporadic_frames, Event_triggered_frames, Signal_representations, composite, Signal_groups.


Requirements

 Software

  • LabVIEW Base Development System 2012 (or compatible)
  • NI-CAN 2.7.4 (or compatible)
  • LDF Starter Kit for LIN 1.0.1
  • If running in a Real-Time context, you will need the LabVIEW Real-Time Module 2012 (or compatible)

 Hardware

  • No hardware is necessary to use this example VI

 

Steps to Implement or Execute Code

  1. Download LDF Starter Kit for LIN 1.0.1, extract ZIP file and copy content to: <LabVIEW folder>\user.lib\LDF
  2. Download and extract the attached file "Open_LDF_Database LV2012 NIVerified"
  3. Follow the instructions in Front Panel of "Open_LDF_Database LV2012 NIVerified.vi" and run the program

 

Additional Information or References

Open_LDF_Database LV2012 NIVerified.vi - Front Panel.png

 

Open_LDF_Database LV2012 NIVerified.vi - Block Diagram.png

 

**The code for this example has been edited to meet the new Community Example Style Guidelines. The edited copy is marked with the text ‘NIVerified’. Read here for more information about the new Example Guidelines and Community Platform.**

National Instruments
Applications Engineer

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
wilburwu
Member
Member
on

It does not work with v2.1 LDF files

tokohanz
Member
Member
on

Do we have any example for v2.1 ldf ??

wilburwu
Member
Member
on
rumble1701a
Member
Member
on

I am having the same issue. I have a USB-8476. The above link talks about using xnet, of which I do not have the card for that. Is there another example to use? When I load the .ldf file using the above test database, it crashes my program. Thanks.

wilburwu
Member
Member
on

I didn't have the XNET card either. However, you may install and use XNET without the XNET-LIN PCI/PXI.

So just try the XNET, the example above is just for LDF2.0- but not for LDF2.1+.

rumble1701a
Member
Member
on

Not sure about using XNET. I am still new at this stuff. I need to open an .ldf file and read the information. For instance, when I plug into a battery and I want to read its state of charge, I would load the .ldf into labview and read parameters like voltage or current or resistance (used for physical health of battery). However, when I open the .ldf, it still crashes the program. I did use the examples up above. I then look around for an XNET caller that will allow me to do the same thing but no such example exists, unless it is named something other than what I am looking for.

  Also, does XNET even support 8476?

Thanks for the help

yjallouli
Member
Member
on

Hello guys,

Using this method Is it possible to :

-Open an LDF file

-Send LIN Frames through Labview with USB-8476s using the LDF file

?

zoomer777
Member
Member
on

Yes you can use the 8476 interface and a LDF that is of a v2.1. Here is an example make sure you read the READ ME File.

https://decibel.ni.com/content/docs/DOC-49098