LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to scan for changes on my computer screen

Solved!
Go to solution

Hello,

 

Looking for a way in labview to watch my screen.

 

I have a program running (vibration test program) that I would like to monitor.

 

Whenever the display on this program shows "ABORTED", I would like labview to catch that and send me an email.

 

I know how to send emails with labview, but I can't figure out how labview can continously scan this programs display and look for that "ABORT" sign to come up.

 

Under normal condition, the program says "RUNNING", but when an error occurs, it says "ABORTED".

Is it possible program something in labview to watch for this change?

0 Kudos
Message 1 of 8
(3,851 Views)

Is the program that is running (that throws up the "Aborted" display) a LabVIEW Program that you can modify?  Or are you talking about running an independent program and having a "silent" LabVIEW program monitoring the screen looking for a pattern of pixels to be illuminated?

 

If the latter, it may be very difficult.  If I had to do something like this, I'd be tempted to try setting up a Web Cam that watched the screen in question, hooking it up to a second computer running a LabVIEW "Vision" routine that did the screen monitoring and Image processing, but it still would present a challenge.

 

Note that the first scenario (where LabVIEW is running the entire show, and you can alter the LabVIEW code) is a fairly simple task.

 

Bob Schor

0 Kudos
Message 2 of 8
(3,839 Views)

Thanks for the suggestion.

 

Its another application thats running.

Its not a pixel change really. The text would just change from "RUNNING" to "ABORTED" thats what i want to scan for. if the text changes to "ABORTED"

0 Kudos
Message 3 of 8
(3,832 Views)
Solution
Accepted by topic author Bpatel

Hi bpatel,

 

when you search this forum you will find routines to make screenshots - it's a cheap way to get the (whole) screen content and probably easier to reach then a webcam with a VISION license.

 

Once you got the screenshot you can easily detect changes of parts of this image, just get the image (aka 2D array) subset and check for changes by comparing with previous screenshot…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 8
(3,820 Views)

Maybe it is not that difficult...

You can use .NET to capture your screen at certain positions, check this example:

https://decibel.ni.com/content/docs/DOC-37135

The harder part is to do some kind of image processing. Since you have only two different words, this should not be a big problem. Either using the OCR ( http://www.ni.com/example/30591/en/ ), or you could alternatively try to develop your own algorithm to do something similar. Like ratio between dark and light pixels should be different for the two words... If you do not have licence for Vision, you could also try some open source application which you can call from command line using LabVIEW (or accessing via a plugin, see below). One good example is a ImageJ... 

http://www.imagejvi.org/index.php/about-image-j-vi.html

Good luck!

 

0 Kudos
Message 5 of 8
(3,814 Views)

Ok, the second part of my post is just too overcomplicated, see GerdW previous post how to do it, it is much more simple:

 

"Once you got the screenshot you can easily detect changes of parts of this image, just get the image (aka 2D array) subset and check for changes by comparing with previous screenshot…"

0 Kudos
Message 6 of 8
(3,809 Views)


Does this application have the option to write to a log file?  It might be easier to scan a log file than to watch a screen.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 7 of 8
(3,807 Views)

For me, I would capture the screen image and then run it through OCR. This would rely on you knowing the exact position of the text to be viewed.

 

The OCR part is easy - just use the NI Vision toolkit - though it is a terrible OCR compared to some like Adobe offers.  For something simple like this it will work fine.

 

As for capturing the screen image, it looks like someone has an example:  https://decibel.ni.com/content/docs/DOC-19720

0 Kudos
Message 8 of 8
(3,805 Views)