Outdoor Temperature from Internet

dripdry

Member
Join Date
May 2016
Location
Ohio
Posts
23
Good morning :site:

For the past few days, I've been struggling with getting an accurate reading of the outdoor temperature. Parking lot on either side of our building throws the temperature way off when the sun is out, even with the sensor in a white open-ended pipe 10 feet above the ground (10-15 degrees above what it actually is outside).

Boss man says just get it from the internet (yeah that easy right). So I've tried using VBS on one of our OPC Servers to pull down an xml file from OpenWeather, I can get it to get the xml file, but if I do a substring operation on it, depending on the length of that substring, everything is going to move about and it's really not the best option I don't think.

Instead of going with substring/string to float coercion on an XML file I'd figure I'd ask you fellas if you've ever done anything quite like this. Ideas, links, anything will help. Thanks guys.
 
I didn't quite get the problem of processing the XML file... Can you explain further?

I did have a problem a while back (due to incompetent and lazy IT dudes) where I have to scrape data off of a website (basic HTML) and Python proved really easy to accomplish what I needed. Would that be an option?
 
I just wondered if there was a better way, i.e. parsing the xml file into a list of xml tags, like temperature, wind direction, high temp, low temp, etc. rather than just pulling out a substring.

I don't know if there was some kind of mapping I could do between Kepserver tags and those xml tags via any scripting language or other tool.

Maybe write the weather conditions to an SQL DB and pull them out with an ODBC Client connection?
 
What is the temperature for? Do you need proper on site temperature? If so using the temperature from god knows where won't be anymore accurate than what you are getting anyways.
 
What is the temperature for? Do you need proper on site temperature? If so using the temperature from god knows where won't be anymore accurate than what you are getting anyways.

Temperature would be for opening and closing 3 vents. Depending on how cold it is outside, we will either close the vents to the outside/open the vent in the wall to the other (climate controlled) side of the plant.

Right now, like I said, my current set up is much too inaccurate. A report from NOAA from a station a few miles away from me is very accurate to the current conditions, not affected by a sunny parking lot.
 
A report from NOAA from a station a few miles away from me is very accurate to the current conditions,

You don't get fronts in Ohio? I've driven into cold fronts where the temp dropped 30 degrees, or more, in a few miles.

Do you have a vent that runs all the time where you could take measurements? Or maybe put the sensor in the shade with a fan pulling air over it?
 
You don't get fronts in Ohio? I've driven into cold fronts where the temp dropped 30 degrees, or more, in a few miles.

Do you have a vent that runs all the time where you could take measurements? Or maybe put the sensor in the shade with a fan pulling air over it?

Those would be represented in the NOAA reports. It's very close to me.

I don't have anything in the budget for this - my time is the only thing I can spend. The temperature sensor that we are currently using does need to show the parking lot temps for other equipment so I can't move it.
 
If you are using Ignition I believe there is a cloud template for this very thing.

If you are using VBS, then probably not ignition.

I am considering implementing online weather as an input to our control systems. +1 for security concerns.
 
I did exactly that earlier this year, using VB, for my ridiculously over-engineered garden watering system. I wrote a sub which you passed four parameters to: the filepath, a keyword, a pretext and a posttext. The sub would search the given file until it found a line of text with the keyword on it. Then it would extract the text between the "pretext" and the "posttext", and, assuming that text was a number, would return it as an integer. For example, if my file had a line somewhere in it like this:
Code:
blah blah ramble ramble actual temperature today 123.45 degrees blah blah
...then I would make the keyword "actual temperature", the pretext "today " and the posttext " degrees".

Works well! I think I also made a version to return it as a floating point value instead of an integer.
 
Ok so here's what I did. We unfortunately use Windows, so I had to install python and figure out how that all worked in Windows.

I made a script (in just 23 lines) that pulls down the xml file from the internet, parses it into it's constituent parts ( i.e. it gives me data.['temperature'] and I'm set with that).

Then I use pyodbc lib to shove it into a table I made on our MSSQL server.

I used MS Task Scheduler to have this run every 15 minutes. Besides just temperature, I'm getting other stuff to that might be helpful to some parts of QC - which is also cool. Like air pressure (dissolved gasses in product) and humidity (many factors there).

Then I use the ODBC Channel setting in Kepserver (query SELECT TOP 1 * FROM WeatherT ORDER BY Time_Stamp DESC to pull the top record from the table) which does a lot of work for me. Then from there I'm free to push that data anywhere on the shop floor, too.

Thanks for the suggestions fellas.
 

Similar Topics

I have a pair of outdoor uninsulated water silos that need to be maintained at or above 145°F. Both are supplied by the same source, which...
Replies
7
Views
1,672
Was wondering what is everyone using for outdoor rated OIT/Panel View covers? OIT is mounted on a panel. Shade would be preferred as the panel is...
Replies
2
Views
1,176
I need a small HMI or numerical keypad to communicate with a Click PLC to enter a 4 digit number. It'll be mounted outside but under a canopy and...
Replies
3
Views
1,817
Just wanted to see if anyone has any experience with an outdoor HIM/HMI with a window (see example on website here) Outdoor VFD HIM example? We...
Replies
4
Views
1,736
A little OT but there will be a PLC in some of these... :) I'm looking for insulated instrumentation cabinets for summer and winter, freeze to...
Replies
13
Views
2,349
Back
Top Bottom