Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Implementing a serial decoder with the DigitalWaveformGraph

Hello,

 

I would like to display and decode serial data with one of the Measurement Studio plotting/graphing tools. I use the WaveformGraph regularly, but the DigitalWaveformGraph seems more suited to this task. I already have a serial stream that contains patterned data. I already have code to decode this stream into something meaningful that I can display in a tabular format. My customer would like to see this data displayed in a way similar to the serial decoders available on some oscilloscopes.

 

The attached picture, and I know it's not great, shows what I am talking about. The customer would like to see a snippet of the original digital waveform, and the decoded values underneath it. For a given waveform, they want to see things like the "sync" field, address value, data values, and CRC and acknowledgement values. Also, unlike the picture, the data I have is purely digital and already synchronized to a clock.

 

I see from the examples how to create custom labels in digital waveforms. I cannot figure out how or if it's even possible to group samples serially into arbitrary width fields (i.e., an N-bit sync field, followed by an M-bit address, followed by 8-bit data bytes, etc.). Has anyone done this or does anyone have any ideas?

 

Thank you very much.

0 Kudos
Message 1 of 5
(4,973 Views)

dpstark,

 

Is this one of the examples you mentioned?

 

http://www.ni.com/example/10154/en/ 

 

 

https://www.linkedin.com/in/trentweaver
0 Kudos
Message 2 of 5
(4,897 Views)

Yes, exactly. That allows me to create the custom labels I need, which I am currently able to do. However, it does not allow me to group multiple samples into one labeled group. For example, consider SPI where you might want to group 8 serial bits and display that as one value with a label showing the value transmitted for those 8 bits. So far, I have not found a way to do this with the graphing or plotting tools available through Measurement Studio.

0 Kudos
Message 3 of 5
(4,860 Views)

While scatter graphs have an annotation feature, I haven't been able to find them for digital waveform graphs - I will be sure to post back if I learn anything new though.

Michael Keane
National Instruments
0 Kudos
Message 4 of 5
(4,820 Views)

I haven't come across annotations for the digital graphs, but that won't really help anyway. What I need is a way to group, for example, 8 1-bit samples into an 8-bit word. Annotations could create labels, but I'd still get transitions for each bit. I would prefer that the collapsed view show the 8-bit words and the expanded view show that plus the actual bit transitions. I'm looking for something like the SPI example in this link but of course the data in this case is implicitly clocked so I don't need to show a clock as well.

 

I managed to hack up the example as shown here:

 

serial2.png

 

I don't like this because I had to create and interpret several "states" in each sample and fix those samples at the same value to create labeled field in the collapsed waveform. It's ugly and it has the "+" to expand it. I can cancel if the user clicks the plus, but the plus is still there. There is also no way to color in the transitions to match the background of each state.

 

Hopefully that makes sense and someone has a solution.

0 Kudos
Message 5 of 5
(4,813 Views)