LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

populate updatable drop down list based on files in the folder path

The simplest way I can think of is to use an event structure, so that when the value of "Folder Name" changes it will trigger an event to populate the file selection dropdown.

Message 11 of 17
(1,549 Views)

Thank you, I manage to do this using the event structure, the response of the toggle switch inside the while loop becomes very slow, any idea why? event 1.JPG

event 2.JPG 

0 Kudos
Message 12 of 17
(1,545 Views)

Show us the code and not pictures and we'll tell you.  You wouldn't take screenshots of notepad would you?  For the same reason post the VIs, or Snippets which are executable code embedded in the image.

0 Kudos
Message 13 of 17
(1,535 Views)

I attached the code below, the two toggle switch is linked together, when the program is running, try to turn off the TO Static button, it should pop-up a message, but it takes looooong time. Thank you bro. 

0 Kudos
Message 14 of 17
(1,531 Views)

That is because you are waiting literally forever for an event in your event structure to be initiated.  Data Flow 101: a loop cannot iterate until everything in it has completed.  Your buttons should have their own event case and you should move all of the related code into that event case.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 15 of 17
(1,527 Views)

Hi Xiao,

 

your event structure is blocking the loop from iterating.

So the buttons will be checked very seldomly…

 

Some notes on your VI:

- THINK DATAFLOW!

- Reduce the local variable usage. (A lot!)

- There are race conditions…

- There is a lot of Rube-Goldberg in your code…

- Why do you need to calc "BoolValue OR NOT(BoolValue)"? Do you know the result of this operation???

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 16 of 17
(1,525 Views)

I think the easiest way is to replace the path constant with path control, leave the rest of code as it is, it will solve the problem, and it works fine. 

0 Kudos
Message 17 of 17
(1,498 Views)