10-16-2024 03:30 AM - edited 10-16-2024 04:39 AM
As the NI gRPC Library is published, I thought I would post some prototyping work I did in interfacing Messenger Library with a gRPC Server. Here is a GIF where I connect to the Server using BloomRPC
10-16-2024 03:58 AM - edited 10-16-2024 04:00 AM
The actual code need in use is just one dropin subVI to create the Server (otherwise, there is no changes needed as teh gRPC Server just interfaces with the existing Messenger-Library Request-Reply and Register-Notify systems):
10-16-2024 04:14 AM
Here is the gRPC Proto file:
// Service exposing Notifications from a Messenger Library Notification Server
// https://www.vipm.io/package/ni_lib_labview_grpc_library/
// https://www.vipm.io/package/drjdpowell_lib_messenging/
// Also uses JSONtext: https://www.vipm.io/package/jdp_science_jsontext/
// James Powell, 2022
syntax = "proto3";
package MessengerLibrary;
// Interface exported by the server.
service Notification {
// Register to get standard Messenger Library Notifications
rpc RegisterByLabels_JSON(RegistrationByLabels) returns (stream Notification_String) {}
rpc RegisterByLabel_JSON(RegistrationByLabel) returns (stream Notification_String) {}
rpc RegisterByLabel_DBL(RegistrationByLabel) returns (stream Notification_DBL) {}
// Messenger Library Request-Reply
rpc RequestReply_DBL(RequestReply_DBL) returns (Notification_DBL) {}
}
// Registration messages
message RegistrationByLabels {
repeated string Labels = 1;
string Prefix = 2; // Optional Prefix to add to Label
}
message RegistrationByLabel {
string Label = 1;
string Relabel = 2; // Optional different label coming back
}
// Notification messages
message Notification_String {
string Label = 1;
string Value_String = 2;
}
message Notification_DBL {
string Label = 1;
double Value_DBL = 2;
}
// Requests (aka Commands)
message RequestReply_DBL {
string Label = 1;
string ReplyLabel = 2; // Optional different label coming back
double RequestData = 3; // Optional Data
}
11-18-2024 05:41 PM
Hi James,
you might have seem my message on VIPM. I would be interested in a TCP JSON implementation of Messenger and more imperatively a network streams version
11-19-2024 10:57 AM
Why do you want a Network Streams version? I ask because Network Streams is on top of TCP, so I don't understand what extra value it would bring.
01-17-2025 03:05 AM
I'm transmitting over a flaky connection and seem to have a lot of packet drop. From my reading Network streams are lossless so should fix my issue superficially
01-17-2025 03:47 AM
TCP is lossless (asks for retransmit of lost packets).
01-20-2025 02:21 PM
Then I should setup my hardware again and try to find the root cause
01-20-2025 02:32 PM
WRT the json serialised message format. I have interests in cross language communications. Only briefly refreshing my understanding of the TCP actors, it appears it would be a decent chunk of work to change the message serialisation from flatten to string to a JSON or XML format