LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How build waveform to emulate digital simulator output

Highlighted

Hey folks - I'm trying to create a waveform that emulates the output of a logic analyzer, but using synthetic data that I create inside of a VI.  

 

I have posted a screengrab of my most recent attempt.  My goal is this:

 

1)  An excel file that I create contains two columns, each with 10 rows.  Each column represents an array of data which will become the test vector for the two inputs of my function.  The first column is a list of numbers which will eventually become 18-bit fixed point inside the function, but for the purposes of display on the waveform, they may remain any datatype with >18 bits precision (ie. u32).

2)  This excel file is read in, and parsed to create  two arrays.  

3)  These two arrays are fed into a for-loop (without wiring the number of iterations).  This loop will execute 10 times (my arrays contain 10 values when parsed), and produce an output array of ten u8's.  This whole part works so far.  All the conversion, the functionality and the arrays.  I can view this on my front panel if I create indicators from my loop inputs and outputs.  

4)  I want to be able to display the inputs and outputs in a manner similar to waveform you might see in a digital logic simulator.  IE:  single set of axes, booleans shown as a digital signal (as opposed to a list of numbers), and buses shown as hex values (rather than a large collection of digital signals).

 

I have attached a screenshot of my first attempt at creating the waveform diagram that only displays the inputs from the excel sheet, without yet adding in the complexity of the rest of my actual function that I am testing (and its output).  I read from the measurement file, index into the resulting 2-D array to get my pair of 1-D arrays.  I convert the first to U32 array, and I convert the 2nd to a boolean array.    I use the 'binary to digital waveform' and 'a boolean-array to digital waveform' block to create the two 'digital data' types.  Once I have the two digital waveforms, and a 'group digital signals' block so that I can display a bus as a changing hex value rather than as a large group of single-bit signals.  In the screenshot, I haven't plugged the 2nd waveform (the boolean one) into an 'append waveform' block yet, because I am still trying to figure out why I need a 2-d array of booleans (rather than a single array of a certain length equal to my other set of U32s going into the group digital signals block.  

 

Do any of you have any sugggestions on an easier way to do this (create a waveform viewer with vectors of inputs, intermediates and outputs)?  It seems like such a useful tool - and far superior for simulating SCTLs than using the built-in simulator, or even the bus-model used when doing simulation exports.   

 

Thanks!

0 Kudos
Message 1 of 6
(1,498 Views)
Highlighted

Hi JJ, 

 

I apologize, but I am not familiar with the digital logic simulator output you want, and am still a bit unclear on how you want your data to be displayed. Could you post a picture or mock-up of what you want the graph to look like? Thanks!

 

~kgarrett

 

District Sales Engineer
0 Kudos
Message 2 of 6
(1,470 Views)
Highlighted

Here is an example graphic that I stole from the internetz.  Ignore the ADC line.  What the waveform shows is a number of 'samples' that transition over time.  In the graphic, you see a clock which shows the boundary of each 'clock cycle', or in my case, iteration of the for-loop.  so basically I would be creating a list of signal values (digital binary or digital bus) plotted next to each other to show transitions (it's a very efficient way to browse through large data sets) - and is the defacto standard in hardware design.

 

 

 

In addition, I feel this can be done in labview in an easier manner - please read the section of the Labview 2011 help titled "Digital waveform graphs", and this has two separate diagrams shown (but no links to the block diagrams that drive them) that show both single-bit transitions AND bus transitions.

0 Kudos
Message 3 of 6
(1,455 Views)
Highlighted

Hi JJ, 

 

From the image you posted, it seems like you could certainly do that using Waveform Graphs. You might also want to include Tab Controls for various states (High, Low, etc.). Without looking at the example you were citing, I am not sure what you mean by the Waveform Graph help in LabVIEW. If you will post the link to which you were referring, I would be happy to comment further. Thanks!

 

~kgarrett

 

District Sales Engineer
0 Kudos
Message 4 of 6
(1,443 Views)
Highlighted

The example to which I am referring is this:

 

Labview 2011 Help ->  Types of Graphs and Charts -> (click the link "Digital Waveform Graphs" in the 'In This Topic' box in the upper right of the window).  To save time, I have done two screen captures of the Labview Help window.

 

The first shows a digital bus (multiple single-bit digital lines being concatenated and displayed as a changing hexadecimal value).  What is the block diagram that corresponds to this?  

 

dig_wf_graph_1.JPG

 

 

0 Kudos
Message 5 of 6
(1,439 Views)
Highlighted

Hi JJ, 

 

To find related examples, click the Find Related Examples button: 

 

Find Related Examples.jpg

 


You can also go to C:\Program Files\National Instruments\LabVIEW 2011\examples\general\graphs, and select DWDT Graphs to see all the example files relevant to Digital Waveform Graphs. Hope this helps!

 

~kgarrett

 

 

 

 

 

 

 

 

 

District Sales Engineer
0 Kudos
Message 6 of 6
(1,427 Views)