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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I graph multiple bit values on one time axis?

I want to graph multiple bit values, all of which will change back and forth from 0 to 1, on the same time axis, but I don't want any visual overlap between the different bit value traces.  Now I could do this by graphing bit one as either 0 or 1, bit 2 as 2 or 3, bit 3 as 4 or 5, etc., but I would really rather have multiple Y axes showing 0 to 1, stacked vertically on the same time (X) axis.

 

You could visualize this as multiple pens on a strip chart continuously recording different values.  Each pen has its own vertical area in which it writes, but all pens could be writing data from the same numerical range.

 

Hmmm...  I think my description might be roughly as clear as mud, but if anyone out there can figure out what I am asking and has potential solutions, please let me know.


Thanks!

Forbes Black
Lapsed CLAD, LV 5 - LV 2022 (Yeah, I'm that old...)
0 Kudos
Message 1 of 6
(2,562 Views)

My first inclination is to see if the Digital Waveform Graph will do the job for you.

0 Kudos
Message 2 of 6
(2,551 Views)

Thanks!  That is helpful.  But is there a way to plot the digital data against another array of time values, rather than assuming a standard delta T?  I have timestamps associated with each recording of the bit values, and I would like to use those timestamps as the X axis of my graph.

Forbes Black
Lapsed CLAD, LV 5 - LV 2022 (Yeah, I'm that old...)
0 Kudos
Message 3 of 6
(2,528 Views)

Take a look at the Build Waveform VI in Programming > Waveform > Digital Waveform. You can easily set a t0 and dt. to match your data.

Verne D. // Software R&D // National Instruments
0 Kudos
Message 4 of 6
(2,509 Views)

Thanks.  I will look at that VI, but I think I have already seen it.  My problem is that I have CAN data coming in for an hour or so, but the time interval between receiving specific CAN arbitration IDs varies, so I want to plot the X axis against specific, varying time values, not a standard dT.  I'm not sure I can do this on a digital graph, but I haven't given up hope yet.

 

BTW, I am receiving 8-byte CAN packages.  Some of the bytes represent actual values, but I need to break others up into individual bit values to see error and status flag settings.  Once I break the bytes into bits, I convert from analog values to digital values.

Forbes Black
Lapsed CLAD, LV 5 - LV 2022 (Yeah, I'm that old...)
0 Kudos
Message 5 of 6
(2,505 Views)

If you're using analog data, you can look at an XY graph. It's not as clean as the digital plot, but using nonstandard time arrays for the X-axis is pretty straightforward. Think scatter/line plot.

Verne D. // Software R&D // National Instruments
0 Kudos
Message 6 of 6
(2,482 Views)