LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to change order of signals in digital waveform graph

Solved!
Go to solution

Hello,

 

I would like to ask you, if it possible to change order of signals in Digital Waveform Graph, like in default settings is order (sequence) for me is first signal mso/d0, then mso/d1 etc and last is mso/d9, like in attached photo. Is it possible to change the signals order in graph for display only, that first signal will be displayed mso/d9, then mso/d8..etc and the last will be mso/d0. I do not want to invert the signals, because for me is important the order and the description of signals. Thank you very much. Or if you have any suitable solution?

 

Thank you very much

 

 

0 Kudos
Message 1 of 7
(233 Views)
Solution
Accepted by topic author umu

I think plot order is done by array order of the input, so you'll have to invert the array.

No reason why you can't also invert the labels though, so they're still correct.

 

Here's an example doing what I think you want.

The label adjustment is automatic here, but it reads based on the previous run's plot labels. You might prefer to generate the names programatically (using, for example, Format into String).

Example_VI.png

 

As an explanation, I convert the Digital Waveform into a 2D boolean array, then transpose so that the rows are the lines.

Then I iterate over the lines, storing their future order (N-i) in the first element of a cluster, allowing me to use Sort 1D Array to reorder them.

Then I go back through another For loop in order to recreate the 2D Boolean Array, and use Boolean Array to Digital (Waveform) to get a new Wfm.


GCentral
0 Kudos
Message 2 of 7
(179 Views)

In response to a private message:

 

The "LSB First" constant is a block diagram constant.

The easiest way to create these types of values (which are often peculiar numeric values, or sometimes enums but where mapping value to meaning can be confusing otherwise) is to right click on the input you'd connect it to (here, on the left side of "Boolean Array to Digital.vi") and choose Create > Constant (or Create Constant in newer LabVIEW versions).


GCentral
0 Kudos
Message 3 of 7
(138 Views)

Right click on your mixed signal graph. Select advanced --> customised (a pop up window should come up with the graph) Click on the wrench icon in the pop up window. Drag the subplot to change its position into the order desired.

www.nomnomnow.one

0 Kudos
Message 4 of 7
(132 Views)

Hello,

 

I tried what you mean but it does not work in digital waveform graph. But the solution @works well.

 

Thanks

0 Kudos
Message 5 of 7
(114 Views)

In response to a private message re I think the labels repeatedly switching?

 

The code I posted will switch the label ordering to invert from the previous ordering using the Property Nodes.

You probably only want to do this once, and there's not even any need to do it programatically if you know in advance your signal names.

 

A modified example that might be clearer what I mean (still using a programmatic setup, but now separate from the reordering of signals):

Example_VI_BD.png

And with the other example of the DDS visible:

cbutcher_3-1617830093895.png

Here, I use Reverse 1D Array, but since the array is static I could easily have just written it in the opposite order.

 

 

 


GCentral
0 Kudos
Message 6 of 7
(96 Views)

It occurs to me in hindsight that you could simplify the reordering using the Array Size (or Matrix Size, convenient for 2D arrays) to the outside of N, then disabling autoindexed input and using Index Array with N-i-1 as the index.

 

Then you don't need the cluster or the sort, and only 1 For loop.


GCentral
0 Kudos
Message 7 of 7
(93 Views)