Jump to content
GregSands

Default array element for Malleable VIs

Recommended Posts

Does anyone know of a way to create a single (default) element of an arbitrary-dimension array?  I'm trying to create some Malleable VIs which have the same code for 1D-3D arrays, but have different code for floating-point vs integer arrays.  A second possible use in Malleable VIs would be to Initialize a new array based on an input array.

Any thoughts from anyone?

Share this post


Link to post
Share on other sites

Oh, very nice!  I'd not wanted to use Reshape Array because of the memory re-allocation, but I didn't think of using it in a Diagram Disable Structure.

:beer_mug: if I ever meet you in person...

 

  • Like 1

Share this post


Link to post
Share on other sites

So this gets a little more interesting with the output type of the DDS:

DiagramDisable.png

1.Following directly with a VIM causes the output to back-propagate from the VIM's default input type. 

2.This does not happen if the Types Must Match is used directly, even though this is essentially the contents of the VIM.

3. Wrapping a sequence around either the DDS or the VIM causes the type to be defined correctly.

4. Putting the DDS inside its own VIM also solves the problem, but only if there is also a sequence wrapping the DDS inside - if not, then the output type from the DDS VIM is always its own default output type.

In any case, here's the Default Element VIM (saved for 2012) for any who might use it.

Default Element.vim

 

Share this post


Link to post
Share on other sites
On 6/27/2018 at 5:14 PM, GregSands said:

So this gets a little more interesting with the output type of the DDS:

...

In any case, here's the Default Element VIM (saved for 2012) for any who might use it.

Default Element.vim

 

This turned out to be surprisingly easy to fix. The fix will be included with LV 2018 SP1.

The problem is that there are a very few nodes in LV that reach downstream to get their types when they think it is safe to do so as a way of giving better default types for terminals. But when the downstream terminal is something polymorphic, that has to be limited or disallowed. I never knew about that feature of LV (though I've unconsciously taken advantage of it many times, it turns out). I just needed to add a downstream malleable VI to the disallowed list so that the malleable is always driven by upstream instead of driving upstream.

  • Like 2

Share this post


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.


×
×
  • Create New...

Important Information

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