Co-simulation within the AWR design environment is enabled through a LabVIEW element on the VSS diagram. Underneath the hood, this feature is enabled by VI server technology, which enables LabVIEW code to be remotely executed either through the LabVIEW runtime engine or development environment. As we’ll describe, creating and configuring LabVIEW code to be executed by VSS can be accomplished in a few simple steps. For background information on the VSS system tool, please visit the VSS product page.
Step 1: Create and Configure a LabVIEW VI
In order to explain how co-simulation between VSS and LabVIEW works, let’s start with a simple LabVIEW VI which performs a complex conjugate operation on an array of complex double samples. Here, we’ve chosen to use the complex double datatype because it is frequently used to represent time domain IQ samples of an RF signal. In Figure 1, observe both the front panel and block diagram of a LabVIEW VI. Note that both an input control and an output indicator have been configured on the connector pane of the LabVIEW front panel.
Figure 1. LabVIEW VI configured for execution within the VSS environment.
Configuring the connector pane is an essential step to running LabVIEW code from VSS – as it determines which controls and indicators can be “seen” from the VSS. Each of these controls and indicators will eventually map to ports on the LabVIEW element in the VSS system diagram. Note that this configuration step is identical to configuration required for execution as a LabVIEW subVI.
Step 2. Configure the LabVIEW Element in VSS
Once a LabVIEW VI is appropriately configured to execute as a subVI, the next step is to place and configure a LabVIEW element on the VSS system diagram. By default, the LabVIEW element will not have connection ports – since these must be added through a configuration step. To do this, double-click on the LabVIEW node to open the configuration panel. A configuration panel will appear – as shown in Figure 2.
Figure 2. A configuration panel is used to connect controls and indicators in the LabVIEW environment to ports in the VSS environment.
Once the LabVIEW configuration panel is open, browse for the desired VI path. Once the path is selected, one can configure both input and output ports by clicking on the “add” button next to each category. With the VI correctly loaded, the VSS environment will “see” which LabVIEW controls and indicators have been configured in the VI connector pane. In Figure 2, observe that we’ve chosen to configure a particular VI with several controls and indicators in the connector pane. As the image illustrates, each control and each indicator on the connector pane is mapped to an input or output port in VSS. As we see in Figure 2, the LabVIEW element can support multiple input and output ports.
Step 3: Build the VSS diagram
With the LabVIEW element appropriately configured – each port on the VSS element can be connected to other elements in the VSS environment. When passing signals between LabVIEW and VSS, the appropriate datatype is an array of complex doubles (or cluster containing an array of complex doubles). This datatype easily maps to other elements in VSS, as shown in Figure 3.
Figure 3. LabVIEW Co-Simulation is enabled through the LabVIEW element in VSS
As we observe in Figure 3, LabVIEW diagrams can be inserted directly into the VSS diagram – and will execute in conjunction with other VSS elements.
Step 4: Execution of the VSS Diagram
The execution of LabVIEW code within the VSS system diagram occurs once the VSS diagram is simulated. Consistent with the execution flow of the VSS diagram, samples are passed both into and out of each LabVIEW element in VSS through the configured controls and indicators. Note that LabVIEW code can be executed by the AWR design environment by invoking either the LabVIEW development environment or runtime engine - depending on user selection. When the LabVIEW development environment is selected as the execution mechanism, both block diagram as well as front panel can be observed and debugged while LabVIEW code is running.