From 11:00 PM CDT Friday, Nov 8 - 2:30 PM CDT Saturday, Nov 9, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From 11:00 PM CDT Friday, Nov 8 - 2:30 PM CDT Saturday, Nov 9, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
08-13-2012 11:32 AM
Hi all,
I would like some advice/help programming my application 🙂
I currently have a LabVIEW Listbox that displays all of my data. I have a 2D array of data and each record has a corresponding numeric integer. This numeric integer holds some status bits to give information about the record (I use the number to Boolean array function). Therefore, I have a 2D array of Data and 1D array of Status numerics.
Bit1: Is the record deleted? (if yes, it doesn’t show up)
Bit2: Is the record selected? (if yes, the background for that row is a different colour)
Bit3: Is the record a search hit? (if yes, change to bold)
I have an event driven state machine and written all the code to allow the user to interact with the table and change these status bits. All of the manipulation is performed on my status array and then I update my table to reflect the status array.
The next step is to launch a new window allowing the user to specify filter parameters that looks something like this:
I need the Search button to interact with the table in my main application and update it in real time while this window is still open.
The term “Dismiss” on the control button means to close the search window pop up.
The term “Search/Dismiss” means to perform the search and close the search window pop up straight away.
I currently call my search as a subVI with the front panel enabled in one of my states and pass it the array of data and the array of status numerics. I manipulate the status bits and then once you click dismiss, the status’ gets passed back to the main application and I update my table. This is not what I want/need.
To have them running in parallel, I was thinking about using the Start Asynchronous Call Node to launch my Search VI. Then creating a variable of my status array which I can monitor from my main application. If any of the records status changes, update my main applications front panel to reflect the change.
I was also wondering If I could I pass a reference to my message handler queue to my subVI? If I could do that, when I click search, I could perform all of the functionality for the search within my main application. I think the difficulty be passing back all of my search parameters.
I hope I have explained well enough.
To summarise, I need the Search button to interact with the table in my main application and update while this window is still open.
Does anybody have any ideas?
08-13-2012 11:46 AM
Sounds like your Table should really be a GERM (GUI Element Resource Module)
When you need your GUI to be updated from anywhere in an application its time to talk about GUI Handelers (Ben had a very nice nugget about this and there are examples)
Although there are several ways to get the job done they all involve one basic component- use an action engine that is responsible for updating user information rather than the GUI itself.
08-14-2012 04:27 AM
Hey Jeff,
Thanks for the input. I have been looking at the GERM and it looks good. However, in my main application, I have an event case for a double click on my Multicolumn ListBox.
I would need to be able to add a message onto my queue in the main application if a row is double clicked. I can't see how I would do this with a GERM.
If I have understood correctly, a GERM is great when you want to use indicator for display throught your application but not interact with it?
What do you think?
Lewis
08-14-2012 07:17 AM
08-14-2012 08:48 AM
Hi Jeff,
Thanks for the suggestion but I'm not to sure on how to implement it?
The GERM is just an FGV right so I can't put a event structure in there to capture a double click on my Multicolumn Listbox because it will block executing while it waits for a click.
If I could get it to run in parallel, I could have an event case and then use the "Generate User Event" function to send a message back to the main application?
If I did that though, any time I call the GERM it wouldn't run because it was stuck in the event structure?
I'm confused
Thanks again, your help is appreciated
08-14-2012 03:00 PM
The GERM implementation is a AE with a FP object (Or group of objects) loaded into a subpanel of a Main vi. This implementation allows the user to directly interact with a GUI element in a sub-vi
08-14-2012 04:50 PM - edited 08-14-2012 04:52 PM
I personally would use either user events or a message queue to pass data back to the UI. Define your messages appropriately to pass the necessary data and then fire the event or post to the queue. I would not use an AE for this since that would require polling. I prefer event driven systems which are accomplished using the ueser events or queues. If you only need to worry about the latest message you could also use a notifier.
If you are using LV 2012 then an even better option would be to use actor framework. A google search will show you earlier versions of the actor framework that can be used in earlier versions of LV.
08-14-2012 08:08 PM
Drat,(Well, maybe "Huzzah!:) Perhaps, I really DO need to generate an example. Not that I can not but, I need source too work work to make it salient.
Lewis, can you aid me with some sample source code (My e-mail is in my profile)
Let's "Get=R=done" in a manner approachable to non-LabVIEW ers.
08-16-2012 06:19 AM
Hey Guys,
Thank you both for you help. My program is doing what I want but I'm not sure how elegant it is.
In the main application I Asynchronously call my pop up window and pass it a reference to a user event I created:
Then In my pop up window, I generate a user event when the user clicks search. This invokes my message generator in my top level VI which in turn, controls my state machine to do all of the logic:
If not sure whether it is good or bad, but to pass the Search criteria around I use the Flatten to String and Unflatten from string. I guess this is ok providing I use TypeDefs which I have.
What do you guys think?
Thanks again for your help.
08-16-2012 07:49 AM