LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

scroll bar for two different dimension arrays

Solved!
Go to solution

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

0 Kudos
Message 1 of 5
(3,558 Views)

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.

 

2D-1D.PNG

 

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.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

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

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.

 

 

2D-1D B.PNG

 

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.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

Message 3 of 5
(3,541 Views)
Solution
Accepted by topic author KevMi

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.

Richard






Message 4 of 5
(3,530 Views)

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

0 Kudos
Message 5 of 5
(3,500 Views)