3.3 Modes of Operation |
The PDA API operates as a service-client pair. They may run on the same host or connect remotely.
The user process references the PDA API client DLL. The client would either start a local PDA service, or connect to an already running PDA service. The service will then provide connection to the SP-ICE-3 card(s) and will perform acquisitions. The service may be started in three ways:
The C# wrapped ClientLib's Api class enables interfacing with a using statement. The service is automatically started on the machine executing the code and the client connects to the service. As long as the using statement is valid, the service will be kept alive. When the api runs out of scope, the service will shutdown and all connected cards will be disconnected and freed. The PDA configuration will be saved on each change and reloaded on a new service startup.
// Get an api instance (starts server and connects client) using ( var api = new Api( ) ) { // Discover all cards on this PC and its network var cards = api.Acquisition.Discover(); } // Discard the api, closes all connections and the service/client
The Process Data Analyzer API service can be manually started in code or by starting the service using the ProcessDataAnalyzer.Service.exe and keeping it open for as long as the Client API will be used. Manually running the service means starting it as server by passing the service flag to the ProcessDataAnalyzer.Service.exe. The="" API will then consist of a client instance connected to the server.
ProcessDataAnalyzer.Service.exe server
// Get an api client instance // The client connects to the default local server. static Client client = new Client(); // Discover all cards on this PC and its network var cards = client.Acquisition.Discover();
To run the Process Data Analyzer API service, run the ProcessDataAnalyzer.Service.exe e.g. in a command line and keep the command line opened. This will start a windows service which runs in the background. For this single instance use case, the addition of the server flag would be preferred.
ProcessDataAnalyzer.Service.exe
To install the service as Windows service which will run on each system startup until system shutdown, call the with the install flag. After first installation, the service needs to be started as well with the start flag.
Notice: To install the service, starting the command line with administrator rights is necessary.
ProcessDataAnalyzer.Service.exe install
ProcessDataAnalyzer.Service.exe start
If all went well, the ProcessDataAnalyzer.Service.exe should be listed in the TaskManager under the services tab.
Caution: With the service running in the background, connected cards will stay connected even after the client application is closed. If this behavior is not desired, the client application must handle the card states before exiting (planned or unplanned).