Jump to content

Scripting functions for malleable VIs?


Recommended Posts

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. 

Link to post
Share on other sites

I couldn't find a method for "Convert Instance VI to Standard VI" as you can from the right-click menu but it looks like if you get the VI reference from the subVI you get a reference to the instance VI so you could potentially just copy the block diagram and put it into new VI (reconnecting the terminals might take some work).

I'm not sure what the best way would be to figure out whether the subVI is a VIM. If you grab the subVI reference and try to pull the VI Path you just get <not a path> and the VI name returns some crazy UID.

  • Like 1
Link to post
Share on other sites
19 minutes ago, ShaunR said:

It does surprise me. I would have thought an entry for VI Type would have been added to the enum.

Yeah, I think the explanation given to me was that the contents of the .vim file on disk are no different than the contents of a .vi file on disk. So since it's technically not a different file type, they thought it didn't warrant a new enum entry. Kinda like how there's not a "Template VI" entry in the list since .vi and .vit are the same type on disk. I may be misremembering though so don't take this as the official answer.

Link to post
Share on other sites
51 minutes ago, the_mitten said:

Huh. Yeah, I didn't expect this. Doesn't this suppose that the user hasn't changed the displayed label text for the subVI?

It's impossible to change the label text of a subVI. That's why this works.

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 Ryan Vallieu
      I have seemingly found an issue with the shipping example code for Nested Malleable VIs.  Another user has verified that he saw the same behavior in 2019.
       
      I am working through the examples and the presentation from NIWeek 2019.  In running the Lesson 2b code (C:\Program Files (x86)\National Instruments\LabVIEW 2019\examples\Malleable VIs\Nested Malleable VIs) I found the Equals.vi in the class was not being leveraged and the search failed.  When I went to my LabVIEW 2018 machine and ran the Lesson 2b.vi the code worked to find the element by correctly leveraging the in-class Equals.vi.
      One difference I see is that in the 2018 example the Equal.vi is in the example folder with the code, and in 2019 the Equal.vi has been moved to VI.lib - otherwise the code looks to be the same.  The Equals.vi code looks identical, and the calling VIM look identical.  I posted on the LabVIEW NI.com forum here: 
      https://forums.ni.com/t5/LabVIEW/LabVIEW-2019-Malleable-VIs-Shipping-Examples-Lesson-2b-Nested/m-p/3966044/highlight/false#M1129678
       
      I am trying to determine what may have broken or changed between the implementation in 2018 and 2019, visually the code looks the same.
    • 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 snowyowl485
      Doesn't work, don't know why, please help, ev3 only
      ev3_sweeper.vi
    • By X___
      For those who have been playing with malleable VIs, the Type Specialization Structure has probably become a common sight and much abused tool.
      The basic use of it is that if the action it performs is meaningless given one of the inputs, the included code will break and the next case will be tried.
      This is great, but sometimes, it can be difficult to think of all possible variants of an action, and in particular, if the action needs to be different for two or more types, but two or more types are compatible with different codes, how to make sure which code will be executed with what type?
      Enters the Types Must Match function:

      I found this little gem in... Hidden Gems, within an odd-looking VI which I felt compelled to check out, Debug Write.vim

      Open its diagram and light will shine, opening grandiose vistas and parallel universes remaining to be explored.
      Of course, as the comment on the diagram says:
      "This structure and the type-testing primitive functions it contains are not public LabVIEW features. They are experimental and should not be edited, copied, or used in other VIs without conducting extensive testing. See Context Help for details."
      Here is the context help for Types Must Match:

       
      My apologies if this all well-known among expert users, but I couldn't find it mentioned otherwise on the site...
    • 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
×
×
  • Create New...

Important Information

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