LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating Events for Serial Comms + Database activity

Hi guys,

 

I'm writing an application that takes input from four different sources and picks whichever one is best according to a choice algorithm. The first two sources are input manually, when when a user clicks a button (no way to automate these unfortunately), the third source is from a serial comms device, and the fourth source is in an Access Database on the local network.

 

What I'd like to be able to have is an event generated when we get bytes at the port (from the serial source), and also when a new value is added to the database.

 

Is this possible?

 

 

0 Kudos
Message 1 of 3
(2,901 Views)

I dont think its possible to generate an event for these directly but you can easily do it indirectly. You must already have a code which detects if there is a serial port / database event occured. You must execute these part of the code periodically and if you detect a change you can call a custom event, or you can take care of it right at the loop where these algorithms are running.

 

If they are fast to check you can put them into the timeout case of an Event structure. 

0 Kudos
Message 2 of 3
(2,862 Views)

My suggestion is to keep the serial reading and database checking in seperate loops and then use User Events to send the latest data to your main loop that is using the event structure.



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 3 of 3
(2,846 Views)