LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

[BUG] Unable to change single numeric constant to array on block diagram

I was working on a VI to support some legacy C code... I attempted to change a single numeric constant into an array and it failed.  LabVIEW will flash an array icon for a few ms and then it will instantly go back to a single constant. 

 

Steps to replicate:

 

  1. Create a new VI
  2. Open block diagram
  3. Place a new numeric constant (dbl) on diagram
  4. Right click -> representation -> single (sgl)
  5. Right click -> change to array

 

Tested:  

LabVIEW 2016 v16.0f2 (32 bit) on Windows 10 64bit,

LabVIEW 2017 v17.0 (32 bit) on Windows 10 64 bit

LabVIEW 2016 v16.0f2 (32 bit) on Windows 7 64 bit

0 Kudos
Message 1 of 5
(2,679 Views)

@BowenM wrote:

I was working on a VI to support some legacy C code... I attempted to change a single numeric constant into an array and it failed.  LabVIEW will flash an array icon for a few ms and then it will instantly go back to a single constant. 

 

Steps to replicate:

 

  1. Create a new VI
  2. Open block diagram
  3. Place a new numeric constant (dbl) on diagram
  4. Right click -> representation -> single (sgl)
  5. Right click -> change to array

 

Tested:  

LabVIEW 2016 v16.0f2 (32 bit) on Windows 10 64bit,

LabVIEW 2017 v17.0 (32 bit) on Windows 10 64 bit

LabVIEW 2016 v16.0f2 (32 bit) on Windows 7 64 bit


Same problem on my machine

       LabVIEW 2017 v17.0 (32 bit) on Windows 7 64 bit

 

The reverse is also a bug. If you have a SGL array constant, you can't "Change to Element"

0 Kudos
Message 2 of 5
(2,661 Views)

@BowenM wrote:
  1. Create a new VI
  2. Open block diagram
  3. Place a new numeric constant (dbl) on diagram
  4. Right click -> representation -> single (sgl)
  5. Right click -> change to array

 


Comments:

  • If you leave it as a Dbl, it works.
  • If you change it to a Sgl, then "Change to Indicator" or "Change to Control", then "Change to Array", it works.
  • If you really want an Array of Constants, you just need to do one more "Change to Constant".

Tested in LabVIEW 2016, 32-bit.  I'm not sure why Dbl works immediately and Sgl requires extra steps.  I tested several, but not all, Integer representations, and they worked.  Extended does not work.  Clusters seems to work (the Error Constant was my test example). 

 

Bob Schor

0 Kudos
Message 3 of 5
(2,655 Views)

@Bob_Schor wrote:

@BowenM wrote:
  1. Create a new VI
  2. Open block diagram
  3. Place a new numeric constant (dbl) on diagram
  4. Right click -> representation -> single (sgl)
  5. Right click -> change to array

 


Comments:

  • If you leave it as a Dbl, it works.
  • If you change it to a Sgl, then "Change to Indicator" or "Change to Control", then "Change to Array", it works.
  • If you really want an Array of Constants, you just need to do one more "Change to Constant".

Tested in LabVIEW 2016, 32-bit.  I'm not sure why Dbl works immediately and Sgl requires extra steps.  I tested several, but not all, Integer representations, and they worked.  Extended does not work.  Clusters seems to work (the Error Constant was my test example). 

 

Bob Schor


Those are my observations as well.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 5
(2,637 Views)

 

This right click menu item is actually a plugin so you can see where the error is coming from in Change Constant To Array Or Element.llb\Execute Change Constant To Array Or Element.Load Dig Num Config.vi. The VI is upset with the Display Format being entered in this specific cast [9 13] although I can't recreate the same problem by just feeding those inputs manually to the same BD items. The error produced by that property node causes the transaction to fail but this error happens after the array-scalar swap which is why you see the blinking behavior.

Matt J | National Instruments | CLA
0 Kudos
Message 5 of 5
(2,595 Views)