From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
05-30-2014 05:00 AM
Ever programmed something and then been surprised it works? This was the first time for me. Wrote a bit of code with the intention of identifying the array index clicked from the mouse position for use in a 'mouse down?' event and it worked first time. Then I went back and realised I had been half asleep and it doesn't even use the mouse position- but as if by magic it works! 🙂
VI snippet below. For some reason LabVIEW modifies the array reference when I create a snippet, so you'll need to change that array reference for one pointing to array 2. <= Anyone able to raise a CAR against this?
05-30-2014 06:37 AM
The Array Element property must return the reference to the "ativated" element. Quite useful in this situation. But you actually also need to add in the Index Value just in case the index is not set to 0.
05-30-2014 11:16 AM
In the past I've used this VI. I think it is quite similar to yours and I could probably simplify based on what you have done. One thing my VI does is it tries to take into account the scrollbar size if one is being shown for the array.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
06-16-2014 10:55 AM
Hi ToeCutter,
This would be expected behaviour as the 'ArrElem' refers to the active element of the array and hence you ar egetting the bounds and position of this active element on the front panel.
Thanks and Regards,
08-31-2014 11:03 AM
Good and simple.
Take care of the label position and size, it can change the position of the control.
12-12-2014 10:55 AM
Exactly what I needed. I have an indicator (array) with 500 indicators showing high level test results ( red/yellow/green ). Detailed data set displayed based on last indicator selected. Had done this previously with an overlaid transparent boolean control but only with 25 locations.
Initially started by using the mouse position and array position but I could not get it to work ( windows 8/LV2013 ). The reported array position is offset from the actual array position (as reported by mouse). Not using vert/horz scroll bars. Error is not small, it's off by a considerable amount ( 1/2 array size ). Also, array posiiton varies based on label position. Didn'tt understand why that was occurring so i started looking through the forums for clues. That's when I found your solution.
Thank you.