LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Create SubVI - using property nodes - object reference invalid

Hi,

 

Using the Edit > Create Sub VI function, I highlight some property nodes(charts, buttons from the UI) and the code is turned into a subvi. Labview then automatically converts the inputs/outputs of the subvi to a bunch of refnums. I had originally wanted to change the chart refnum input to a graph, and was not able to do that. I tried the following: 

 

  1.         On UI, right click and select server VI class from Waveform chart to be Waveform graph > Waveform graph
  2.         Prior to updating property nodes, go to UI and right click and select “Include data type”. Changes from waveform graph to waveform graph (strict)
  3.         Update property nodes
  4.         Check inputs to the subvi
  5.         Waveform graph should have datawire mismatch
  6. 6.                Right click UI in subvi, go to “select ctrl type” and change to control
  7.         Waveform graph is type cast into proper refnum
  8. Create VI server node and ensure waveform graph is replaced in place of waveform chart
  9. Note: could not create server input type – Created VI server and automatically converted into subvi – then copied UI to subsequent automatically created subVI

I'm not sure how do change an input and if this is the right method. I tried looking up how to use refnums but couldn't find any good resources - if anyone may be able to provide some background on using them (I found this: http://www.ni.com/white-paper/3929/en but not really quite what I was looking for).

 

When I run the code, the error message "object reference invalid" is shown. I have wired the input terminal with a waveformgraph from the UI though, and also checked the information with a probe to check that the input isn't 0. 

 

Any help would be appreciated!

0 Kudos
Message 1 of 3
(3,496 Views)

I'm having one of my dense days, I don't understand the steps you went through. Could you just post the code that you got in the end?

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 3
(3,492 Views)

Hi,

 

Here is the code. I had converted the waveform graph back into a chart input, but for unknown reason I'm still having the same problem.  Sorry for the mess that the snippets are in. The problem I'm having is with the "waveformchart in" input parameter, where it says that the object wiring is invalid even though there are no errors that prevent me from running the program (so I guess it's a run-time error).  The waveform chart is wired to the UI so it seems to be a proper reference.

 

Another way to put this is: when creating a subvi that includes property nodes from the user interface, how do I change the input/output parameters of the subvi? I changed the waveform chart to waveform graph (and back) but after wiring the input parameter, Labview provides me with a run-time error. 

 

Thanks!

0 Kudos
Message 3 of 3
(3,485 Views)