10-06-2011 10:14 AM
Hi experts
The following VI is a VI for connecting RS232 port and sending data to that port. I want to use this VI as a sub VI, because I have a multi-event structure with several functions and a main VI which use these functions. I attached two of these event cases as a subvi (connect .vi) and I want to handle it in a simple main VI ( TEST.VI). Unfortunately, it doesn’t work. I used the register event but I think it doesn`t work. I think the problem is in using event as a subvi. I create a very simple event structure with two function (multiplying and dividing) the attached file. When I press ok it calculates the answer but after that it become zero, I think there must be some solution for these.
I appreciate any help to solve this problem
10-06-2011 10:15 AM
and sub VI is
10-07-2011 02:20 AM - edited 10-07-2011 02:22 AM
Frankly, your code makes no sense! Why is there even an event structure in the subVI at all?
Can you explan what the program is supposed to do?
Then you have mindboggling rube goldberg code constructs (local variable, boolean AND, case structure, local variable, etc.) such as the following (top), which could be replaced by a single wire (below).
10-07-2011 09:07 AM
Yes, you right, the connection between bottom and LED is enough, but I wanted to become sure that it is on when the bottom is true.
My main program consist of 3 main subVi, which one of them is RS232 reading and writing. this VI consist of 20 differet job which one of them is connection. so I want to use this Sub Vi in my main VI. please find attached which is my RS232 interface, as you see there is a lot of bottom, they are in event structure. so If I could use one of them then I could use all of them, and my problem is using event as subVI