LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in calling event as sub VI

 

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

Download All
0 Kudos
Message 1 of 4
(2,528 Views)

and sub VI is

0 Kudos
Message 2 of 4
(2,527 Views)

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).

 

 

 

0 Kudos
Message 3 of 4
(2,504 Views)

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 

0 Kudos
Message 4 of 4
(2,489 Views)