LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

running a labview exe automatically

Hi All,
 
Can anybody help me regarding the following problem.
 
I am developing labview application to send emails.
The contents of the email is the data that is being fetched from the database as the requirement of the user.
Whenever the user clicks the button for viewing data,the data will be displayed based on the conditions he specified .
After that if he wants to send this as email he can click the button for sending mail.
 
Now i have to send the email automatically,every hour.
ie,at first i have to execute the event of view data's mose down and then the event of send mail's mouse down.
 
I think for this,i can use the getdatetime function and checvk time and make the value of view data true and then the value of send mail true.
 
But iam confused in the way to accomplish this.
I am not bothered about sending mail automatically now.But i have to atleast activate the button of getdata every hour.
 
How to accomplish this?Without openong an exe how can i run that in a particular time
 
Thanks in advance
 
 
 
0 Kudos
Message 1 of 17
(3,716 Views)
I'm not sure what you are attempting. You mention that when the user clicks a button it should send an email of the data he/she has selected from the database, but then mention automatically sending every hour. What is to be sent every hour? Is the user selected data queued based on the click on the control and then whatever has been selected in the last hour is sent? You can, as mentioned used the date/time functions to determine when the hour period has passed, and then send what ever maybe queued or in a "buffer", sending nothing if nothing has been changed. Not sure what you mean by launch an exe. What mechanisms were you planning on sending the emails with?


Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



Message 2 of 17
(3,697 Views)

Hi user_1,

      Like LV_Pro, I'm not sure exactly what's needed...

      It's possible to programmatically cause a button value-change event by writing to the button's "Value (signalling)" property.  If you're not familier with object-properties, right-click on a button and "Create"\"Property Node".  This will cause an "event" that can be detected/handled by an event-structure.  However, if I understand your application, there may be an alternative the doesn't require "simulating" this user-event - exampe is attached!

Cheers.

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
Message 3 of 17
(3,694 Views)

Hi,

Thank u for the reply.

Sorry for the confusion in my question in my previous post.

Currently i am getting data from the database by clicking getdata button.And sending email using send mail button.

I want to remove the clicking events and automatically perform tasks.

ie,want to change my application in such a way that at 9'o clock it should get the data from the database (where datetimebetween d/m/Y 08:00:00 and d/m/Y 08:59:59)

ie,if i combine the operations of getdata and sendmail together-then at 9 o clock the application should send mail to the recipient ,fetching the data from (8 to 9)

As a first step of this i have to avoid the button clicking events and automatically it should happen at each hour.

Getting data in this intervel is not an issue.

The  problem is i dont know how to activate the event programatically(have i to use timer?iam not familiar with timer.thats why i am asking this).

ie,Now if i want to getdata/send mail,i have to open my application.then give step by step instruction to getdata.

I have to modify my application in a way that Without even opening the application i want to getdata/send mail.

The complications related to sending mail i am not putting forward.

Can u pls help me by telling how can i automatically execute the event at each hour.

If i have to explain more,pls inform me.

Thanks in advance.

 

0 Kudos
Message 4 of 17
(3,688 Views)
There are two methods to do this.  You can wait or you can use an event structure.  Waiting is not desirable and will freeze your user interface if not done properly.  In this case, waiting an hour isn't really efficient.  The event structure above will allow you to "poll" for messages from the user interface and if no messages are available, it will process the time remaining for an email update.  I think this is a good method for your program.
Message 5 of 17
(3,664 Views)

Thank u so much for ur reply sir.

I am not still clear about the idea u explained.Can u explain more for me,if possoble can u give me an example.

There will not be problem in fetching data in each hour as i can specify the query edepending on the system datetime.

But my issue is i dont know how to execute the event every hour automatically(if i know how to execute the event automatically,there will not be problem in sending mail,i believe).

As a simple example can u tell me how can i display a message (say hai) every hour.i may be doing something else other than labview.But the message hai should be displayed each hour.I think if i know how to code for this,i can get a basic idea of my problem.

Thanks once again

 

0 Kudos
Message 6 of 17
(3,639 Views)
Here is a link to a DevZone article on event driven programming.

I have slightly modified the above example to light a boolean whenever an email should be sent.
0 Kudos
Message 7 of 17
(3,618 Views)

Thank u so much for your reply.

I tried the autosend option by giving my code inside the timeout event and setting time out event to be executed every 60s.

Little delay i found as now i just placed the code without modification.Nw i have to optimise the vi .Anyway little delay will be there i think as the data being fetched from database using a number of condition checkings and complex methods

If i give 1hr delay for the event structure will it create bad effect to CPU utilisation?As it has to continuously check  by switching from other process.Just for an information i am asking this.

Thanks once again for the help.

 

0 Kudos
Message 8 of 17
(3,587 Views)
Event driven architecture is designed to prevent you from using a 1 hour delay.  Using a 60 minute wait is equivalent to using an event structure with an infinite timeout and proper event handling.  However, the UI will not freeze when using the event structure.  Both will be efficient and use minimal CPU. 
0 Kudos
Message 9 of 17
(3,566 Views)
You could also just put the whole thing in a loop and set the wait to 1 hour.
0 Kudos
Message 10 of 17
(3,564 Views)