Example Code

HDLC Implementation in LabVIEW FPGA

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 FPGA Module

Code and Documents

Attachment

Description

Overview


HDLC (High-Level Data Link Control) is a serial digital protocol that can be used to communicate between different nodes on a network. Many of today's commonly-used communication standards are built on the HDLC specification, which describes how to serially transmit frames of data with control registers and error checking.

This is an example of how to implement an HDLC interface with the LabVIEW FPGA Module and R Series Intelligent DAQ hardware.

HDLC Implementation Example for LabVIEW FPGA

HDLC_Host.vi is designed as a driver VI that can be called from a test console or other test executive application.  It uses a state machine architecture to initialize the FPGA hardware, send commands, receive data and then close the connection.

HDLC_FPGA.vi can operate in on-demand or continuously transmit mode.  Each bit being transmitted can be synchronized to an internal or external clock.  Responses are received continuously and can be dumped to the Host via DMA transfer or analyzed on the FPGA.

There are three main loops in the FPGA application.

  • HDLC transmission loop
  • Data receive loop
  • Clock generation loop

This LabVIEW FPGA example code was developed by PLF Consulting.

Related Links

National Instruments LabVIEW FPGA Module

Developing Digital Communication Interfaces with LabVIEW FPGA 

Implementing a Custom Serial Protocol with Intelligent DAQ

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