Is there a better way to create a 1D array with n number of elements in LabVIEW?

6.4k views Asked by At

Here is what I did, anyone have a better way of doing it?

enter image description here

Do they have built-in function to do this? I just started using LabVIEW might have overlooked. Like in MATLAB its just:

    x = (0:10-1)

and in Python:

    x = range(10)
2

There are 2 answers

1
oysstu On BEST ANSWER

The easiest way to create a range, is to do as you've done - but wire the indexing terminal directly and dropping the shift register. There is no built-in way to do this. The only potential gain of that would be to use slightly less space on the diagram.

Edit: As Yair pointed out, there is a built-in way to do this in the form of the ramp pattern. That VI has much more configurability, for example choosing between divide range into N samples or by delta. It does require the full development license however (in the signal processing palette).

Range

0
Yair On

oysstu's solution is certainly good, and it's what I do in the rare cases where I actually need data like this. Another option is the ramp pattern VI which hides somewhere in the palettes and allows some more complex ranges.