LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Graph

Solved!
Go to solution

Hello everyone, I have a little problem to make a graph. I am a beginner and would like to just draw a graph representing a bit of a word evolution scenario over time.

Let me explain, I have 2 tables:

        - 1 Table containing the states of each bit

        - 1 Table containing the duration for each bit.

 

Let us assume a word made up of the following way:

        0000 0000 0110 1010

      My bit array: [0; 0; 0; 0; 0; 0; 0; 0; 0; 1; 1; 0; 1; 0; 1; 0]

      My time table: [2; 10; 1; 5; 6; 1; 1; 1; 3; 8; 8; 7; 20; 1; 10; 2]

 

y(state of bit)

   |

1 |     |--------------------------|    |

   |     |                               |    |

   |     |                               |    |

   |     |                               |    |

   |     |                               |    |

   |     |                               |    |

   |----|                               |--- |

-------------------------------------------------------------------------------------------- x(time)

  0     2    4    6    8    10    12    14    16    18   20   22   24   26   28

 

 

Here is the beginning of what I would like to have in graph by programming.

If you have a solution for me.

 

Thank by advance.

 

David 

0 Kudos
Message 1 of 8
(2,065 Views)

I suspect you can do this with either an XY Graph or a Digital Waveform graph, but I'm not exactly clear about what you want to happen with your tables.

 

I guess you want 16 lines on your graph?

But I can't work out what the time table indicates from your drawings. Does each value give the duration of the current state for each bit? How should you connect the tables?


GCentral
0 Kudos
Message 2 of 8
(2,051 Views)

Hello, thanks for answer, but i don't want 16 lines, but i actually need a chronograph, with the state for each bit during the time in table.

 

0 Kudos
Message 3 of 8
(2,042 Views)

Ok, so one line?

But you have a "state table" and a "duration table". I can see how you could go through the durations - e.g. with your example:

 My time table: [2; 10; 1; 5; 6; 1; 1; 1; 3; 8; 8; 7; 20; 1; 10; 2]

Start with some value for the first 2, then 10 later (at 12) go to the next sample, then 1 later (at 13) go to the next sample?

Is that the idea?

 

If so, then you want to have a shift register with the accumulated time, and then output an array of a cluster of two values, T (=sum of previous dt) and Value (index the state table).

You can put that into a graph.


GCentral
0 Kudos
Message 4 of 8
(2,037 Views)
Solution
Accepted by topic author DavidFrance44

Example_VI.png

 

Here's an example. Optionally use Reverse 1D Array to get the MSB/LSB switched.


GCentral
Message 5 of 8
(2,030 Views)
Solution
Accepted by topic author DavidFrance44

Hello Butcher,

 

Thank you for answer, that's good for me, but i don't have a good graph as yours.

 

DavidFrance44_0-1617175873226.png

 

This is my screen, and follow a part of my programm :

 

DavidFrance44_1-1617175981475.png

 

DavidFrance44_2-1617176071653.png

What is the good graph who must take to have a good chronograph as you ? 

 

i don't want to have any line on the graph but something as you, so only one line who show the evolution my word, bit to bit on the time.

 

What is the solution for this. 

Thanks by advance .

Have a good day.

 

0 Kudos
Message 6 of 8
(1,943 Views)
Solution
Accepted by topic author DavidFrance44

The style of the graph is set by the type, I used a Digital Waveform Graph (NXG Style), but you have I guess the Modern one.

To set the line to take all of the vertical space, right click on left axis (around Ligne 0, inside the graph (not the side bar)) and choose Autoscale Y.

To remove the sidebar/panel, right click on the graph and choose Visible Items > (uncheck) Plot Legend.

 

cbutcher_1-1617177093372.png

 

 


GCentral
0 Kudos
Message 7 of 8
(1,940 Views)

Thank you, and sorry for my english. 

0 Kudos
Message 8 of 8
(1,935 Views)