You are here

Waveform Chart

26 July, 2019 - 09:47
Available under Creative Commons-ShareAlike 4.0 International License. Download for free at http://cnx.org/contents/5b6e61df-b830-48cb-9764-94696cb47c80@1.3

Waveform Charts provide a historical graphical representation of numeric data.

The following example will build a simple G program that will allow you to chart a sine wave as it is being generated on a point-by-point basis using the equation:

yi = sin (0.2xi)                             (9.1)

Figure 7.1 Waveform Chart  

Start with a while loop and add into it a Multiply and Sine functions, a numeric constant with value 0.2 and a Boolean control to stop the loop when its value is True. Arrange the diagram to look as in the following Figure Figure 7.2.

Figure 7.2 While Loop For Waveform Chart  

To select a waveform chart, right click on the Front Panel window and select Waveform Chart from the Controls »Modern »Graph menu.

Figure 7.3 Selecting Waveform Chart  
Figure 7.4

This places the Waveform Chart in the Front Panel window.

Figure 7.5 Waveform Chart in Front Panel window  

In the Block Diagram window, make sure that the Waveform Chart terminal is inside the while loop. Wire the output of the Sine function to this terminal.

Notice that Waveform Chart terminal is that of a numeric output.

Figure 7.6 Waveform Chart Terminal  

Most modern computers will run this program too fast. Thus, before this program is executed, a delay of 125 milliseconds will be inserted in the while loop. This will allow users to see how the Waveform Chart operates as data samples are plotted in the chard.

From theFunctions »Programming »Timing selectWait Until Next ms Multiple. This will put the while loop to sleep for the indicated number of milliseconds.

Figure 7.7 Wait Until Next ms Multiple  

Drop the Wait Until Next ms Multiple function inside the loop and wire a constant to it with the value

125. This will delay the loop for 125 milliseconds. The final Waveform Chart program is shown in Figure Waveform Chart Program.

Figure 7.8 Waveform Chart Program 

The default graphing mode of the Waveform Chart is autoscaling. You will notice the auto-scaling property when the program frst begins to run and the y-axis, labeled Amplitude, updates automatically as new numerical values are aggregated and displayed on the chart.

Figure 7.9 Waveform Chart Autoscaling  

As the program continues to run, the graph continues to build as per the values associated with the x-axis, labeled Time, which correspond to the index value of the equations.

Figure 7.10 Accumulating Values for the Waveform Chart  

As the program continues to run, the autoscaling property also applies to the x-axis. Noticed the updated x-axis. For this example, the x-axis will continue updating so as long as the program is running. This gives the appearance of a scrolling strip chart.

Figure 7.11 Scrolling X-Axis  

Stopping and restarting the G program retains the numeric history and continues to aggregate the values for display.

Figure 7.12 Graph History Retained Between Runs  

The Waveform Chart options can be easily updated by right clicking on the Waveform Chart and selecting the appropriate option to update from the pop-up menu.

Selecting Properties from this pop-up menu brings up the Waveform Chart dialog window (Figure Figure 7.14).

Figure 7.13 Waveform Chart Pop-Up Menu  
Figure 7.14 Waveform Chart Options Dialog Box  
{"cc_re__cc_re__cc_by_sa_4_0": [">\r\n            \t  26 July, 2019 - 09:47    </footer>\r\n  \r\n  <div class=\"content clearfix\">\r\n    <div class=\"field field-name-field-content field-type-text-long field-label-hidden\"><div class=\"field-items\"><div class=\"field-item even\"><div class=\"dita-book-content    \"><div class=\"attribution\"><div class=\"cc-lic cc_l40 lic_by-sa\"><div class=\"ccl_icon\"><img src=\"https://www.opentextbooks.org.hk/sites/opentextbooks/files/book_profile/cc_icon/by-sa.png\" /></div><div class=\"ccl_desc\">Available under <a href=\"http://creativecommons.org/licenses/by-sa/4.0/\" target=\"_blank\" >Creative Commons-ShareAlike 4.0 International License</a>. Download for free at http://cnx.org/contents/5b6e61df-b830-48cb-9764-94696cb47c80@1.3 </div></div></div>\n    <p class=\"p\">\n      Waveform Charts provide a historical graphical representation of numeric data.\n    </p>\n    <p class=\"p\">\n      The following example will build a simple G program that will allow you to chart a sine wave as it is being generated on a point-by-point basis using the equation:\n    </p>\n    <p class=\"p\">\n      <em", "tbooks.org.hk/sites/opentextbooks/themes/otb/images/acknowledgement/logo-ouhk.jpg\" alt=\"OUHK\" width=\"174\" height=\"55\" style=\"width:auto; max-width:100%;\" /></a>\n</div>\n<div style=\"width:30%; padding:0 5%; float: left;\">\nProject supported by <br /><img src=\"https://www.opentextbooks.org.hk/sites/opentextbooks/themes/otb/images/acknowledgement/logo-hkjcct.jpg\" alt=\"HKJCCT\" width=\"267\" height=\"50\" style=\"width:auto; max-width:100%;\" />\n</div>\n<div style=\"width:30%; float: left; text-align:right;\">\n<a href=\"http://creativecommons.org/licenses/by-sa/4.0/\" target=\"_blank\" style=\"display:block;\"><img src=\"https://www.opentextbooks.org.hk/sites/opentextbooks/themes/otb/images/acknowledgement/cc-logo-by-sa.png\" alt=\"Creative Commons\" width=\"88\" height=\"31\" style=\"width:auto; max-width:100%;\" /></a>\nContent on this site is licensed under a \nCreative Commons Attribution-ShareAlike 4.0 License \nexcept where otherwise noted.\n</div>\n</div>  </div>\n</div>\n  </div>\n                      </div> <!-- /#footer-columns -->\r\n    \r\n  </div></div> <!-- /.section, /#footer-wrapper -->\r\n\r\n</div></div> <!"]}