LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Monitoring multiple timers

Hello,

 

I have a problem with room monitoring VI.I need multiple buttons with each opening a new window.The users needs to save some simple data,like number of pallets,the time it's supposed to be monitored for and let's say the type of the product.The user needs aproximately 18 buttons of these type.

 

After a button has been pressed,the new window pops up and he is able to write the time,in hours usually 24 or 48 hours,the type of the product and how many pallets there are.Now my problem comes from the fact that he needs a boolean indicator which shows him if the room the product is being placed is empty,in progress or complete.I've been able to do this with 1 room,but for multiple rooms the main VI waits for the room that was used to finish,meaning that from the main VI I can't open multiple sub VI's to use for each different room.

 

Other things I didn't get to are:

-saving the data locally to the computer for ease of access,either in a txt file or an excel file,and saving it on a remote MySQL Database

-the start button to disappear and be replaced by a visualize button,which shows what's inside the room,when it started and how much time is left.

-and the most important thing a notification when each one of the rooms is complete,through a pop-up window and if possible through an e-mail.The e-mail will be sent through Zimbra and the company's e-mail.

 

I would like some pointers on how to make it so that multiple sub VI's can run in parallel behind the main VI and monitor each sub VI.

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

Hi,

 

To clarify; you want to open a new instance of the room window each time the user clicks the button. You are probably using an in-line subvi set to dialog mode. When the user clicks the right button the main vi pauses at the subvi, waiting for the subvi to finish executing before the main vi continues.

 

I shall now use some advanced programming terms. Stop me when it becomes confusing!

 

You need your room dialog to be re-entrant and to have access to the private data specific to that room. When a dialog entry is submitted the data entered could be reported to the main vi and the main vi could store that information as appropriate. When the dialog is next opened, the main vi could pass it the relevant data, so your Boolean indicator can be set appropriately. This is simple; you have a complete set of data in one place. Ask yourself this: What happens if two operators try to modify one room at a time?

 

Alternatively you could launch all the rooms at the start and only show the front panel when the user needs to see it. In this case the data for each room could be stored in each vi. Here you don't need to pass the state to the dialog when it is launched. Furthermore you don't need to specify the number of rooms at compile time, you could add new rooms dynamically. Cool! This is complicated though; how do your vi's communicate information if they are not waiting for output terminals? You need to implement some way of communicating between all these simultaneously running vi's.

 

In either case you are talking about wanting to run subvi's asynchronously. Currently they are run synchronously; the subvi must complete before the main continues. It sounds like you want the main vi to be usable even while the subvi is running. Look into the Start Asynchronous Call node. Think about how you want the vi's to communicate.

CLA - Kudos is how we show our appreciation for comments that helped us!
Message 2 of 2
(2,304 Views)