LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

i do not want to halt main vi while executing sub vi

I am communicating with a device which supports mod bus protocol. I am writing the data coming from the device in a file(excelsheet) . The code for communication and writing in file is in the main vi. I am analyzing the data in sub vi when i execute the sub vi communication breakes .I do not want to halt commnication or file writing in the main vi while in sub vi. Can anybody help me?
0 Kudos
Message 1 of 3
(2,220 Views)
The easiest way would probably be to call the subVI dynamically and pass data to it with a queue, global variable or something. I'm attaching an example that I made a while back that kinda shows what I mean.

Brian
0 Kudos
Message 2 of 3
(2,220 Views)
Roopal wrote in message news:<506500000008000000DB450000-1019262487000@exchange.ni.com>...
> I am communicating with a device which supports mod bus protocol. I am
> writing the data coming from the device in a file(excelsheet) . The
> code for communication and writing in file is in the main vi. I am
> analyzing the data in sub vi when i execute the sub vi communication
> breakes .I do not want to halt commnication or file writing in the
> main vi while in sub vi. Can anybody help me?

Either you are making a limited number of data captures or you have
an essentially unlimited stream. (The output file suggests a limited
number.)

In the case of a limited number of captures, how about capturing all
of the data before you start your analysis. Then d
o all analysis.
Then write out the file. If you want all your data captured at close
to the same time, this approach might be better.

In the case of an unlimited stream, either your average calculation
and write time is less than your capture rate or not. If not and the
calculation time puts you over the limit, the calculation would have
to be done as a separate post-processing step.

Don't know about mod-bus or how you are using it, but it may help
to throttle down the data capture speed by putting "Wait Until Next
ms Multiple" in the capture loop. Also, if you separately issue
trigger and read commands, see below.

Another problem could be that the calculation subVI is hogging the
cpu. In this case, try putting a "Wait (ms)" with 0 (ms) input in
the/an inner calculation loop. This may give other processes a
better chance at the cpu. You could also set File>VI Properties
>Execution>Priority to be higher in the mainVI than in the subVI.
This might work differently on different p
latforms.
0 Kudos
Message 3 of 3
(2,220 Views)