Skip to content

LabVIEW programming elements

Aron Szabo edited this page Oct 16, 2018 · 11 revisions

Dataflow programming

The main challenge in symbolic executing dataflow programs is assigning execution order to the instruction blocks. Since there is likely to be one or more parallel parts in the program, which have a non-deterministic execution order, converting them to a sequence of instructions is not a trivial question.

VIs

From the symbolic execution point of view, VIs (Virtual Instruments) can be treated as the program, on which the symbolic execution is done. It has inputs, outputs, and most of the instructions are usually the native components of LabVIEW (so that their behaviour can be predicted).

Controls and indicators

  • Controls are going to be the inputs of our program. Their data type can be chosen as one of the basic types, clusters (similar to struct), or objects. In the case of symbolic execution, we are going to stick to the basic types.
  • Indicators are the outputs of the program.

Wires

Instruction blocks use wires to pass data to each other. They are similar to variables in text-based languages, but they also define order of execution between blocks. Since each wire is going to represent a new variable in the program, the symbolic executor will have to deal with lots of unnamed variables.

Types of blocks

This section will describe, how the native blocks of LabVIEW NXG will be planned or expected to behave during symbolic execution.

Program flow

This palette contains the basic programming elements of LabVIEW.

For Loop, While Loop, Case Structure

The case structure will simply be interpreted as an IF statement, and loops can also be handled as an IF-GOTO structure. Most of the cases, for loops run a fixed number of iterations, which means there will be no symbolic variable in the loop condition.

Event loop and timer blocks

TODO further investigation
TODO EVENT LOOP. Timer blocks can be ignored by symbolic execution most of the time.

Select

Based on a boolean value, it passes the corresponding wire through. It will not be a forking statement, since both branches will be executed by the processing of the select block.

Feedback node

Data types

Constants

These will be the fix parameters of the program.

Numeric

Basic math operations, like addition and subtraction will be easy to handle. Complex numbers can be treated as a struct. For Random Number block, we can assign a fix expected value, like 0.5 (or can be treated like an input).

String

These are basic string operations, like in any other programming language.

Array

Cluster

Like struct

Error

Special cluster, with error information (error code, decription)

Timestamp, Path, Waveform, Classes, Variant

Comparison

Math

Mathematical functions

Numeric, Comparison

These are the same operations as in Data types.

Exponential, trigonometric, hyperbolic trigonometric

These can be calculated, or approximated.

Matrix

2D double array operations

Fitting, linear algebra, special functions, statistics, probability, interpolation, integral differentation, formula, geometry, BLAS, polynomial, optimization, ODE

I feel, implementing these would be too difficult for this project.

Analysis

Signal processing, control

When possible, use an approximate value.

Hardware interfaces

Black box, use expected vaules

Data communication

Tag

Something like global variable, use expected value

Internet

Black box

Compatibility (network stream)

Black box

Queue, notifier

Since it behaves like a global variable, they cannot be implemented in symbolic execution.

Storage

Black box

User interface

Dialogs

These might be handled as program inputs (which button is pressed)

Events

???

Interop

Black box