Need some help
Moderators: Dorian (MJT support), JRL
-
- Newbie
- Posts: 5
- Joined: Tue Feb 21, 2006 3:34 pm
Need some help
Sorry for repost the same question I asked before but I really need help in doing my project.
I want to get the value which is displaying from a program and copy it into a text,for example the value 7.4(see the printscreen) that was displaying in a software.(I using a pH meter that can directly connected to computer, and the software used will display the value of the pH value), can this be done??
I am using Visual Basic 6.0, and I want to retrieve the pH value 7.4 from the text.(Since I fail to retrieve from serial port directly, so I think maybe can use MacroSchduler retrieve the value and copy to text, then I can use VB to get the value from text.) Anyone know about this?Or if got another way please tell me.
I want to get the value which is displaying from a program and copy it into a text,for example the value 7.4(see the printscreen) that was displaying in a software.(I using a pH meter that can directly connected to computer, and the software used will display the value of the pH value), can this be done??
I am using Visual Basic 6.0, and I want to retrieve the pH value 7.4 from the text.(Since I fail to retrieve from serial port directly, so I think maybe can use MacroSchduler retrieve the value and copy to text, then I can use VB to get the value from text.) Anyone know about this?Or if got another way please tell me.
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Unfortunately, this value is not text, it is a graphic. The only way I can think of doing this is using an optical character recognition approach. Two possible solutions:
1. Using the image recognition library take samples of each of the numbers displayed by this program. Extract images showing values 1 to 9. Then you can write a script that looks for each of these on the screen. When it finds a match it knows what number it found and its relative position and therefore a routine can be written to determine the number on the screen.
http://www.mjtnet.com/imagerecognition.htm
2. Download Textract:
http://www.structurise.com/textract/
Also download our wrapper DLL:
ftp://ftp.mjtnet.com/pub/doTextract.zip
See example and readme in the zip file
Textract uses OCR to scan a screen graphic and extract the text it detects. The text is extracted to a file and can then be parsed.
1. Using the image recognition library take samples of each of the numbers displayed by this program. Extract images showing values 1 to 9. Then you can write a script that looks for each of these on the screen. When it finds a match it knows what number it found and its relative position and therefore a routine can be written to determine the number on the screen.
http://www.mjtnet.com/imagerecognition.htm
2. Download Textract:
http://www.structurise.com/textract/
Also download our wrapper DLL:
ftp://ftp.mjtnet.com/pub/doTextract.zip
See example and readme in the zip file
Textract uses OCR to scan a screen graphic and extract the text it detects. The text is extracted to a file and can then be parsed.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
I researched your software a bit and was able to find (from their tech support) that Turtle writes to a file called VAL.ini. You might (only MIGHT) be able to read the INI file with:
ReadIniFile>c:\some path\VAL.ini,section,entry,Result
where you replace the values (after opening the VAL.ini to see what the setting should be) with your own values for path, section and entry.
If you send a copy of the VAL.ini file I could help you set up the ReadIniFile> code ......
ReadIniFile>c:\some path\VAL.ini,section,entry,Result
where you replace the values (after opening the VAL.ini to see what the setting should be) with your own values for path, section and entry.
If you send a copy of the VAL.ini file I could help you set up the ReadIniFile> code ......
-
- Automation Wizard
- Posts: 1101
- Joined: Fri Jan 07, 2005 5:55 pm
- Location: Somewhere else on the planet
If you do have to go the screen reading route I don't think you have do the full image recognition thing. It should be possible to decode the number by getting the pixel color from maybe 6 or 7 positions for each digit. I think this would be a lot faster. If it was a 7 segment style font then it would be very easy to do this, just grab the pixel color from the mid position of each segment. It will be a bit more of a challenge to chose the sample locations with this font, but there are probably unique pixels for several of the digits which could make the decoding easier.
-
- Newbie
- Posts: 5
- Joined: Tue Feb 21, 2006 3:34 pm
Thank you for replying me.
Actually the purpose of I retrieving the pH value is to put into Visual Basic for calculation,(eg change the pH value back to concertration value), and display in VB interface.
Can teach me how to do the checking of limited pixels use "fingerprinting"?
I will first try to retrieve the data from val.ini. If useless then I will have to try fingerprinting.
Inside val.ini I only see
[value]
pH=7.4
if like that how I read it??
Actually the purpose of I retrieving the pH value is to put into Visual Basic for calculation,(eg change the pH value back to concertration value), and display in VB interface.
Can teach me how to do the checking of limited pixels use "fingerprinting"?
I will first try to retrieve the data from val.ini. If useless then I will have to try fingerprinting.
Inside val.ini I only see
[value]
pH=7.4
if like that how I read it??
-
- Newbie
- Posts: 5
- Joined: Tue Feb 21, 2006 3:34 pm
[quote="hobbits1982"]Thank you for replying me.
Actually the purpose of I retrieving the pH value is to put into Visual Basic for calculation,(eg change the pH value back to concertration value), and display in VB interface.
Can teach me how to do the checking of limited pixels use "fingerprinting"?
I will first try to retrieve the data from val.ini. If useless then I will have to try fingerprinting.
P/S
Inside val.ini can see
[value]
pH=7.4
Actually the purpose of I retrieving the pH value is to put into Visual Basic for calculation,(eg change the pH value back to concertration value), and display in VB interface.
Can teach me how to do the checking of limited pixels use "fingerprinting"?
I will first try to retrieve the data from val.ini. If useless then I will have to try fingerprinting.
P/S
Inside val.ini can see
[value]
pH=7.4
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
ReadIniFile>c:\bla\inifile.ini,value,pH,pHP/S
Inside val.ini can see
[value]
pH=7.4
MessageModal>Value is %pH%
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
As a follow up to my previous post about using Textract to perform OCR on the screen, I have since realised that Textract offers a simpler command line interface. It is simpler to use than I previously suggested. I have provided an example on my blog:
http://www.mjtnet.com/blog/2006/06/06/s ... ical-text/
Perhaps not required after all in this context but worth remembering in future as it is an excellent way to scan the screen, or a portion of the screen, for text.
http://www.mjtnet.com/blog/2006/06/06/s ... ical-text/
Perhaps not required after all in this context but worth remembering in future as it is an excellent way to scan the screen, or a portion of the screen, for text.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?