LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to dynamically call and order program modules

Hey guys,

 

I have ‘x’ pieces of code (x could be 10’s or 100’s of modules).
I need to be able to dynamically call and run ‘y’ of them, but I need to be able to do it in parallel, and some of them might be in order.

For instance ‘A’, ‘B’ and ‘C’ need to run in parallel,

but 'D' needs data from 'A' and will run after 'A',

and 'E' needs to run after ‘D’,

and ‘F’ needs data from 'C' and will to run after ‘C’

 

So I have two questions.

How should I organize and order these dynamic calls?

and What method should I use to pass data along from one VI to another?

0 Kudos
Message 1 of 13
(2,910 Views)

You could use a configuration file in order to describe the dependencies and the start order of the files.

To me queues seem to be the best method for data exchange. DVR may work also.

0 Kudos
Message 2 of 13
(2,901 Views)

Honestly, this sounds like you might take a look into NI TestStand.

 

If you are going to implement this on your own, you should first create a software design: What functions are 'A', 'B', ...? What are the inputs/outputs? How do they synchronize to other parallel tasks?

Using this information, you can select LV structures and methods to implement this design. If you identify gaps in knowledge, you should look for training and/or consulting services from NI.

Another option would be to approach a NI Alliance Partner who can implement a turnkey solution for you.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 3 of 13
(2,860 Views)

The problem does not look as so terribly advanced.

 

1. To select the best solution, you shall define if order of these processes is alvays the same. If not, shall the order be assembled at start of the program or could be changed "on the fly"?

 

I do not know how advanced are you in LabVIEW, so please do not take the foloowing advice personally: Do not try to implement most flexible architecture, if you do not need it. All unnecessary advances cost your time and/or money.

 

2. There are many ways to establish communications between processes: from Globals (highly depreciated) to events (quite advanced). The most conventional are Queues and Notifiers.

 

PS: Lecture on advanced dynamic architecture: 

 

https://www.youtube.com/channel/UCKX7JlfVIY0nMkXmDanfA9w/feed

 

but you probably need something simpler.

 

_____________________________________
www.azinterface.net - Interface-based multiple inheritance for LabVIEW OOP
0 Kudos
Message 4 of 13
(2,850 Views)

Queue sounds like a good idea in terms of passing data from one module to another.

 

I am guessing one way to do this is:

-let the program decide how many queues need to be created for these parallel executions or threads

-dynamically create queues so that results from one module could be passed along to another

-close existing queue or open new queue, depending on if the thread requires more queues or if the thread stops.

0 Kudos
Message 5 of 13
(2,821 Views)

This sound reasonable if the program decides how many threads must run. A good idea would be to create each process and corresponding queue(s) by the same routine.

_____________________________________
www.azinterface.net - Interface-based multiple inheritance for LabVIEW OOP
0 Kudos
Message 6 of 13
(2,818 Views)

I know a little bit about Teststand and its ability to change sequences in a flexible manner.

But when you thought of Teststand, did you have a specific feature of Teststand that you thought it would be a viable solution?

Since we will probably have the end user choose the modules required in this module operation, having a premade sequence editor might be nice

0 Kudos
Message 7 of 13
(2,817 Views)

 

1. To select the best solution, you shall define if order of these processes is alvays the same. If not, shall the order be assembled at start of the program or could be changed "on the fly"?


on the fly

 


 

2. There are many ways to establish communications between processes: from Globals (highly depreciated) to events (quite advanced). The most conventional are Queues and Notifiers.

 

PS: Lecture on advanced dynamic architecture: 

 

https://www.youtube.com/channel/UCKX7JlfVIY0nMkXmDanfA9w/feed

 

but you probably need something simpler.

 


I think queues would provide nice structure for data communication for now.

I will take a look at that video.. looks interesting

0 Kudos
Message 8 of 13
(2,815 Views)

> on the fly

 

So, you probably need a state machine, which will control laucjnching/termination of threads and corresponding communication channels.

 

By the way, check Actor Framework Template. It could be helpful.

_____________________________________
www.azinterface.net - Interface-based multiple inheritance for LabVIEW OOP
0 Kudos
Message 9 of 13
(2,789 Views)

@jcyth wrote:

[...]But when you thought of Teststand, did you have a specific feature of Teststand that you thought it would be a viable solution?

Since we will probably have the end user choose the modules required in this module operation, having a premade sequence editor might be nice


My point mentioning TestStand is that my feeling tells me that you are going to re-implement some very basic functions which are already included in TestStand.

To be honest: TestStand adds additional costs. You have to purchase licenses, you should get some training which takes time until getting payed off.

But on the other hand: You also need time to implement and test your self-made approach. Also: Does this project grow in the future? Do you need additional features in the (near) future?

 

Going into this will result in a break even in costs where you can say: if i take more time in my self-made approach, it is cheaper to go for TestStand right from the beginning.

 

TestStand is designed to be VERY flexible. But you have to get familiar to this flexibiity in order to get where you want. Therefore, i recommend you to collect some information before making the decision. Maybe you want to invite some sales guy from NI in order to present TestStand to you....

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 10 of 13
(2,752 Views)