You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+10-85Lines changed: 10 additions & 85 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ eexample/ExampleQueryServer.vi with query_server.proto defines a simple query se
7
7
You can either use the service as defined to implement a generic server via gPRC or use the implementation
8
8
as a pattern to implement a gRPC service of your design.
9
9
10
-
the project supports Windows, Linux, and Linux RT.
10
+
The project supports Windows, Linux, and Linux RT.
11
11
12
12
## Note: This project is not yet complete
13
13
* Not all .proto data types are supported
@@ -17,100 +17,25 @@ the project supports Windows, Linux, and Linux RT.
17
17
18
18
## Creating a LabVIEW gRPC Server
19
19
20
-
1. (Windows Only) Download and install the latest [Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019](https://support.microsoft.com/en-us/topic/the-latest-supported-visual-c-downloads-2647da03-1eea-4433-9aff-95f26a218cc0).
21
-
2. Navigate to the [Releases](https://github.com/ni/grpc-labview/releases) page.
22
-
3. Download the latest Server Release `.zip` for the desired platform.
23
-
4. Extract the contents of the `.zip` to a directory with read and write permissions.
20
+
Step-by-step examples can be found in the [Creating a Server](docs/ServerCreation.md) guide
24
21
25
-
You can use the .proto scripting tool on Windows or Linux.
22
+
### Examples
26
23
27
-
Open the project LabVIEW gRPC.lvproj from the LabVIEW gRPC folder in LabVIEW 2019 or later:
* Select the LabVIEW project you want the server VIs added to
37
-
* Pick a name for the gRPC server
38
-
* Run the VI to generate the server
39
-
40
-
You can generate multiple proto files and add them to the same LabVIEW project. You can also regenerate the same proto file into the same project with the same server name and the existing VIs will be updated to match the proto file. Code you add will not be touched.
41
-
42
-
Once the project is generated you can implement each of the server RPC methods. The generated project contains a LabVIEW class with a method for each RPC method:
There are also several other events that are created
58
-
* Server Stop - sent when the server is stopping. In response the VI should stop
59
-
* Server Internal State - sent when the class state is updated by a call to `Set Server State.vi`
60
-
* Invoke Internal - Helper event to enable communication between RPC methods
61
-
62
-
When the server is started an instance of each of the RPC Method member VIs is run asynchronously to handle parallel calls to different RPC methods.
63
-
64
-
In you method implementation to must use the Get RPC Method Get Input VI to get the RPC Request parameters and you must call the Set Output VI To set the RPC response of the method and to indicate that the RPC call has completed.
65
-
66
-
### Run the Server
67
-
68
-
* Open `Main.vi` from the project.
69
-
* Select either `synchronous` or `asynchronous` with the `Enable Async` button
70
-
* Fill in the Server Address which is in the form of `[address filter]:[port]`. Using `0.0.0.0:[port]` will allow connections from any computer
71
-
* Fill in the path to certificate files if a TLS connection is required, see the section on SSL/TLS Support below for more imformation
72
-
* Run the `Main.vi`
73
-
74
-

24
+
Example servers are located in the examples foldes in the releases.
25
+
* QueryServer - Example server which implements a Query / Invoke / Event API
26
+
*
75
27
28
+
The examples include a python client that can be used to communicate with the example servers.
76
29
77
30
## Using the LabVIEW Client API
78
31
79
32
Coming Soon
80
33
81
-
## Example
82
-
83
-
There is an example server ExampleQueryServer.vi and a corresponding C++ client (example_client).
84
-
When you build the C++ libraries the example client will also be built.
85
-
86
34
## SSL/TLS Support
87
35
88
-
You can enable SSL/TLS support on the server by passing in a path to a certificate and private key for the server.
89
-
90
-
You can generate the certificate with openssl using the following script.
1. (Windows Only) Download and install the latest [Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019](https://support.microsoft.com/en-us/topic/the-latest-supported-visual-c-downloads-2647da03-1eea-4433-9aff-95f26a218cc0).
6
+
2. Navigate to the [Releases](https://github.com/ni/grpc-labview/releases) page.
7
+
3. Download the latest Server Release `.zip` for the desired platform.
8
+
4. Extract the contents of the `.zip` to a directory with read and write permissions.
9
+
10
+
## Server Creation
11
+
12
+
You can use the .proto scripting tool on Windows or Linux.
13
+
14
+
Open the project LabVIEW gRPC.lvproj from the LabVIEW gRPC folder in LabVIEW 2019 or later:
* Select the LabVIEW project you want the server VIs added to
24
+
* Pick a name for the gRPC server
25
+
* Run the VI to generate the server
26
+
27
+
You can generate multiple proto files and add them to the same LabVIEW project. You can also regenerate the same proto file into the same project with the same server name and the existing VIs will be updated to match the proto file. Code you add will not be touched.
28
+
29
+
Once the project is generated you can implement each of the server RPC methods. The generated project contains a LabVIEW class with a method for each RPC method:
There are also several other events that are created
45
+
* Server Stop - sent when the server is stopping. In response the VI should stop
46
+
* Server Internal State - sent when the class state is updated by a call to `Set Server State.vi`
47
+
* Invoke Internal - Helper event to enable communication between RPC methods
48
+
49
+
When the server is started an instance of each of the RPC Method member VIs is run asynchronously to handle parallel calls to different RPC methods.
50
+
51
+
In you method implementation to must use the Get RPC Method Get Input VI to get the RPC Request parameters and you must call the Set Output VI To set the RPC response of the method and to indicate that the RPC call has completed.
52
+
53
+
### Run the Server
54
+
55
+
* Open `Main.vi` from the project.
56
+
* Select either `synchronous` or `asynchronous` with the `Enable Async` button
57
+
* Fill in the Server Address which is in the form of `[address filter]:[port]`. Using `0.0.0.0:[port]` will allow connections from any computer
58
+
* Fill in the path to certificate files if a TLS connection is required, see the section on SSL/TLS Support below for more imformation
59
+
* Run the `Main.vi`
60
+
61
+

0 commit comments