The \Examples_Source
directory in the repository contains three different scenarios highlighting different use cases:
This is the original example, showing GenNet's default use cases with two modules:
The GenNet-Proxy
module is a Generic-Networking-enabled DQMH Singleton module, which means it is altered to allow for (near) zero-coupled networking functionality. It showcases the transparent use case
GenNet-Proxy.lvlib
running in another application and/or another PC accessible via TCP/IP.GenNet-Proxy.lvlib
running in another application and/or on another PC via TCP/IP communication.
The RemoteControl
module showcases the manual use case of the GenNet-Client
and GenNet-Server
modules, and how any generic DQMH module can make use of the generic networking functions, albeit not transparently to the user. The message that's sent via the network needs to be constructed manually, and in a way that the opposite site can decode it.
This showcase demonstrates the transparent use case and how to use a module's API in one application and have its code executed in another application. Therefore, two LabVIEW projects are used that contain the same module. Check the Application Instance on the bottom left of the API Tester, to ensure in which Application it was loaded. Follow these steps to configure GenNet-Proxy
in the Windows Application
as a client which forwards requests to the GenNet-Proxy
in the Realtime Application
, where the GenNet-Proxy
is configured as a server, receiving the request, executing the MHL-case and sending the payload back over the network:
\Generic Networking Example_Source\Windows Application.lvproj
fileTest GenNet-Proxy API.vi
Tester, start the module and Enable Network Forwarding\Generic Networking Example_Source\Realtime Application.lvproj
fileTest GenNet-Proxy API.vi
Tester, start the module and Enable Network ListeningWindows Application
trigger Do something with answer requests with different Some Values
Realtime Application
displays multiple Did something messages in the status logWindows Application
change the Factor
and trigger the Update Factor requestWindows Application
displays the “Some Value” multiplied by Factor =
result correctly on the front panel\Generic Networking Example_Source\Generic Networking Example.lvproj
fileTest GenNet-Proxy API.vi
Tester, start the module and Enable Network ListeningTest RemoteControl API.vi
Tester, start the module and Open GenNet Connection
Now, you have a network connection between the two modules: RemoteControl
is using a GenNet-Client
to send requests and receive broadcasts. GenNet-Proxy
is using a GenNet-Server
to receive requests and send broadcasts. Let us send a request from RemoteControl
to the GenNet-Proxy
:
Test RemoteControl API.vi
Tester, it will actually call the Do something with answer request of the GenNet-Proxy
module.Test GenNet-Proxy API.vi
Tester and see how the result in the Test RemoteControl API.vi
Tester changes when you call Send Message via GenNet again.
This project contains a Generic-Networking-enabled module that showcases the use of broadcasts.
The GenNet-RoundTrip
module is like the GenNet-Proxy
module, but with a new feature for sending DQMH Round Trip events over the network. The normal Round Trip event also includes a DQMH broadcast, but this broadcast will only be fired locally. With the new feature, the normal broadcast will be encapsulated in a generic broadcast and the remote side can identify it. The GenNet-RoundTrip
module showcases the concrete implementation.
The PlainString example again showcases how communication between two separate applications that are connected through a network can be implemented with GenNet. In this case, we assume a scenario where an application running on Windows shall communicate with another application running on a PXI system (a real-time controller).
The two applications - we'll call them the “Windows Side” and “Real-Time Side” - use the PlainString protocol implementation for communicating data. Both DQMH modules implement the Manual Use Case.
The PlainString Example - Windows Side.lvproj
contains a single, non-GenNet-enabled DQMH module: The Windows Client module. As the name suggests, it acts as the client that connects to its counterpart.
The PlainString Example - Real-Time Side.lvproj
contains another non-GenNet-enabled DQMH module: The PXI Server module. This is the server-side that opens a network port and waits for incoming connections.