04-17-2016 07:52 PM
Hello,
I have a sligth issues with processing referenced values obtained from a sub VI.
The values from sub VI are referenced to be able to control and read values in a main VI. However, I would like to further process them in the main VI.
I could not find intuitive way to do it. As a very simple example I have attached Main and sub VI, where I would like to further process signal obtained on ind 1 (for example to pass it to ind 2).
Thanks for your help !
04-17-2016 08:22 PM
Instead of using references and writing to property nodes, you might have better luck using a Queue, or User Event, or even a Global Variable. You might want to better describe what your main and subVIs are actually doing and what exactly you are trying to do so that we can help direct you in a better way.
04-17-2016 08:36 PM
H, thanks for your reply.
I think you can consider this post as a very generic question.
How can I process referenced values ?
04-17-2016 08:51 PM
@BB_King wrote:I think you can consider this post as a very generic question.
How can I process referenced values ?
And my very generic answer is that you have a very bad architecture.
Do you need to process all of the generated values or do you only care about the latest value at any random point in time? How often are you processing the data? What type of data are you processing? Why type of processing are you doing with the data?
My very general take on this is that you should use User Events from your subVI to your main VI (which should have an Event Structure) and then your main Vi can doing any GUI updates from the new value. I have never seen a program work well when references are passed around for updates. It just turns into a complete nightmare to track what is happening.
04-17-2016 10:34 PM
Could you present some specific examples ?
Imagine you are having a big project which utilises PXI where you are using several slots for data acquisition, control, etc. The main VI is large and to reduce a clutter you would like to put things in sub VI e.g. counter which lives on one of the PXI's slots, where data from sub VI can be used for further processing in the main VI.
I think question is rather clear and if somebody can provide answer that would be great, without criticizing an architecture or approach.
Thank you !
04-18-2016 04:27 AM - edited 04-18-2016 04:28 AM
@BB_King wrote:Imagine you are having a big project which utilises PXI where you are using several slots for data acquisition, control, etc.
Even more reason to have a good architecture. What I do is make "modules". Each module is a parallel loop that handles one specific task: data logging, read DAQ, read counter, read digital inputs, write digital outputs, oscilloscope control, control loop, state machine loop, etc. Then these modules communicate via queues and/or user events. This setup greatly reduces clutter and makes it simpler to debug since you know exactly where to look.
As far as an example, I just quickly put this together.