12-15-2010 07:29 AM
Hi everyone,
I am making an application for thermocouples. Application is working otherwise fine, but I can't make two different dimension arrays scrolled with one scroll bar. I attached here a picture to make it a little easier to understand. In picture you can see that there are two arrays. Upper one is 1-dimensional including channel names. Lower one is an array including measured temperatures and times. Scrolling vertically works fine as only the lower array needs to be scrolled. But if I want to scroll horizontally, I also need to scroll the upper array so channel names and measured temperatures would correspond. This is the problem I haven't been able to solve. The lower array may "constantly" be updating (vertically)because measuring may be ongoing. I have tried to use lower arrays property nodes to control upper array (IndexValues). I found many many solutions that work with same dimension arrays, but I couldn't manage to make them work with my application. Anyone have any ideas? I am using LV 8.6
Thanks,
Mika
Solved! Go to Solution.
12-15-2010 09:00 AM
On an 2-D array indicator with a horizontal scrollbar, the scrollbar sets index #1 to 0 (if scrollbar is all the way LEFT), and increases it as you move the scrollbar rightward.
If you SHOW INDEXES on your 2-D array, you can see this.
So, if you use a PROPERTY node on the 2-D array and extract index #1 (not index #0), and set the 1-D array's INDEX #0 to match, then they will stay in synch.
If you SHOW INDEXES on both arrays, you can see that it works (hide them after you're satisfied).
The BAD news is that there is no event to tell you when the scrollbar moved. I suppose you have to poll the thing periodically, meaning it won't be as smooth as you might like.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
12-15-2010 09:10 AM - edited 12-15-2010 09:12 AM
If I were doing this (and I have before), I would abandon the scrollbar that's built-in and use some other separate control to perform the scrolling.
You can react to a VALUE CHANGE event on this other control, and set INDEX #1 of the 2-D array, and INDEX #0 of the 1-D array to the same value at the same time, and it looks much smoother.
You can keep the VERTICAL scrollbar on the 2-D array if you like, but when the HORIZONTAL scroll thing changes, read the 2-D array's INDEX #0, and set it back unchanged when you change index #1.
This results in a smoother display, because they both change at the same instant. You can set the range, and enable/disable the "scrollbar" as appropriate.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
12-15-2010 09:40 AM
Also consider using a Table, where the built-in Column Header will scroll with the data, and it's only one control for header & data.
12-16-2010 01:29 AM
I ended up using table as Broken Arrow suggested. Column header is just what I needed. I also tried the way CoastalMaineBird suggested but couldn't get it work in my application. Thanks guys! Merry Christmas!
-Mika