Writing Hexadecimal Data to Digital I/O Cards in LabVIEW

Updated May 3, 2018

Reported In

Hardware

  • PXIe-6547

Software

  • LabVIEW

Driver

  • NI-DAQmx
  • NI-HSDIO

Issue Details

I am trying to write hexadecimal digital data or serial data to my digital I/O card in LabVIEW.

Solution

You can accomplish this by converting hexadecimal numeric constants into a 2D array of U8 ones and zeros, then building a Digital Waveform out of the U8 array. 

A screenshot showing an example of how this can be done in LabVIEW is included below:

The digital waveform generated by the code above can then be written out to hardware using a DAQmx Digital Output task or an NI-HSDIO Write Named Waveform VI.

Additional Information

With the data transposed and rotated as above, each row of the 2D U8 array corresponds to a single waveform, which can then be mapped to a digital line on the hardware, while each column represents a single data bit of that waveform.

Other waveform properties, such as the start time (t0) and the interval (dt) can be set in the Build Waveform VI.

WAS THIS ARTICLE HELPFUL?

Not Helpful