LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Have some problems after making an application.exe

Dear Sir:

I am currently using Labview 7.1 to develop my program.
I have two main program and I just made these two program (A.vi and B.vi) as two application.exe, like A.exe and B.exe.
For B.exe, it will read some data from A.exe. In the program A.vi, I use "open VI reference" and Invoke Node to read the data from B.vi. Under Labview environment, it works well, however, when I build these two program into application, A.exe and B.exe, the result shows that A.exe is unable to read data from B.exe. Can anyone help me to figure out this issue. I am not sure that I am correct or not, but I use this method in Labview 7.0, and it works well, unfortunately, it not works well under labview 7.1. Thanks for your help.

Best Regards.

Fred
0 Kudos
Message 1 of 10
(3,690 Views)


@shh2745 wrote:
Dear Sir:

I am currently using Labview 7.1 to develop my program.
I have two main program and I just made these two program (A.vi and B.vi) as two application.exe, like A.exe and B.exe.
For B.exe, it will read some data from A.exe. In the program A.vi, I use "open VI reference" and Invoke Node to read the data from B.vi. Under Labview environment, it works well, however, when I build these two program into application, A.exe and B.exe, the result shows that A.exe is unable to read data from B.exe. Can anyone help me to figure out this issue. I am not sure that I am correct or not, but I use this method in Labview 7.0, and it works well, unfortunately, it not works well under labview 7.1. Thanks for your help.

Best Regards.

Fred


Dear Sir:

The example vi sets are just like attached:
0 Kudos
Message 2 of 10
(3,680 Views)


@shh2745 wrote:
Dear Sir:

I am currently using Labview 7.1 to develop my program.
I have two main program and I just made these two program (A.vi and B.vi) as two application.exe, like A.exe and B.exe.
For B.exe, it will read some data from A.exe. In the program A.vi, I use "open VI reference" and Invoke Node to read the data from B.vi. Under Labview environment, it works well, however, when I build these two program into application, A.exe and B.exe, the result shows that A.exe is unable to read data from B.exe. Can anyone help me to figure out this issue. I am not sure that I am correct or not, but I use this method in Labview 7.0, and it works well, unfortunately, it not works well under labview 7.1. Thanks for your help.

Best Regards.

Fred


Dear Sir:

The example vi sets are just like attached:
0 Kudos
Message 3 of 10
(3,679 Views)
Your method will not work when you build two separate exe files and it wouldn't have worked in 7.0 either. If you really want two exe files, then the path to the second VI would have to include the exe file. In your example, you have B.vi that you build into B.exe. The path to the VI is then \folder\B.exe\B.vi. You can also do it with a single exe and include in the build B.vi as a dynamic VI. You would still need to adjust for the path. Instead of hard-coding a path to the subVI, it would be better to use the Current VI's Path function and then Strip Path and Build Path functions. Since the dynamic VI is inside the exe file when built, in order to get A to work in both development and executable, use the application property App.Kind to determine whether you're in run-time or developement and do an extra strip path if you're in run-time.
Message 4 of 10
(3,672 Views)
Dear Sir:

Thanks for your suggestion. I follow your instruction to modify my program, however, it still did not work. The modification I made is as follows:
1. Save A.vi and B.vi in the same folder.
2. In the A.vi block panel, the path of the open VI reference is created based on the current path with strip path, then use build path to include B.vi for path of open VI reference.
3. When I build an application of A.vi, in the Source Files items, I add B.vi as dynamic Vi, then I build A.exe.
4. Then just run A.exe
It did not work.

Can you help me to figure out where did I make a mistake? or should I still need to do something to make it work?
By the way, what is App.Kind? where and how can I set this property?

Best Regards.


Fred
0 Kudos
Message 5 of 10
(3,664 Views)
hi there

you can't swap data between two exes using vi-references! and it never worked in prior versions of labview. each app has its own memory space, so if you open a reference from A.exe to a VI running in B.exe you create a new instance of that VI in the memory space of A.exe. This new instance has no shared data with the instance in B.exe (and, by the way, that would make the execution behaviour of a X.exe quite unpredictable..).

to share data between several exes you can use tcp/ip, udp, dstp or filesharing.

best regards
chris
Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
0 Kudos
Message 6 of 10
(3,653 Views)
Chris, in this case he said he put B.vi in the folder, so it's OK.
The problem is that VI Path gives you the entire path, including the file, so when you do one strip on A.vi you will get C:\...\A.exe, so the build path would give you C:\..\A.exe\B.vi. What Dennis said is that you need to do ANOTHER Strip Path before building.
To do so, place a property node (from the application control palette) on the diagram. A property node allows you to access and manipulate the properties of objects. In this case our object is the application, which is the default choise. Scroll through the list of properties and find Application>>Kind, which is a numeric. Create a case structure and wire the result into its terminal. Have one case for Run Time, which will perform an additional strip and a case for the rest, which will not perform the additional strip. Create an indicator to see the full path you're wiring into Open VI Ref, and you can do some further checking on your own.

___________________
Try to take over the world!
0 Kudos
Message 7 of 10
(3,644 Views)
Hi,

Thanks for your help. I already figure out how to solve the problem. The way I used is when I build the application of A.vi, in the source files item, I add the B.vi as top-level vi, then it works.

Thanks for everyone's help again.

Best Regards.

Fred
0 Kudos
Message 8 of 10
(3,641 Views)
Sorry, I wasn't very clear. In the case where you include a dynamic VI in the build, you do not need an extra strip path. If you were providing B as some sort of plug-in (A.exe and b.vi in same folder) and it was not included in the build, then you would need the extra strip path. I think your only problem is that you do not run B.vi. This wouldn't have worked in the development environment either.
0 Kudos
Message 9 of 10
(3,636 Views)
Dear Guys:

Thanks for all of your help. Your suggestions really help me a lot.

Fred.
0 Kudos
Message 10 of 10
(3,611 Views)