|Applicable Versions||NetSim Standard||NetSim Pro|
TABLE OF CONTENTS
- Softwares used
- LabVIEW Example
- NetSim-LabVIEW interfacing
- Output/Metrics specific to this example
- Modifications done to NetSim Source codes
- Procedure to download this project for this example
- Procedure to setup NetSim for this example
- Running NetSim Simulation scenario
NetSim can be interfaced with LabVIEW, which allows users to interact with LabVIEW during run-time. LabVIEW can interact and control the behavior of its Models.
LabVIEW is a system engineering software for applications that require test, measurement, and control with rapid access to hardware and data insights. NetSim now has a method of Interfacing with LabVIEW in a fashion similar to that of MATLAB interfacing. NetSim can initialize a LabVIEW Virtual Instrument (.vi) file during runtime, pass inputs to components of the file, execute the vi, read the computed parameters from its components, and terminate the vi instance at the simulation end.
- NetSim Standard v12.2 or higher
- LabVIEW 2020
- Visual Studio Community Edition 2019 or higher
In this article, we have considered a simple LabVIEW Example. NetSim invokes LabVIEW periodically, which in turn generates a random number and passes it to NetSim in run-time.
Upon interfacing NetSim with LabVIEW the following tasks are performed at simulation start:
Output/Metrics specific to this example
Modifications done to NetSim Source codes
Procedure to download this project for this example
Follow the instructions specified in the following link to clone/download the project folder from GitHub using Visual Studio: How to clone Netsim File Exchange project repositories from Github
Other tools such as GitHub Desktop, SVN Client, Sourcetree, Git from the command line, or any client you like to clone the Git repository.
It is recommended not to download the project as an archive (compressed zip) to avoid incompatibility while importing workspaces into NetSim.
The cloned project directory will contain the documentation specific to the NetSim version (v12.1/v12.2).
Secure URL for the GitHub repository:
Procedure to setup NetSim for this example
- Import the Workspace provided in the repository for interfacing with LabVIEW in NetSim
- Go to Open Simulation/Open Work option and then click on Workspace Options -> Open Code
- Change Labview.tlb path as per your installation in Labview_interface.cpp file which has been added to the ZigBee source code project.
- Rebuild Zigbee project
- Copy Random_Number.vi LabVIEW file to "C:\Program Files (x86)\National Instruments\LabVIEW 2020\examples"
Running NetSim Simulation scenario
- Open Example from NetSim i.e Home Screen ->Open Simulation -> LabVIEW_Example
- NetSim Scenario
As the simulation runs, NetSim automatically initializes LabVIEW and NetSim triggers generation of new random numbers in the LabVIEW model and also gets and prints them to the simulation console as shown below:
NetSim Run-time Simulation interacting with LabVIEW