Oscilloscope Widget Help


Serial Oscilloscope Help

Oscilloscope Window

Help Index


Programming Help

Working with Serial Oscilloscope is easy! Please read the steps below for how to use the Serial Oscilloscope API.

How to create a Serial Oscilloscope Widget Window

Before creating a Serial Oscilloscope Widget Window you need to establish a serial communications connection to Omnia Creator first using the ILCore object. ILCore takes care of connecting to Omnia Creator using the fastest possible serial communications speed; that your microcontroller can run the Omnia Creator Interface Library code at so that you don’t have to worry about baud rates anymore.

With Omnia Creator, worrying about baud rates is a thing of the past!

Please note: you need to make sure that your serial port’s baud rate is set to Auto in Omnia Creator for the Omnia Creator Interface Library to work. You can also force your serial port’s baud rate to be another value in Omnia Creator for interfacing with devices that aren’t running the Omnia Creator Interface Library code.

To get started with Serial Oscilloscope, first include the Omnia Creator Interface Library in your code (line 1). Then declare the ILCore and ILOscilloscope objects (lines 3 and 4). In your main/setup function initialize communication with Omnia Creator using the core.init() function (line 8). core.init() takes care of setting up serial communications with Omnia Creator for you. Once you’ve initialized ILCore DO NOT USE YOUR NATIVE SERIAL FUNCTIONS ANYMORE! If you need to receive or send characters use ILCore to do it for you. ILCore wraps around your native serial port and supplies its own functions to access your native serial port like read, write, print, println, etc. However, if you still want to write/print to your native serial port, this is okay and will not cause any problems. Any text sent by your microcontroller will be printed to Omnia Creator’s standard serial terminal if you use your native serial write/print functions or ILCore’s write/print functions. But, you need to use the ILCore functions for receiving serial data. Calling your native serial read functions will cause the Omnia Creator Interface Library to lose synchronization with Omnia Creator.

Please note: you can use the ILCore object to open dialog boxes on the computer and get the results. You’re not going to really ever need to type into the serial terminal to command your microcontroller anymore!

Next, after initializing the core object you can clear all the previous Widget Windows from Omnia Creator’s memory by calling core.clearAll() (line 9). Any open Widget Windows should disappear after executing this line of code. If you don’t clear previous Widget Windows from memory you can still keep adding data to them from your microcontroller. However, you’ll need to clear a previous Widget Window from memory if you change the Widget Window’s type when you initialize it in your code. Omnia Creator’s Widget Menu also has a Remove Widget command and a Remove All Widgets command for this purpose. Omnia Creator will print out debug messages when there’s a problem that you need to address.

Finally, you can create the Serial Oscilloscope Widget Window by calling oscilloscope.init(&core, “Hello World”) (line 11). The first argument to oscilloscope.init() is a pointer to the core object. All you need to do is pass it &core always. Passing &core connects the child ILOscilloscope object to parent ILCore object. The second argument to oscilloscope.init() is a title string for the Widget Window. You can make this string whatever you want. But, please try to keep it short. If you’d like a docked Widget Window call the initDocked() function instead of the init() function. This will create the Serial Oscilloscope Widget Window as a docking window that can dock itself inside of the main Omnia Creator window. Otherwise the init() function will create the Serial Oscilloscope Widget as a top level window.

After executing this code a Serial Oscilloscope Widget Window should appear!

How to customize a Serial Oscilloscope Widget Window

Once you’ve created your Serial Oscilloscope Widget Window you can customize it:

You can also set the background color. There’re get functions for each one of the above properties too!


How to create a Line Graph in a Serial Oscilloscope Widget Window

To add a line graph (ILOscilloscopeGraph) to your Serial Oscilloscope Widget Window you need to declare an ILOscilloscopeGraph first. You should declare the line graph object next to your ILOscilloscope object as they both should be in the same scope.

Next, just initialize the line graph object like you would the Serial Oscilloscope object. The first argument to init() is it’s parent object which should be a pointer to your ILOscilloscope object which is  &oscilloscope. The second argument is the title string for the line graph. Giving your line graph a title string causes its name and symbol to show up in the plot legend. If you give the line graph an empty string for its title, its symbol and name won’t show up in the plot legend.

How to customize a Line Graph

Once you’ve created your line graph you can customize it. You can set the line color, set the line style, set the fill color, set the fill style, set the scatter shape, set the channel fill graph, and you can reset the name. There’re also get functions for each one of the above properties too!

By default line graphs plot data using the Cartesian Coordinate System. However, if you need to plot data from a Polar Coordinate System you can tell Omnia Creator through ILOscilloscopeGraph by setting the line graph’s coordinate system. You can specify whether to use degrees or radians while in the Polar Coordinate System too!

If you need to scale each value that you add to your line graph you can offload this work to Omnia Creator through ILOscilloscopeGraph by setting the line graph’s scaler. Omnia Creator will divide all values added to the line graph by whatever you set for the scale value. For example, this feature is useful for scaling the 0-1023 value from a 5V ADC down to the 0-5V range – you would set the scaler to (1023/5). Without the scaler your microcontroller would have to perform floating point operations which can be expensive on some microcontrollers.

As for spacing values added to your line graph out you can set the sample rate of your line graph. The sample rate controls how far apart values that are added to the line graph are spaced when you don’t specify an X coordinate. By default the sample rate is 1. Increasing the sample rate will set the spacing between each value you added to the line graph to (1/sampleRate).

Line graphs will display the last 256 values added to them by default. You can change the amount of stored values to any number between (1-65536) using the setSize() function. Please note: increasing the number of stored values increases the amount of work your processor has to do to draw the line graph. If you turn the line graph fill on, alpha bending on, and have a lot of zero crossings you will graphical experience performance degradation (zero crossing with any fill on cause the processor to have to do a lot of work calculating the fill area).

Finally, if you want your line graph to display itself like it was in an oscilloscope just turn delta mode on. Normally, once you’ve added more values to your line graph than it supports (which you can control using setSize()), the value with the lowest X coordinate is thrown away. Continually adding data to the line graph under this default behavior continually increments the maximum X coordinate. When delta mode is on the values in the line graph are shifted instead when the line graph size is exceeded (the lowest X coordinate is shifted out). This prevents the X coordinates from changing at all. Note: Delta mode sets the X coordinate for the first value added using addValue() to -(size/sampleRate).

How to add data to a Line Graph

You can add data to the line graph in two ways. The first by using addKeyValue() which specifies the new X and Y coordinates to add to the line graph. However, if you setup your line graph first by following the advice from the above section… or just don’t care what the default values are you can use the addValue() function which will add values using just the Y coordinate. The X coordinate for new values is equal to the old X coordinate plus one over the sample rate. addValue() is the default function you will likely use.

The above functions add integer values, if you need to add a floating point value add a capital F to the end of the function name for the floating point version – i.e addKeyValueF() and addValueF().

How to add lots of data to a Line Graph

Adding a single value to a line graph at a time is inefficient. A serial communications connection to Omnia Creator running at 115,200 BPS will never be more than about 25% efficient adding one value at a time – transferring only about 720 values per second. However, you can increase the efficiency up to about 97%, transferring about 2,790 values per second, by using the addKeyValues() and addValues() functions which can send up to 256 values in one function call.

How to remove data from a Line Graph

Removing data from your line graph is easy. You can removeDataBefore() a X coordinate, removeDataAfter() a X coordinate, removeDataBetween() two X coordinates, remove a particular X coordinate, or just remove everything.

How to turn Fast Fourier Transform (FFT) support on for a Line Graph

Displaying the FFT of your line graph is really, really, really easy. Just call setFFT() with the type of FFT you want for your line graph. You can display either the magnitude, the power, the magnitude in dB, the power in dB, the phase in radians, or the phase in degrees. You can control the window function used for the FFT by calling setFFTWF(). Omnia Creator supports a variety of popular window functions.

You need to set the sample rate and size of your line graph for the FFT output to make sense. The sample rate should be set to the source of your data’s sample rate. The size should be set to as large of a value you need for the FFT resolution. Try to avoid making really large FFTs if you can help it.

If you are displaying the FFT in dB make sure to set your FFT Y graph axis to log units using setFFTYAxisScaleType(). The default log base is base 10, but you can change that with setFFTYAxisScaleLogBase().

The X line graph axis of the is the time input. The Y line graph axis is the value input.

The X FFT graph axis of the is the frequency output in hz. The Y FFT graph axis is the FFT-Function(value) output.

How to turn Error Bar (EBAR) support on for a Line Graph

You can set the key error bar display state using setKeyErrors() and set the value error bar display state using setValueErrors().

You can get the key error bar display state using getKeyErrors() and get the value error bar display state using getValueErrors().

How to add Error Bar data to a Line Graph

Use addKeyValueWithSymmetricalErrors() to add a key and value like using addKeyValue() but with key and value error bars. You can specify the width of both the key and value error bars. Bulk transfer and floating point variations of this function also exist.

Use addValueWithSymmetricalErrors() to add a value like using addValue() but with key and value error bars. You can specify the width of both the key and value error bars. Bulk transfer and floating point variations of this function also exist.

Use addKeyValueWithErrors() to add a key and value like using addKeyValue() but with key and value error bars. You can specify negative and positive width of both the key and value error bars. Bulk transfer and floating point variations of this function also exist.

Use addValueWithErrors() to add a value like using addValue() but with key and value error bars. You can specify negative and positive width of both the key and value error bars. Bulk transfer and floating point variations of this function also exist.


How to create a XY Graph in a Serial Oscilloscope Widget Window

To add a xy graph (ILOscilloscopeCurve) to your Serial Oscilloscope Widget Window you need to declare an ILOscilloscopeCurve first. You should declare the xy graph object next to your ILOscilloscope object as they both should be in the same scope.

Next, just initialize the xy graph object like you would the Serial Oscilloscope object. The first argument to init() is it’s parent object which should be a pointer to your ILOscilloscope object which is  &oscilloscope. The second argument is the title string for the xy graph. Giving your xy graph a title string causes its name and symbol to show up in the plot legend. If you give the xy graph an empty string for its title, its symbol and name won’t show up in the plot legend.

How to customize a XY Graph

Once you’ve created your xy graph you can customize it. You can set the line color, set the line style, set the fill color, set the fill style, set the scatter shape, set the channel fill curve, and you can reset the name. There’re also get functions for each one of the above properties too!

By default xy graphs plot data using the Cartesian Coordinate System. However, if you need to plot data from a Polar Coordinate System you can tell Omnia Creator through ILOscilloscopeCurve by setting the xy graph’s coordinate system. You can specify whether to use degrees or radians while in the Polar Coordinate System too!

If you need to scale each value pair that you add to your xy graph you can offload this work to Omnia Creator through ILOscilloscopeCurve by setting the xy graph’s scaler. Omnia Creator will divide all value pairs added to the xy graph by whatever you set for the scale value. For example, this feature is useful for scaling the 0-1023 value from a 5V ADC down to the 0-5V range – you would set the scaler to (1023/5). Without the scaler your microcontroller would have to perform floating point operations which can be expensive on some microcontrollers.

As for spacing value pairs added to your xy graph out you can set the sample rate of your xy graph. The sample rate controls how far apart value pairs that are added to the xy graph are spaced when you don’t specify an Index coordinate. By default the sample rate is 1. Increasing the sample rate will set the spacing between each value pair you added to the xy graph to (1/sampleRate).

XY graphs will display the last 256 value pairs added to them by default. You can change the amount of stored value pairs to any number between (1-65536) using the setSize() function. Please note: increasing the number of stored value pairs increases the amount of work your processor has to do to draw the xy graph. If you turn the xy graph fill on, alpha bending on, and have a lot of zero crossings you will graphical experience performance degradation (zero crossing with any fill on cause the processor to have to do a lot of work calculating the fill area).

Finally, if you want your xy graph to display itself like it was in an oscilloscope just turn delta mode on. Normally, once you’ve added more value pairs to your xy graph than it supports (which you can control using setSize()), the value pair with the lowest Index coordinate is thrown away. Continually adding data to the xy graph under this default behavior continually increments the maximum Index coordinate. When delta mode is on the value pairs in the xy graph are shifted instead when the xy graph size is exceeded (the lowest Index coordinate is shifted out). This prevents the Index coordinates from changing at all. Note: Delta mode sets the Index coordinate for the first value pair added using addKeyValue() to -(size/sampleRate).

How to add data to a XY Graph

You can add data to the xy graph in two ways. The first by using addIndexKeyValue() which specifies the new Index, X, and Y coordinates to add to the xy graph. However, if you setup your xy graph first by following the advice from the above section… or just don’t care what the default values are you can use the addKeyValue() function which will add values using just the X and Y coordinates. The index coordinate for new values is equal to the old Index coordinate plus one over the sample rate. addKeyValue() is the default function you will likely use.

The above functions add integer values, if you need to add a floating point value add a capital F to the end of the function name for the floating point version – i.e addIndexKeyValueF() and addKeyValueF().

How to add lots of data to a XY Graph

Adding a single value pair to a xy graph at a time is inefficient. A serial communications connection to Omnia Creator running at 115,200 BPS will never be more than about 40% efficient adding one value pair at a time – transferring only about 576 value pairs per second. However, you can increase the efficiency up to about 97%, transferring about 1,400 values per second, by using the addIndexKeyValues() and addKeyValues() functions which can send up to 256 value pairs in one function call.

How to remove data from a XY Graph

Removing data from your xy graph is easy. You can removeDataBefore() an Index coordinate, removeDataAfter() an Index coordinate, removeDataBetween() two Index coordinates, remove a particular Index coordinate, or just remove everything.

How to turn Fast Fourier Transform (FFT) support on for a XY Graph

Displaying the FFT of your xy graph is really, really, really easy. Just call setFFT() with the type of FFT you want for your xy graph. You can display either the forward FFT or the backward FFT. You can control the window function used for the FFT by calling setFFTWF(). Omnia Creator supports a variety of popular window functions.

You need to set the sample rate and size of your xy graph for the FFT output to make sense. The sample rate should be set to the source of your data’s sample rate. The size should be set to as large of a value you need for the FFT resolution. Try to avoid making really large FFTs if you can help it.

If you are displaying the FFT in dB make sure to set your FFT Y graph axis to log units using setFFTYAxisScaleType(). The default log base is base 10, but you can change that with setFFTYAxisScaleLogBase().

The X xy graph axis of the is the real component input. The Y xy graph axis is the imaginary component input.

The X FFT graph axis of the is the real component output. The Y FFT graph axis is the imaginary component output.


How to create a Bar Graph in a Serial Oscilloscope Widget Window

To add a bar graph (ILOscilloscopeBar) to your Serial Oscilloscope Widget Window you need to declare an ILOscilloscopeBar first. You should declare the bar graph object next to your ILOscilloscope object as they both should be in the same scope.

Next, just initialize the bar graph object like you would the Serial Oscilloscope object. The first argument to init() is it’s parent object which should be a pointer to your ILOscilloscope object which is  &oscilloscope. The second argument is the title string for the bar graph. Giving your bar graph a title string causes its name and symbol to show up in the plot legend. If you give the bar graph an empty string for its title, its symbol and name won’t show up in the plot legend.

How to customize a Bar Graph

Once you’ve created your bar graph you can customize it. You can set the line color, set the line style, set the fill color, set the fill style, set the scatter shape, set the bar graph display widthset a bar graph stacked above this graph, set a bar graph stacked below this graph, and you can reset the name. There’re also get functions for each one of the above properties too!

By default bar graphs plot data using the Cartesian Coordinate System. However, if you need to plot data from a Polar Coordinate System you can tell Omnia Creator through ILOscilloscopeBar by setting the bar graph’s coordinate system. You can specify whether to use degrees or radians while in the Polar Coordinate System too!

If you need to scale each value that you add to your bar graph you can offload this work to Omnia Creator through ILOscilloscopeBar by setting the bar graph’s scaler. Omnia Creator will divide all values added to the bar graph by whatever you set for the scale value. For example, this feature is useful for scaling the 0-1023 value from a 5V ADC down to the 0-5V range – you would set the scaler to (1023/5). Without the scaler your microcontroller would have to perform floating point operations which can be expensive on some microcontrollers.

As for spacing values added to your bar graph out you can set the sample rate of your bar graph. The sample rate controls how far apart values that are added to the bar graph are spaced when you don’t specify an X coordinate. By default the sample rate is 1. Increasing the sample rate will set the spacing between each value you added to the bar graph to (1/sampleRate).

Bar graphs will display the last 256 values added to them by default. You can change the amount of stored values to any number between (1-65536) using the setSize() function.

Finally, if you want your bar graph to display itself like it was in an oscilloscope just turn delta mode on. Normally, once you’ve added more values to your bar graph than it supports (which you can control using setSize()), the value with the lowest X coordinate is thrown away. Continually adding data to the bar graph under this default behavior continually increments the maximum X coordinate. When delta mode is on the values in the bar graph are shifted instead when the bar graph size is exceeded (the lowest X coordinate is shifted out). This prevents the X coordinates from changing at all. Note: Delta mode sets the X coordinate for the first value added using addValue() to -(size/sampleRate).

How to add data to a Bar Graph

You can add data to the bar graph in two ways. The first by using addKeyValue() which specifies the new X and Y coordinates to add to the bar graph. However, if you setup your bar graph first by following the advice from the above section… or just don’t care what the default values are you can use the addValue() function which will add values using just the Y coordinate. The X coordinate for new values is equal to the old X coordinate plus one over the sample rate. addValue() is the default function you will likely use.

The above functions add integer values, if you need to add a floating point value add a capital F to the end of the function name for the floating point version – i.e addKeyValueF() and addValueF().

How to add lots of data to a Bar Graph

Adding a single value to a bar graph at a time is inefficient. A serial communications connection to Omnia Creator running at 115,200 BPS will never be more than about 25% efficient adding one value at a time – transferring only about 720 values per second. However, you can increase the efficiency up to about 97%, transferring about 2,790 values per second, by using the addKeyValues() and addValues() functions which can send up to 256 values in one function call.

How to remove data from a Bar Graph

Removing data from your bar graph is easy. You can removeDataBefore() a X coordinate, removeDataAfter() a X coordinate, removeDataBetween() two X coordinates, remove a particular X coordinate, or just remove everything.


How to create a Box Plot in a Serial Oscilloscope Widget Window

To add a box plot (ILOscilloscopeBox) to your Serial Oscilloscope Widget Window you need to declare an ILOscilloscopeBox first. You should declare the box plot object next to your ILOscilloscope object as they both should be in the same scope.

Next, just initialize the box plot object like you would the Serial Oscilloscope object. The first argument to init() is it’s parent object which should be a pointer to your ILOscilloscope object which is  &oscilloscope. The second argument is the title string for the box plot. Giving your box plot a title string causes its name and symbol to show up in the plot legend. If you give the box plot an empty string for its title, its symbol and name won’t show up in the plot legend.

How to customize a Box Plot

Once you’ve created your box plot you can customize it. You can set the line color, set the line style, set the fill color, set the fill style, set the scatter shape, set the box plot display width, and you can reset the name. There’re also get functions for each one of the above properties too!

By default box plots plot outlier data using the Cartesian Coordinate System. However, if you need to plot outlier data from a Polar Coordinate System you can tell Omnia Creator through ILOscilloscopeBox by setting the box plot’s coordinate system. You can specify whether to use degrees or radians while in the Polar Coordinate System too!

If you need to scale each outlier value that you add to your box plot you can offload this work to Omnia Creator through ILOscilloscopeBox by setting the box plot’s scaler. Omnia Creator will divide all outlier values added to the box plot by whatever you set for the scale value. For example, this feature is useful for scaling the 0-1023 outlier value from a 5V ADC down to the 0-5V range – you would set the scaler to (1023/5). Without the scaler your microcontroller would have to perform floating point operations which can be expensive on some microcontrollers.

As for spacing outlier values added to your box plot out you can set the sample rate of your box plot. The sample rate controls how far apart outlier values that are added to the box plot are spaced when you don’t specify an Index coordinate. By default the sample rate is 1. Increasing the sample rate will set the spacing between each outlier value you added to the box plot to (1/sampleRate).

Box plots will display the last 256 outlier values added to them by default. You can change the amount of stored outlier values to any number between (1-65536) using the setSize() function.

Finally, if you want your box plot to display itself like it was in an oscilloscope just turn delta mode on. Normally, once you’ve added more outlier values to your box plot than it supports (which you can control using setSize()), the outlier value with the lowest Index coordinate is thrown away. Continually adding outlier data to the box plot under this default behavior continually increments the maximum Index coordinate. When delta mode is on the outlier values in the box plot are shifted instead when the box plot size is exceeded (the lowest Index coordinate is shifted out). This prevents the Index coordinates from changing at all. Note: Delta mode sets the Index coordinate for the first outlier value added using addValue() to -(size/sampleRate).

How to add data to a Box Plot

First, set the key to set the x coordinate of the box plot.

Second, set the minimum value, set the lower quartile value, set the median value, set the upper quartile value, and set the maximum value to set the y coordinates of the box plot.

You can add outlier data to the box plot in two ways. The first by using addIndexValue() which specifies the new outlier Index and Y coordinates to add to the box plot. However, if you setup your box plot first by following the advice from the above section… or just don’t care what the default values are you can use the addValue() function which will add outlier values using just the Y coordinate. The Index coordinate for new outlier values is equal to the old Index coordinate plus one over the sample rate. addValue() is the default function you will likely use.

The above functions add integer outlier values, if you need to add a floating point outlier value add a capital F to the end of the function name for the floating point version – i.e addIndexValueF() and addValueF().

How to add lots of outlier data to a Box Plot

Adding a single outlier value to box plot at a time is inefficient. A serial communications connection to Omnia Creator running at 115,200 BPS will never be more than about 25% efficient adding one outlier value at a time – transferring only about 720 outlier values per second. However, you can increase the efficiency up to about 97%, transferring about 2,790 outlier values per second, by using the addIndexValues() and addValues() functions which can send up to 256 outlier values in one function call.

How to remove outlier data from a Box Plot

Removing outlier data from your box plot is easy. You can removeDataBefore() an Index coordinate, removeDataAfter() an Index coordinate, removeDataBetween() two Index coordinates, remove a particular Index coordinate, or just remove everything.


User Interface Help

You can find information about user interface functions below:

Zoom In

To zoom in on whatever is under the mouse cursor go to the File Menu and click Zoom In. You can use the scroll wheel to zoom in also.

Zoom Out

To zoom out on whatever is under the mouse cursor go to the File Menu and click Zoom Out. You can use the scroll wheel to zoom out also.

Zoom Fit

To zoom the viewport to fit all data contained in it go to the File Menu and click Zoom Fit. You can double click on the viewport to zoom fit also.

Panning

To pan around in the viewport left click on the viewport and drag the mouse.

Tooltip

To display a tooltip of the X and Y coordinates of a data point in the viewport hover the mouse cursor over a data point in the viewport.

Save Raster Image

To save a raster image of the viewport or the zoomed fitted viewport to a bmp, jpg, or png file go to the File Menu and click Save Raster Image. You can select the resolution to save the image at – between 1-65,535 pixels for both the horizontal and vertical dimensions. Please note: the line widths and text sizes will not increase with a higher resolution.

Save Vector Image

To save a vector image of the viewport or the zoomed fitted viewport to a pdf or svg file go to the File Menu and click Save Vector Image. You can select the resolution to save the image at – between 1-65,535 pixels for both the horizontal and vertical dimensions. Please note: the line widths and text sizes will not increase with a higher resolution.

Export State

To export your oscilloscope state go to the File Menu and click Export State. This will export your plot state to a JSON file that you can open with Omnia Creator later to recreate your Serial Oscilloscope. Feel free to edit the exported JSON file.

Import State

To import your oscilloscope state go to the main Omnia Creator window, open the Widgets Menu and click Import Widget State. Select the JSON file you want to open and Omnia Creator will recreate the saved Serial Oscilloscope Widget Window for you.

Please note: the new Serial Oscilloscope Widget Window is a static read-only visualization of your data and is not connected to your serial port in any way.