LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I make a ring not cycle from last to first element?

When operating a ring (or enum) using the increment and decrement buttons, going down from the last element returns to the first element, and vice versa. I'm using a ring to represent different measurements, by name, and when reviewing the data after a scan, it would be nice to get to the end of the ring and know that I'm done because I can't advance any more. (this is how a listbox works). Since you can't see that you're at the end of a ring, this cycling is confusing.

 

I thought of using the value change event to determine if we transitioned from last to first value, and then setting the value back. This might work for an event handled in the main VI (with a possible flash of the ring between states), but I can't think of how it would work if I were to develop an actor to handle this behavior, unless that actor also sends a value change event that the main VI can react to. Feels like there's a better way.

 

A mouse down event on the buttons could be evaluated and discarded... if there were a way to determine if the mouse click landed on an inc/dec button, but I can't see how to do that yet.

_____________
Creator of the BundleMagic plugin for LabVIEW!
0 Kudos
Message 1 of 4
(82 Views)

I suggest making an XControl.

0 Kudos
Message 2 of 4
(50 Views)

Interesting, as changing "Data entry" of enum/ring control doesn't prevent this from happening.

 

It sounded definitely easier than it is, unless I'm missing something too. But if you really need a solution, I could suggest:

- Marking the last item in enum... as last. I know, it's not solving the challenge, but human could read that and it would be less confusing then increment button suddenly not working, right?

- A non-scaling solution would be to analyze Mouse Down?'s coordinates to determine whether it was on the buttons - even if you open the enum's list, it doesn't overlap with them.

- A more interesting approach, though harder to implement outside of XControl, would be using these two event types together. When increment/decrement buttons are pressed, they generate Value Change event right after Mouse Down event (non-filtering). These are the first two events in the arrays. It is not possible to select value from the list as fast, as it's disabled for a fraction of a second. List click and selection are third and fourth event in the arrays. It's up to you to check how these times change in your application.

Value change and mouse down time difference.png

0 Kudos
Message 3 of 4
(39 Views)

Just hide the increment/decrement buttons and make your own, then look for value change events on the buttons and decide what to write to the ring.

 

Maybe a ring is not the right control for this. How about a multicolumn listbox to just the experiments, for example?

0 Kudos
Message 4 of 4
(28 Views)