LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass occurrences into a subvi

Hello,
Does anyone know how to pass occurrences into a subvi?
I've got the "generate occurrence" in my main vi and want to wire this into a subvi where the "set occurrence" gets triggered. However I tried to use indicators to connect the front panel of the sub vi but it didn't work.
So how can I pass the "occurrence data" into a sub vi?
Thanks a bunch,

Georg
0 Kudos
Message 1 of 6
(3,157 Views)
Go to Front Panal>>Refnum>>Occurance Refnum and drop the occurance refnum CONTROL onto your front panel of the subVI. Make sure its a CONTROL and not an INDICATOR. Select this control and wire up your connector pane. You can now pass the generate occurance refnum from your main VI to your sub VI.

Robert
Message 2 of 6
(3,157 Views)
Thanks a bunce, I figured it out!
0 Kudos
Message 3 of 6
(3,157 Views)

Hi,

 

I need to resurrect this thread...

 

I am also trying to pass an occurrence refnum to a subVI (using 2011) and I can't quite get it.  I understand I pass an Occurrence refnum to the subVI but the reference in the subVI is generic and doesn't know it's an Occurrence. 

 

My background: rookie and new to refnums ...

 

Below represents what I've done.  On the left is RefMain.vi (generates occurrence) and on the right is RefSub.vi (uses occurrence).  

 

  1. Created Occurrence in RefMain block diagram
  2. Created "control" from Occurrence in RefMain (right click > create > control)
  3. Created reference in RefMain, "RefNum" (right click on control > create > reference and dropped it on RefMain block diagram)
  4. Dragged RefNum to front panel of RefSub (I read how to do this in other NI document)
  5. Tried to use RefNum in RefSub block diagram (invoke node, "method for refnum class"), but I only see generic properties and methods and nothing specific to an Occurrence (e.g., Wait on Occurrence)

I tried type casts but I'm just flailing about.  Lots of googling but couldn't make headway.   I eventually will use with FPGA (I understand it needs to be a static reference)

 

Any tips?  

 

Steve

 

 

occref.png

0 Kudos
Message 4 of 6
(2,690 Views)

You don't want to pass around a reference of the occurance.  You want to pass the occurance itself.  It is already a reference anyways.  So what you created in step 2 is what you want to use as an input to your subVIs.

 

EDIT:  Your VI would look something like this

 

Also, you can just place the Occurence refnum straight onto the front panel.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Download All
0 Kudos
Message 5 of 6
(2,686 Views)

That works.

 

Unfortunately, the biggest obstacle prior I think was the simple fact that my popup control selector wasn't displaying refnum's.  I had to change the configuration so that all options are displayed.  The selector itself should make it obvious that there are options not being displayed.

 

Thanks!

 

Steve

0 Kudos
Message 6 of 6
(2,655 Views)