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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Cluster of Arrays/Auto Update String Values - BUG - Need Method to Fix

System: Windows 10, 64bit, LV2018

 

Problem (See attached gif), Screenshot of code snippets

 

I have what I call an "Action Engine" that provides a simple UI to create cycle sequences for a number of devices (steppers, relays, solenoids, etc.)

 

There are "Device" field and "Action" fields involved in this front end procedure.

 

When the user selects the device, I parse a list of actions related to that device and write the array of strings to the dropdown selector (so that they don't have the option to select the wrong action for that device - in this case, it would just go to the default for that device.

 

I'm about 60% there - when moving linearly through the sequence programming (step 1, step 2, etc.), it works just fine. I'm using an event structure to update the fields on the user 'Mouse Down' and 'Value Change' events. I grab the coordinates (after a bunch of searching I actually found this method and modded to my needs - sorry, couldn't relocate to throw creds) then parse the list based on alphabetical characters, build the new array, and write it to the action control dropdown. -- See code snippet.

 

The problem happens when the user wants to change an "action" out of order. The array of strings from the last selected device appears. (It actually then populates with the correct values and displays the second time the user clicks it, but that's not good enough for retail) I've tried various things including 'on hover' and such. Please help. Thanks.

 

(PS: I understand why it doesn't work - the action dropdown is populated with the array of strings from the last selected device. Just now sure how to fix it....?)

 

"Fix it" - Populate the dropdown with the correct device actions before it displays, not after the second time the user clicks.

 

0 Kudos
Message 1 of 2
(1,739 Views)

Yes.  We always like to help someone debug a partial screenshot of a block diagram rather than an actual VI.  Especially one that has a funky pink color as a background!

 

I suspect this from what little bit we see.  You are triggering off a Mouse Down event.  Why not mouse up?  Or what is most commonly used, a value change.

 

I suspect that the event for mouse down executes really quickly, and you are into the next iteration of the while loop before any code had a chance to run to recognize the change of the drop down value, which would be a value change event that probably occurs after mouse up.

 

Change your event to Value Change and see if it works better.

0 Kudos
Message 2 of 2
(1,685 Views)