From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

call by reference freeze front panel

Hi,

  I have a program where I want to load a set of subvi-s depending on some user input.  I pass the path& name of the target vi and

use "open vi reference" > "Call by reference" method of loading the correct  set of  subvi-s.  (Labview 2014 on a Win8.1)

 

The front panel of the main prog then plots and stores some data sent back by the subvi-s. The problem I face is that any front panel activity

(eg. rescaling the plot,clicking on some other option) makes the subvi stop (freeze) execution. It resumes correctly after the front panel activity is complete.

 

If I rewrite the code with exactly the same set of subvi s hardwired (not called by reference) then everything runs fine and the front panel

activity does not affect the execution

 

I am obviously doing something wrong in the "call by reference"...(but no errors are generated as far as I could trace). Could someone help?

 

I tried looking into an older thread about mouse activity freezing a call by ref, but couldn't fix the problem.

 

I am posting only the subvi which makes the call, since the front panel etc have many other stuff not relevant to the problem

Best -

Kanti

 

 

 

 

 

0 Kudos
Message 1 of 3
(2,782 Views)

Please include the subVI that you're calling by reference. Can using these two VIs replicate the issue, or do we need the whole user interface to see the issue you're describing?

The easiest way for us to help you is to replicate the problem ourselves.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 2 of 3
(2,740 Views)

Hello James Morris

 Thanks for your reply.

   here's a complete set  of vi-s that reproduce the problem.

 There are two top level vi s you can run (all the other vis must be in the same directory)

 

1. FrontPanelTestWithCallByRef.vi

2. FrontPanelTestWithDirectSubviCall.vi

 

 Each of these two vi has two parallel loops:

 

In the call by ref example(1):

One loop calls a sequence of data-acquistion vi (here time.vi & sinewtplusphi.vi) and builds a row of  data which is stored as a global variable.

This loop runs for 1000 iterations in this example. The TakeOneDataPoint.vi is where the call by reference is actually made.

 

The second (while) loop just prints the most recent data on the front panel. (In reality this will be an xy graph)

 

  During the execution if the user goes to the file menu and clicks the mouse (for example) then the front panel update halts.

 In fact the execution of the TakeOneDataPoint.vi  also gets halted and this can be seen by keeping its front panel open.

 

 In the direct call to sub vi example (2):

The same set of vi (time.vi & sinewtplusphi.vi) are called directly. The front panel activity does not interfere with the execution.

 

I have tried substituting the call by ref with a long "case structure"  driven by user inpit, and that works fine too, nothing freezes

 if I rescale the graph or do some other front panel mouse click. This version is not included here.

 

A secondary point is that the call by ref  takes a lot  longer to execute 1000 iterations compared to the direct call or

even a long case structure method. But the labview documentation seems to suggest that the overhead of using a

call by reference is not much compared to a direct (hardwired) subvi call.

 

I must be missing some very basic point on call by reference!

Best -

Kanti

0 Kudos
Message 3 of 3
(2,717 Views)