LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Current index to an Array

I don't know how to get the current index to an array. I wrote a temp vi (attached file) to show my problem. Eventually the output of the array will go to the serial port.
0 Kudos
Message 1 of 6
(3,145 Views)
Schmir1,
In your program you have a 0 wired to the index array terminal and so you are always displaying the element at index 0. When you change increment or decrement the array index you are only changing the display on the frontpanel, the entire array is still present there and so it will still display the index 0 element.
As I understand from your program you are trying to pass individual hex values to the serial port. You will have to wire different values to the index terminal of the index array function during each run to pass individual value.
I modified your application for easier understanding.

Hope this helps,
Pravin
0 Kudos
Message 2 of 6
(3,145 Views)
check out the attachment.
hope that helps

tc phan
Message 3 of 6
(3,145 Views)
Works great (no sure how that index array hooked to IndexVal returns the current index but that's OK). I've got one last problem. How to you put values into the array and have them remain in the array when you close the vi and open it up again?
0 Kudos
Message 4 of 6
(3,145 Views)
that's easy schmir1. After enter all the values, choose "Make Current Values Default" from the "Operate" pulldown. Right clicking the mouse(with the arrow pointed on the object) and sliding to "Data Operations" will do too but to the object only.
Don't forget to save your vi.

tc phan
0 Kudos
Message 5 of 6
(3,145 Views)
Works great. Thanks for you help.
0 Kudos
Message 6 of 6
(3,145 Views)