From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
06-07-2017 09:02 AM
Dear all,
I have a Call Function Node with an adapt to type input that allows me to pass a cluster without taking care of the type of data contained. So far this works perfectly but I would like to place this Call Function Node inside a subVI together with some other necessary code to re-use them.
The problem is that I don't know how to connect the Call Function Node to the input subVI input and with a non-dependant datatype. Similar to void dataype in C.
I would appreciate any input on that.
Thank you!
Solved! Go to Solution.
06-07-2017 09:11 AM - edited 06-07-2017 09:13 AM
If you have LV2017, use a VIM file! 🙂
These a VI files with a different extension (.vim) and some additional requirements (they must be inlineable, re-entrant VIs). Then, any inputs you pass that don't break the code are allowed.
If not, you can try using a variant, but I don't know if/how well that would work. You can use Variant To Data without wiring a data-type, but only if the place it is connected to defines the datatype, so that probably wouldn't work. As a result, your success would depend probably on being able to directly wire the variant data.
06-07-2017 09:59 AM
Thank your quick response.
cbutcher escribió:
If you have LV2017, use a VIM file! 🙂
These a VI files with a different extension (.vim) and some additional requirements (they must be inlineable, re-entrant VIs). Then, any inputs you pass that don't break the code are allowed.
I am currently using LV2015 but I can update to LV2017 if it is the only option. I never heard of that but I will have a look.
cbutcher escribió:
If not, you can try using a variant, but I don't know if/how well that would work. You can use Variant To Data without wiring a data-type, but only if the place it is connected to defines the datatype, so that probably wouldn't work. As a result, your success would depend probably on being able to directly wire the variant data.
Using a variant was my first idea but it was almost the same, I will need to have a common point such as in the case structure output which will not work with different datatype and connect it to the Call Function Node.
Another option is to convert cluster to u8 array but it will also need to place some extra code out of the subVI because I cannot directly wire a variant to typecast function. Sending the cluster as u8 array will work for my but I neither know how to convert variant to u8 array.
06-07-2017 11:31 AM
@cgh_4 wrote:
Thank your quick response.
cbutcher escribió:
If you have LV2017, use a VIM file! 🙂
These a VI files with a different extension (.vim) and some additional requirements (they must be inlineable, re-entrant VIs). Then, any inputs you pass that don't break the code are allowed.
I am currently using LV2015 but I can update to LV2017 if it is the only option. I never heard of that but I will have a look.
It is an official new feature with 2017. Supposedly, it was a hidden feature since LabVIEW 8.5. If you look on LAVAg, there are a few threads on "VI Macro". The feature is now called a Malleable VI.
06-09-2017 08:29 AM
crossrulz escribió:
It is an official new feature with 2017. Supposedly, it was a hidden feature since LabVIEW 8.5. If you look on LAVAg, there are a few threads on "VI Macro". The feature is now called a Malleable VI.
After 1-day migration to LV 2017 (RT+FPGA+Drivers+etc.) I managed to test it and it works pretty well. Thank you.
My only concern is that this feature is not enabled in LV2015. Since I have one license not valid for 2015 version it can be a problem for me. So far I was quite happy with LV2015 while I have already faced some issues in LV2017.
06-09-2017 10:42 AM
I was lead to believe (perhaps I misunderstood) that if you try to backsave a project containing a VIM, it might (might!) work, so long as it doesn't include the Type Specialization Structure (yours probably doesn't).
So if you have a 2017 computer available to write the VIM, it might be possible to backsave it to 2015, where the Xnode implementation would be used instead. I haven't tried this, but I heard it (I think - again, maybe I misunderstood) from the creator.