06-08-2021 04:10 AM - edited 06-08-2021 04:15 AM
Hi Cobayatron,
So I just wanted to add/check to what I think you've done. Currently, you have:
06-08-2021 05:29 AM
hI cbutcher,
Thanks for your detailed explanation, that was very useful.
I am using NSV with buffering for the data coming from my sensors but you still mentioned that Network streams perform better for this specific case, I´ll try to change to them then.
Thanks again
06-08-2021 06:38 AM
@cobayatron wrote:
hI cbutcher,
Thanks for your detailed explanation, that was very useful.
I am using NSV with buffering for the data coming from my sensors but you still mentioned that Network streams perform better for this specific case, I´ll try to change to them then.
Thanks again
Hmm, given the choice I'd pick Network Streams, and I have heard some people have weird issues with NSVs, but I don't have experience with them myself (maybe that was obvious from my lack of initial clarity on their purpose - oops) and if you aren't having any problems, I don't know enough to say if it's worth switching preemptively...
That being said, definitely worth learning about Network Streams if you want to use them in the future.
On key point that initially frustrated me was their unfriendliness with disconnecting and reconnecting clients, or multiple clients.
A Network Stream is established between two endpoints, and if one of them closes (e.g. the desktop 'client' - although NS has no concept of "server" or "client", just "reader" and "writer") then the other end must also be closed and if you want to connect again, it must be reestablished (recreated).
There are (as usual...) many solutions to this, the three that I've tried are
If you want more information, let me know (here, or in another question, I guess). I sometimes also consider releasing the source code for some of these things, but I have to talk to people at work for that first... 😕
06-09-2021 09:34 PM
I'm working on my second "big" LabVIEW-RT Project (I started the first a bunch of years ago, and the second a bunch of months ago). Both involve using multiple Network Streams.
The basic Design for both Host and Target systems is a "State-Machine-like" design, built around something like a Queued (or Channel) Message Handler. I typically have at least 4 Network Streams (one-way communication, of course) arranged as follows:
NI has a number of White Papers on Network Streams that can be found on the Web. They really aren't that hard, and work amazingly well. I definitely didn't fare as well with Network Shared Variables ...
Bob Schor
06-10-2021 02:49 AM
Hi cbutcher & Bob Schor,
I replaced the buffered NSV for a Network stream to pass the sensors data to the host and seems to work fine.
I will now add another network stream to pass postprocessed data (FFT, RMS levels...). According to Bob Schor they seem to coexist well so I´ll see what I can do.
Thanks for sharing your experience in this.
06-10-2021 08:44 AM
The Key to Network Stream Coexistance is coming up with "good" Reader/Writer names. I use a two-part name -- the first part describes what is carried in the Stream, the second is W (for Writer) or R (for Reader).
Examples:
UI->RT Msg, W Stream to carry UI (Host) Messages to the RT (Target), Writer (present on Host)
UI->RT Msg, R Stream on Target that accepts the above UI->RT Messages
RT->UI Msg, R Stream on Host that accepts Messages from Target
ADC Samples, W Stream carrying A/D Samples from RT to UI, present on Target
RT Event, R Stream on Host that accepts Events from RT (could also be called "Event, R")
I trust the logic is clear.
Bob Schor