LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

QD Shortcut - Chage To/From Array

Oh no - I was hoping to be able to avoid this ClassName-string CaseStructure-thing...

 

Would there be any issue with data types other than numeric in terms this reverting to a "standard representation"? For string possibly the different display styles or something?

0 Kudos
Message 11 of 24
(2,291 Views)

I put together a version of this plugin that shouldn't have any issues with the new item losing configuration. I apologize for the code messiness and lack of comments, I only had a little while to put this together.

 

It's saved in LabVIEW 2013. Place these files in your Quick Drop plugins directory. The default shortcut is Ctrl-J.

Download All
Message 12 of 24
(2,262 Views)

Nice one! Had trouble understanding the temporary CTL, but that's really smart stuff!

0 Kudos
Message 13 of 24
(2,239 Views)

Thanks. The smarts of the scripting code came from my colleague AristosQueue... I just massaged his code into a Quick Drop shortcut.

0 Kudos
Message 14 of 24
(2,218 Views)

Just found out that the new shortcut VI had trouble with Arrays existing TypeDefs. It can convert TypeDefs into an array no problem, but the reverse action gives an error 1154 when trying to replace the array with the array element from the newly created object in the temporary CTL... I inserted a case structure that passes the path of the TypeDef instead of the temporary CTL path whenever this function has to deal with an array of a TypeDef. Seems to do the trick.

 

Please find the llb with the modified subVI in question ("Execute Change To Array Or Element.vi") attached. Replace it with the existing "_ChangeToArraySupport.llb" in the "LabVIEW 201*\resource\dialog\QuickDrop\plugins" folder.

Message 15 of 24
(2,195 Views)

Thanks for discovering the issue and posting a fix, comrade.

0 Kudos
Message 16 of 24
(2,159 Views)

This QD shortcut stopped working in my LV2013 64bit today. I tested in x86-LV2013 - all fine.

I replaced the VIs / the LLB in my QD folder with the ones that are posted here to make sure nothing has gone wrong with my copies on the computer. Still no joy. At least I found the eventual cause: The Move method positioning the newly created array control throws an error 1055, which is an invalid object reference. As the Controls[] property yields a non-empty array (notice the "#1" from highlight mode within the property node) there could actually not be an invalid reference, as the first element is indexed and control references are never closed while LabVIEW is running, even when being told so.

 

I tried a restart of LabVIEW several times, but to no effect.

 

Has my Labview installation gone bad?

I appreciate any hints as to what to do.

Ctrl2Array_ERR1055.png

0 Kudos
Message 17 of 24
(2,010 Views)

I don't know what the problem could be. I have the shortcut saved in my [LabVIEW Data]\Quick Drop Plugins folder so that it's accessible in all of my LabVIEW installations. I tried it in several installs (including LabVIEW 2013 64-bit), and it worked fine...it converts a numeric constant to an array of numerics constant, and does the reverse as well.

0 Kudos
Message 18 of 24
(1,989 Views)

My problem does not show with constants but with controls only. And only with LV2013 64bit. Even with 64bit it worked well until yesterday.

I just tested constants back and forth and they seem to work fine, also replacing array controls with their scalar counterparts is ok. The behaviour only applies to replacing scalar controls/indicators with an array.

 

As for your answer - I am forced to conclude that my LabVIEW installation is corrupted somehow. Disturbing though this may be - I doubt I will go through the hassle of repairing or reinstalling my 64bit LabVIEW and possibly having to reinstall all drivers for them to be recognized by the new installation just for one QD shortcut.

 

Thanks for caring, Darren.

 

 

0 Kudos
Message 19 of 24
(1,960 Views)

Wow, I really have no idea. I got controls and indicators to work fine in LabVIEW 2013 64-bit. Is this reproducible for you just from dropping a numeric control in a blank VI, or can you only reproduce it with a specific control/indicator in a specific VI? And if so, can you post that VI (or a reasonable facsimile) here?

0 Kudos
Message 20 of 24
(1,944 Views)