03-08-2011 09:35 PM
Should I be able to make a copy of main.vi
to something like main2.vi and run both copies.
I does work, but I do get some slight odd behavior.
What would the "GOTCHA's" be for doing this.
03-08-2011 11:12 PM
Make "Main" vi Re-entrant and call it two times.
03-09-2011 12:23 AM
What kind of "odd" behavior? You need to be more specific!
What do the programs do? Do the programs access any shared resources (DAQ, subVIs, etc.)
03-09-2011 07:52 AM
As Christian alluded to, it will work right up until you get to shared resources.
Think of it as if you are the boss and the people and equipment used at your work-place are the sub-VI and widgets, respectively.
YOu could clone yourself and both of you could set off on different projects with no problems right up till your employees "have to serve two masters" ("A man can not serve two masters." I believe that was Jesus who said that).
So to pull that stunt off you have to figure out a set of rules for your emplyees so that they aren't being given contradictory tasks.
Now getting concrete...
One of the big conflicts in LV is sharing DAQ widgets. If you set up the DAQ as a producer and make your app a consumer...
But now I am specualting!
Tkae care,
Ben
03-09-2011 08:39 AM
The program has two very distinct components. One that gathers data, one that
does analysis. In it's final version 2 copies will be running on different machines.
I wish to do the development on a single machine, not two. The code does not
use any hardware. The two areas of the code communicate via TCP/IP. While
testing I just open the same socket on address "localhost". My assumption has
been that if I can run Vi "A" and vi "B" at the same time, why not 2 copies of "A".
After all, they should be executing in separate code spaces. I the code does not call
itself, hence no reason to have to set them to be re-entrant. I work on hardware
development during the day and will only be able to get back to this until tonight.
My thought is that "Globals" may be my culprit.
03-09-2011 09:42 AM - edited 03-09-2011 09:50 AM
Have you considered using multiple loops, one for getting the data and one for processing, using a queue to pass data between them? Then you could avoid running separate programs all together, and eliminate the tcp/ip communication.
Edit: didn't see the end product would run on different machines.
03-09-2011 09:54 AM
I'm not creating two programs. I am executing the one program twice
and using each instance in a different mode.
03-09-2011 11:19 AM
Good morning,
You had mentioned that you saw some odd behavior, could you describe what you are seeing? If possible, provide screenshots if you think it will give more clarity.
Regards,
Joe S.
03-09-2011 11:33 AM
@Ben_01880 wrote:
The two areas of the code communicate via TCP/IP. While
testing I just open the same socket on address "localhost". My assumption has
been that if I can run Vi "A" and vi "B" at the same time, why not 2 copies of "A".
Do you mean that both instances are trying to listen on the same port?
03-09-2011 11:58 AM
Same Socket, Same IP.
One instance Listens & Reads, One Writes.