The operator sees weather values in a browser, but the same values do not yet appear on the Ignition screen. Start at the display and trace the data path backward: component binding, tag value, HTTP response, and finally the weather-station web server. The device exposes both an autogenerated webpage and an API. Use the API as the primary interface; scrape the webpage only when the API does not provide the required field.
What Is the Ignition Screen Telling You?
Separate a display problem from an acquisition problem before changing the HTTP logic. Read the displayed value, its bound tag, and the tag's quality or diagnostic state. A correct tag value with a wrong or blank display points to the component binding or formatting. A stale or empty tag moves the check upstream to the acquisition script.
| Reading | Location | Meaning | Next check |
|---|---|---|---|
| Wrong display, correct tag | Ignition screen and tag browser | The tag is right; the binding is wrong. | Inspect the component's tag path, data type, and formatting. |
| Stale tag | Tag browser | The acquisition path stopped updating or repeatedly receives old source data. | Read the last HTTP result and source timestamp, if supplied. |
| Empty or bad tag | Tag browser | The request, parser, conversion, or tag write failed. | Capture the raw HTTP response before parsing it. |
| Correct display and tag | Screen and tag browser | The complete path works for that field. | Repeat the test for every required weather value. |
A browser refresh every few seconds does not prove that Ignition is reading the source. The browser and Ignition are separate clients. Each must request data from the weather-station web server and process the returned payload.
Does the Device Offer an API or Only HTML?
The device in this installation offers an API as well as a prepackaged webpage. Choose the API. An API returns data for software consumption, while an HTML page returns a document for browser presentation. Reading and extracting values from HTML is called web scraping.
| Configuration | Source location | Effect |
|---|---|---|
| Request the API | Device API endpoint | Provides structured fields, preferably JSON, with less dependence on page layout. |
| Scrape the webpage | Autogenerated HTML page | Requires text or HTML parsing and can break when labels, markup, or layout change. |
Both configurations can work, but the API is the resolving branch because the device already supplies it. Reserve scraping for a value that exists only in the rendered page. If the API can be modified, return a JSON object whose field names and data types remain stable.
Do not confuse the page's visible refresh with the API interface. A page may contain the values directly in its HTML, or it may load an empty layout and request the values afterward. A plain HTTP client retrieves the server response; it does not act like a browser or execute page JavaScript. The raw response identifies which case applies.
Can Ignition Retrieve the Endpoint?
Use system.net.httpGet to request the local page or API and receive the response as a string. Examples for this function exist for Ignition 7.9 and 8.x. Test retrieval independently from parsing and tag writes so each failure has one boundary.
- Enter the same endpoint address from an Ignition host that can reach the weather-station device.
- Call
system.net.httpGetand record the returned string in a temporary diagnostic location. - Compare the returned content with the current value shown by the device's webpage or API response.
- If no useful payload returns, test the address and network path from the machine where the script actually executes. A browser working on an operator workstation does not prove that another Ignition host can reach the device.
A successful transport test returns the expected payload repeatedly. An error or empty response keeps the fault below the parser: address selection, network reachability, server availability, or request requirements. A valid document without weather values means the selected webpage is only a presentation shell; switch to the API or identify the page's underlying data request.
Does the Response Contain Stable Data Fields?
Inspect the raw payload before writing extraction logic. For JSON, identify each required field, its nesting, data type, units, and missing-value behavior. Decode the JSON, select the field by name, validate it, convert it to the intended tag type, and only then write it to the tag.
For HTML scraping, locate values by stable semantic markers rather than character positions. Fixed offsets and line numbers fail when whitespace, labels, or markup change. Also distinguish a missing field from a legitimate zero; treating both as the same value can create a convincing but false operator display.
| Payload observation | Meaning | Action |
|---|---|---|
| Named JSON fields contain current values | The API is suitable for acquisition. | Map fields to typed Ignition tags. |
| HTML contains values directly | Server-side HTML can be scraped. | Extract by stable labels or elements and monitor parser failures. |
| HTML contains layout but no values | The browser probably obtains data through another request. | Use the documented API endpoint instead of parsing the shell. |
| Fields appear intermittently | The source or parser has a missing-data case. | Reject incomplete samples and retain an explicit bad or stale state. |
| Text cannot convert to the tag type | The field, units, or conversion rule is wrong. | Log the raw field and correct the mapping before writing. |
Where Should Polling, Parsing, and Tag Writes Live?
Run acquisition in one central background context rather than from every screen. Screen-driven requests stop when the view closes and multiply traffic when several clients open the same display. A central script requests one sample, parses it once, and publishes typed values to tags. Screens then bind only to those tags.
A conventional PLC driver is not the acquisition interface for this path. The HTTP client communicates with the weather-station web server, the parser maps the response, and the tag layer exposes the results to visualization. Keep these boundaries visible in diagnostics:
| Setting | Location | Effect |
|---|---|---|
| Endpoint address | Central acquisition configuration | Selects the API or webpage source. |
| Polling interval | Central background script | Controls request rate; choose it from the station's actual update behavior rather than the browser animation alone. |
| Field mapping | Parser | Connects source field names to typed tags. |
| Last successful update | Diagnostic tag or status record | Distinguishes a current sample from a retained old value. |
| Raw-response capture | Temporary diagnostics | Separates transport faults from parsing faults. |
| Component binding | Ignition screen | Displays the published tag without initiating another HTTP request. |
How Do You Implement and Verify the Resolving Branch?
- Select the device's API endpoint and request it with
system.net.httpGet. - Capture one raw response and verify that it contains every weather value required by the screen.
- Decode the structured response, extract each field by name, validate its presence, and convert it to the destination tag's data type.
- Write the complete valid sample to the weather tags. Do not replace a good sample with partial or unparseable data.
- Record the last successful acquisition separately so a retained value can be identified as stale.
- Bind each screen component to the corresponding tag and remove request logic from the screen.
- Compare the API payload, parsed value, tag value, and displayed value during the same source update.
- Stop or disconnect the source briefly in a controlled test and confirm that diagnostics expose the failed update rather than presenting the retained value as current.
- Restore communication and verify that a new API sample reaches the raw response, parser, tag, and screen in that order.
FAQ
What happens if Ignition retrieves the webpage but no weather values appear?
The response may contain only the page layout while browser code performs a separate data request. Inspect the raw response, then use the device's API endpoint when the required fields are absent.
What happens if the webpage layout changes?
An HTML scraper can lose its markers or extract the wrong text even though the page still looks correct. Use the JSON API where possible; otherwise validate every extracted field before writing tags.
What happens if the tag is correct but the Ignition screen is wrong?
Inspect the component's tag path, type conversion, and display formatting. Final verification is a four-point comparison of the current API field, parsed value, tag value, and displayed value during one source update.