04-06-2021 02:11 PM
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
Solved! Go to Solution.
04-06-2021 08:08 PM - edited 04-06-2021 08:20 PM
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).
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.
04-07-2021 04:55 AM
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).
04-07-2021 07:03 AM
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.
04-07-2021 01:27 PM
Hello,
I tried what you mean but it does not work in digital waveform graph. But the solution @cbutcher works well.
Thanks
04-07-2021 04:15 PM
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):
And with the other example of the DDS visible:
Here, I use Reverse 1D Array, but since the array is static I could easily have just written it in the opposite order.
04-07-2021 04:45 PM