ASPL User Guide v 1.00
© 2025 Bassem W. Jamaleddine


21-1

   Tying Attributes to UNIX Devices

The element attributes defined in a grouping class can be tied to UNIX devices through the tie mechanism implemented through Udev interface. The following command, when typed at the shell prompt, creates the element grouping class: TIERANDOMDEVICESGROUP, with the following three attributes rn1, rn2, and rn3. All the three attributes are tied to UNIX devices.
# metagrouping -creategrouping TIERANDOMDEVICESGROUP -attributes "rn1,t" "rn2,t" "rn3,t"
The listed attributes are colon delimited, and each attribute is followed by a comma and a little t saying that the attribute is to be tied.

For a group whose element attributes tie to external UNIX devices, ASPL creates the processing stubs, however you need to edit some of these stubs to finalize its connectivity with the devices so that the attributes can stream data in real time (everytime ASPL operations are sourcing data through these attributes).

You need to edit and create some GG-function in the GG-Container to build GADg structured groups whose attributes are in concordance with these described in the grouping class TIERANDOMDEVICESGROUP. For example the following ~gg/ggtierandomdevices.pm provides the function ggtierandomdevices() that we will use in the following example. Recall that ~gg refers to the GG-Container repository, and to edit the aforementioned file from the shell prompt:

vi `asplcmd ~gg`/ggtierandomdevices.pm

Let's summarize some of the tilde-expansions that are useful to explore with a namedspace using tied attributes.


The sample workspace TIEURANDOM, whose element grouping class is TIERANDOMDEVICESGROUP, shows an example on how to tie attributes to UNIX random device. Start ASPL by loading the sample namedspace TIEURANDOM:

aspl TIEURANDOM

At the ASPL prompt you can type ~feeder to change directory to the location of the module Udev that provides the interface between the tied attributes and the UNIX devices. You can type ~udev to edit the egC-feeder Udev and make changes per your programming needs.
To change directory to the location of the GG-Container, you will type ~gg. You can type ggls ggtierandomdevices() to display information about the GG-function ggtierandomdevices. You can also edit ggtierandomdevices.pm and make any desired change: edit ggtierandomdevices(). In case you have syntax error, ASPL GG-Container will throw the error when loading your module. Issuing the command ggls will cause reloading the GG-Container and the command will display all GG-functions defined with egroupingclass TIERANDOMDEVICESGROUP, which is the one currently loaded by ASPL. Every GG-function is bound to one and only one egroupingclass. The binding is simply done by the statement
$egroupingclass = "THE_NAMED_ELEMENT_GROUPING_CLASS";
In the case of ggtierandomdevices.pm, you can locate the statement:
$egroupingclass = "TIERANDOMDEVICESGROUP";
which tells that the GG-function attributes have their metadata defined in namedGClass TIERANDOMDEVICESGROUP whose metadata descriptor can be located with the tilde-expansion ~elmd. The tilde-expansion ~egc prints the URL where the node definition of the namedGClass TIERANDOMDEVICESGROUP is located; notice that the latter name is the same as the last word of the printed URL.

At the ASPL prompt, issue the command egCwhoami to ping the currently loaded element grouping class: TIERANDOMDEVICESGROUP. To print the known attributes defined within this class, simply type attributes.

The program metagrouping creates an element grouping class in egC-Container.
The element grouping class is created only once, and it can be used by many
GG-functions. To list all element grouping classes known to your ASPL interpeter:
metagrouping -list



Let's create a grouping class called OSCILLATORSGROUP: where fosc1 and fosc2 are tied attributes to two oscillating functions.
# metagrouping -creategrouping OSCILLATORSGROUP -attributes "fosc1,t" "fosc2,t" "fx,i"


In the following example we start ASPL by loading the sample namedspace SIGNALS (whose ELGROCO or groupingclass is OSCILLATORSGROUP) and show the components involved in the tie process.
viewme

 -TC- Display. 21.1.1   [SIGNALS TIE INTERNALS]
Terminal showing SIGNALS internals for tying UNIX devices


In the following example we show the usual usage of tied interface by putting the tie process at work. In this example we start ASPL loading the sample workspace SIGNALS and show how to do a simulation to intersect two data signals.

viewme

 -TC- Display. 21.1.2   [SIGNALS EXAMPLE]
Terminal showing SIGNALS intersection from tied devices