Help us develop the next-generation software, now in alpha!

Virtual Channels

Minor change to title

  • Morten Hattesen
  • Nov 11 2018
  • Needs review
  • Morten Hattesen commented
    November 11, 2018 13:45

    Make it possible, in the Logic software, to add one or more virtual channels.

    This will greatly enhance the functionality of the logic analyzer, and make it possible to determine complex values (where the value of more than one channel is being considered), that cannot easily be seen/determined by just looking at the waveforms of the constituent channels.

    Inspiration for functionality and design:


    1. The value of a virtual channel is the result of an expression that can refer to other (analog, digital) channels.
    2. The language should support mixing analog and digital channel inputs, and the virtual channel value can be displayed as digital and/or analog, like the standard channels
    3. In virtual channel expressions, analog channels are numeric (floating point type, unit: Volt), whereas digital channels are boolean (values True/False or 0/1 when used in expressions mixing analog and digital values/channels).
    4. Virtual channels can be used as inputs for other virtual channels (with checks for circular dependencies).
    5. The expression language, and its built-in operators and functions, should be based on an existing definition/syntax, like that used in spreadsheets, or in programming language expressions (Python, C). If temporary variables are required to be (re)used in one or more virtual channel expressions, they can be defined as a separate (hidden) virtual channel.
    6. If the expression syntax is derived from a programming language, boolean operations should allow both logical operators (and, or, not) and bitwise operators (&, |, ~), as they are equivalent when operating on single bit values.
    7. It should be possible for developers to extend the built-in functions using a Saleae SDK.
    8. In virtual channel functions, channels can be referred to by full case-insensitive name (Channel_1, CHANNEL_1, MyNamedChannel), or  shorthand names (C1, V1)
    9. Default naming for virtual channels: Virtual 1 (V1)
    10. Virtual channel expression examples, when using a spreadsheet-type syntax. For ease of reading, channel names "Dn" are digital, "An" are analog.
      1. A1
        The simplest possible formula, will show a copy of (Analog) Channel 1
      2. A1 - A2
        Will show the (digital or analog) difference between the two input channels.
      3. NOT(D1) * A2 
        Shows the analog value of A2, if the value of D1 is logic 0, otherwise shows 0.0)
      4. IF(D1, NaN(), A2)
        Similar to above, but shows nothing, if the value of D1 is 0, rather than showing a 0.0 analog value.
      5. IF(A1 > 1,4, 1, IF(A1 < 0.7, 0, NaN())
        Analog to digital conversion with logic 0 defined as < 0.7V, and logic 1 defined as >1.4V. Values between 0.7V and 1.4V can not be logically determined (Not a Number), and displayed according to the rules for how to display NaN values.
      6. AND(D1, OR(D2, NOT(D3))
        Shows the result of a boolean expression using D1, D2, D2. In programming language expression.
        The same expression would look like these, when Python syntax were used for expressions:
        D1 and (D2 or (not D3))
        D1 & (D2 | ~D3)
    11. Note on choosing expression syntax: Using a function approach, like in spreadsheet formulas, for all but the most basic operators (+, -, *, /, =), will make it easier to extend the expression language, by simply adding new functions, like...
      1. AND(D1, TIMESHIFT(D2, -200e-6)
        - where the TIMESHIFT function allows using a value of a signal at a different time (usually in the past), in this case, the value of D2 from 200µS earlier.


    There is possibly an overlap between this idea, and the SALEAE-I-294