Jump to content

XNode Owning Diagram


Recommended Posts

Hello,

Has anyone tried to obtain the path to the VI that called an Xnode? I've gone through most of the Xnode abilities and it seems the only one that actually provides me with the correct VI path is "OnOwnerChange", which provides me with a reference to the "Owning Diagram". I was hoping to get the path on Initialize or Drop so that I can save it into the Xnode's data. 

The main idea behind this is that I want to create an Xnode with a list of acceptable inputs. The list of acceptable inputs would be stored in a text file in the same folder as the calling VI, and the Xnode would read from that list and allow the user to pick one. The acceptable inputs would change from project to project so I can't save the text file in a generic location.

Any ideas?

Link to post
Share on other sites

You should be able to use the OwningVI property (and then VI Path/Name or similar) wired to the XNode ref in an OnDrop Ability VI. It won't work in Initialize which is called before the XNode is dropped, so the VI is not known then.  Also, no VI name/path is known if the VI is not already saved, which could be common.  You may be able to check the Library of the OwningVI for it's project/class which may be helpful.

XNodeOwningVI.png

 

XNode OwningVI.png

Edited by GregSands
  • Like 1
Link to post
Share on other sites

That's exactly what I was looking for! Thanks so much.

The weird thing is that when I wire up a Property Node to the XNode ref, it says there are no properties available. I wasn't able to copy your Property Node onto my block diagram so I wired up the XNode ref to a Property Node via a To More Generic Class. This allowed me access to all the properties and then I was able to remove the To More Generic Class without errors.  

Link to post
Share on other sites

Because the XNode features of LabVIEW require a special license by NI, these properties and methods won't be listed on the XNode, or XNode Library class, but these functions do work.  I made a post about this a while ago, and showed how to create these functions in vanilla LabVIEW if you use scripting, or use the QuickDrop function and know the name of the property or method you want.  The code I posted also can create a new VI, or place the hidden property or method in your clipboard.

 I also posted a VI with all the properties and methods that scripting can make which you can use and copy into a VI and use.

 

  • Like 2
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Similar Content

    • By Taylorh140
      Started some work on a simple C code generator for LabVIEW. 
      https://github.com/taylorh140/LabVIEWCGen
      I was working on some ideas to handle some more complex Items. Had some thought about using 
      https://github.com/rxi/vec 
      To handle strings and other arrays/vectors, I would like to pass these more complex data types by pointer. However I am looking for some ideas as to when to make a copy. I know LabVIEW has some internal item that manages this but I haven't found a way of accessing it quite yet. Let me know if you think this is worth some effort. Or if you have any ideas about the architecture that you think would be helpful.
      Also i imagine that this will still only ever support a small subset of LabVIEW, the languages are quite a bit different, and i prefer that the code be as clean as possible.
       
    • By the_mitten
      Has anyone found any properties or methods associated with malleable VIs? Specifically, I was hoping to find a way to invoke the "Convert Instance VI to Standard VI" function after confirming that a selected VI was indeed malleable. LabVIEW reports the class type of a selected malleable VI on the block diagram as a standard Sub VI, and I didn't see any properties/methods under the VI class.
       
      I'm exploring what it would look like to make a utility to convert a malleable VI into a polymorphic VI for the purpose of backwards compatibility. I'd like to have a reference library that uses malleable VIs but create a version that is still accessible to someone using older versions of LabVIEW that don't officially support malleables. 
    • By snowyowl485
      Doesn't work, don't know why, please help, ev3 only
      ev3_sweeper.vi
    • By Bira
      Hi guys! I know that it is an old topic , but I will try ! 
      My DAQ board sends to PC data in the following format.
      !voltage1[0],voltage2[0];voltage1[1],voltage2[1];voltage1[2],voltage2[2].....voltage1[n-1],voltage2[n-1]:TIMER4,TIMER5<CR>
      ! is the starting character
      and we have "," , ":"   and ";" as delimiters.
      In the end of the packet (after ":") my board sends the values of two microcontroller timers (4 and 5).
      The first data packet ends with a <CR> and my boards repeats that every 3 seconds.
       
      I need to plot voltage1[n] and voltage2[n] in two separate graphs and my time base is the value of TIMER4 / n.
       
      The real data is like showed below.
       
      !0016442034,0000727890;0016499095,0000727024;0016543605,0000724990;0016568541,0000722157;0016578803,0000719243;0016587848,0000716010:0123456789,9876543210<CR>
       
      I have used and modified altenbach's VI (https://forums.ni.com/t5/LabVIEW-Idea-Exchange/Contract-multiple-delimiters-for-quot-Spreadsheet-string-to/idc-p/1239830#M7564) but some delimiters are bothering me yet.
       
      Modified Altenbach's VI

      Case value 1 detail

      The result is:

       
       
      The VI was great to separate correctly the values of voltage1 and voltage 2 in two separate strings but I did not know how to avoid the last comma.
      Also in Timer4 and Timer5 I could not avoid the characters ":" and "," right before the numeric values.
      I would be grateful if anybody help to solve this issue or give me other tips to do what I need with that data.
      Thank you everybody in advance !
      DirtySpreadsheetStringToArrayVariable.vi
    • By slpp
      Hello,
      I am trying to build a code that will automaticly read the pressure signal (as voltage) from 8 seperated valves and will write all the data recived to an excel sheet.
      I want to ba able to change the blower speed with the indicator of the For loop. It works for the 1st. iteration (speed=0 full speed) but for the second iteration(speed=0.1) i get an error:
      Error 5001 occurred at :
      PWM Set Duty Cycle N Chans.vi >>
      Set Duty Cycle.vi >>
      Send Command.vi
      Appreciate the help,
      Sahar & Liat.
        
      activate digital ports3.vi
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.