03-28-2019 07:16 AM - edited 03-28-2019 07:44 AM
Hi
I am new to Labview. In my simple project, I need to change some indices of an array.
For example, the input array is all-zero array of size of 10. I want to change value of its 0, 3, 6 and 9 entry to 5. Thus at the output we have [5, 0, 0, 5, 0, 0, 5, 0, 0, 5].
To set new values to specific indices of the input array, ‘Replace Array Subset’ module is used as seen in the figure above.
Index port of this module requires value of type I32. My problem is how to change the existing type of double to I32.
The Project file (in version 2017) is attached.
Could you pls help me?
Regards
03-28-2019 09:20 AM
03-28-2019 10:22 AM
Have you noticed that LabVIEW color-codes numbers, and codes scalars and arrays by the width and appearance of the wires? You can change a Dbl constant of 3 to an I32 constant of 3 (which will change it from Orange to Dark Blue) by right-clicking the Constant and choosing "Representation" from the Drop-down Diagram. You can choose Dbl, various sizes (bits) of Integers, signed (Ixx) and unsigned (Uxx), and a few others. Note that when you create a numeric Control or Indicator on the Front Panel, by default you'll get a Dbl (which will be Orange on the Block Diagram), but you can also use the right-click/Representation method to change them to, say, I32 (which will also change the Block Diagram representation to Dark Blue.
Bob Schor
03-29-2019 01:44 AM