Skip to content
This repository has been archived by the owner on Mar 17, 2022. It is now read-only.

Example 9

Stanislav Mikhel edited this page Jun 29, 2017 · 1 revision

All elements in VPSYS are logically combined into graphs. All names inside one graph must be unique. User performs his manipulations with the current graph. To get the name of the current graph print

@ ?

while description and the list of elements can be obtained with command

@NAME ?    # NAME - graph title

To create new empty graph just write its name after @

@NEW_GRAPH

If you want to call the element from another graph (for example, to change its value or to create a link), do it in form

elt@graph
elt1 -> elt2@graphB      # example - create link

Use graphs to divide workspace into several parts (schemes), or to combine elements into logical groups. Such group can be transformed into 'block', i.e. a big element that contains other elements. The following peace of code creates a generator of signal which grows as a square root of time.

@SQRT                          # new graph
&SRC a: func = "lin"           # linear signal
&FUNC b: f = "sqrt"            # get square root
a -> b                         # connect
@BASE                          # go to main graph
@SQRT srcSqrt                  # create new block - instance of graph SQRT
&SYNC b                        # data output in graph BASE
srcSqrt -> b                   # use block as an element

When you create instance of graph all connectors that wasn't linked to each other become the output connectors. In this example output of b@sqrt is free, so it is also an output of whole block. That's why we can use such simple form of connection.

Dot notation can be used to call element inside block.

srcSqrt.b: func = "ln"         # use logarithm low for source signal 
Clone this wiki locally