06-27-2018 06:52 AM
@crossrulz wrote:
@TomaszCiesla wrote:
here's the example.
Yes it looks like a Global Variable but it's much faster (I've tested the performance)
I would really like to see that benchmark code. Every time I benchmark with property nodes, they are 1000s of times slower than local variables and global variables.
I actually just updated my race condition benchmark and even with the Defer Front Panel Updates set for the property node benchmark (increases performance by not having the front panel update each time the value property is read and written) the Property Nodes were ~1794 times SLOWER than using Global Variables. There were a couple of other things that looked interesting that I would like to spend some time investigating before updating my document.
06-27-2018 06:58 AM
Hello TomaszCiesla,
You can try using User events to send data between loops and also to send termination from main vi to all sub vi.
06-27-2018 07:06 AM
@TomaszCiesla wrote:
so in this scenario I abandon bidirectional approach - the device's while loop can only stream the data to mail while loop. And main while loop communicates with device's while loop using the global variables
1. There is no good bidirectional bus. Any bidirectional communications will be wrought with race conditions.
2. What I do is have a queue for each instrument. This allows the main loop to send any message to the instrument loop (Start Collecting, Reset, Stop Collecting, Exit, Change Configuration, etc). I use the timeout of the queue to limit my loop rate. And the main loop also has its own queue that every other loop can send their respective data through. So, in short, if you have 3 loops (2 instruments and 1 main), you should have 3 queues. Again, go search for Queued Message Handler. Or you might also want to have a good look at the Delacore Queued Message Handler (DQMH) which is a framework already put together for you and freely available through the LabVIEW Tools Network and VI Package Manager (VIPM).
06-27-2018 07:30 AM - edited 06-27-2018 07:47 AM
The problem is that I'll have >10 devices running in parallel and 10 ques = lot of mess 😉
I've made a benchmark, see the attachment, on my PCB the difference is x100 in the favor of global variable and queue, the funny thing is that, there's no difference between speed of execution of queue and global variable - so maybe I should just simply replace everything with global variables? less wires and easier data manipulation?