Resolving System.InvalidCastException Regional Settings Errors in Process Historian Hardware Advisor
In Siemens Process Historian planning, running the PH_HW_Advisor_2020 utility (v1.0) resulting in error 'System.InvalidCastException: Casting the string '' to type 'Double' is invalid. ---> System.FormatException: The input string was not in the correct format' is caused by incompatible Microsoft Windows Regional Format settings. The hardware advisor's .NET calculation engine hardcodes floating-point parsing using periods (.) as decimal separators. When the host operating system uses regional formats with commas as decimal separators (e.g., German, French, Italian), string-to-double casting fails. To resolve, open Windows Control Panel -> Region, set the Format to 'English (United States)', verify the decimal symbol is a period (.), and re-launch the advisor.
Table of Contents
- Executive Summary
- Architecture and Fundamental Mechanics
- Step-by-Step Implementation Procedure
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
Executive Summary
Sizing server hardware for SIMATIC Process Historian 2020 requires evaluating process tag rates, alarm frequencies, and retention periods. To assist system integrators, Siemens provides the standalone planning tool PH_HW_Advisor_2020. However, when launching the tool on workstations configured with non-US regional settings, the application crashes immediately upon entering calculation screens, throwing a .NET System.InvalidCastException. Because the error appears as an unhandled programming crash, engineers assume the tool executable is corrupted. This technical article diagnoses the .NET culture parsing flaw and outlines the exact Windows configuration steps to restore full tool functionality.
Architecture and Fundamental Mechanics
The calculation architecture of the Process Historian Hardware Advisor relies on Microsoft .NET Framework string conversion:
1. The .NET CultureInfo Parsing Bottleneck:
- Sizing algorithms require computing storage throughput based on tags per second, disk IOPS, and SQL Server RAID configurations.
- In the tool's compiled bytecode, user inputs (such as cyclic logging rates, e.g., 0.5 seconds or 2.5 MB/s) are converted to double-precision floating-point numbers using standard Convert.ToDouble(string) or Double.Parse(string) without passing an explicit invariant culture (CultureInfo.InvariantCulture).
2. The Regional Settings Conflict:
- In Windows operating systems configured for European regions (e.g., Germany, France, Austria, Italy), the default decimal separator is a comma (,), and the digit grouping symbol is a period (.).
- When the advisor reads an internal default configuration string containing a period (e.g., "1.0") or an empty string, the localized .NET parser fails to recognize the period as a decimal point, throwing System.FormatException wrapped inside System.InvalidCastException.
3. The English (United States) Invariant Fix:
- Switching the Windows Regional Format to English (United States) aligns the operating system's number format with the tool's parsing assumptions, allowing calculations to execute seamlessly.
Step-by-Step Implementation Procedure
-
Terminate Crashed PH_HW_Advisor_2020 Processes:
a. If the error dialog is active, click 'Quit' or close the application window.
b. Open Windows Task Manager: confirm that no orphanedPH_HW_Advisor_2020.exeprocesses remain in memory. -
Open Windows Regional Format Settings:
a. On the engineering workstation, pressWindows Key + R, typeintl.cpl, and press Enter.
b. The Region configuration window opens.
c. In the 'Formats' tab, locate the Format drop-down menu. -
Switch Regional Format to English (United States):
a. From the Format drop-down list, select English (United States).
b. Click the Additional settings... button at the bottom of the tab.
c. In the 'Customize Format' dialog, verify:- Decimal symbol: must be a period (
.) - Digit grouping symbol: must be a comma (
,)
d. Click Apply and OK.
- Decimal symbol: must be a period (
-
Re-launch PH_HW_Advisor_2020:
a. Right-clickPH_HW_Advisor_2020.exeand select 'Run as administrator'.
b. Navigate through the sizing tabs: enter the number of WinCC OS servers, total cyclic tags, and required archiving duration (e.g., 5 years).
c. Confirm that the tool calculates disk capacity, IOPS, and recommended server models (e.g., SIMATIC IPC847E) without exceptions. -
Restore Original Regional Settings (Optional Post-Sizing):
a. Once hardware sizing reports are generated and exported to PDF/Excel, you can revert Windows Regional Format to your local preference if required for other engineering tools.
Verification
- Launch
PH_HW_Advisor_2020: verify the main calculation window opens without throwing .NET runtime exceptions. - Enter floating-point numbers into input fields (e.g., 2.5): verify the application accepts input and updates results dynamically.
- Export the recommended server hardware specification report: confirm report generates completely with recommended RAID configurations.
Limitations and Operational Precautions
The PH Hardware Advisor provides planning estimates based on standard process dynamics. Always validate final server hardware specifications against site-specific network topologies and Siemens catalog recommendations.
Engineer FAQ
What causes System.InvalidCastException in PH_HW_Advisor_2020?
Incompatible Windows Regional Format settings where the decimal separator is configured as a comma instead of a period.
What Windows regional setting is required to run the tool?
The format must be set to English (United States) with a period (.) as the decimal separator.
Does changing Windows regional settings affect installed PCS 7 software?
No. English (United States) is the recommended and primary tested operating language for SIMATIC PCS 7 engineering tools.
What does the PH_HW_Advisor tool calculate?
It calculates required disk storage capacity, SQL Server IOPS, RAM, and recommended IPC server configurations for Process Historian.
Where can I download the PH Hardware Advisor?
From Siemens Industry Online Support under Entry ID 109740115.
Technical References
- Siemens Industry Online Support Entry 109740115 (Process Historian Hardware Advisor)
- SIMATIC Process Control System PCS 7 Process Historian System Manual
- Microsoft .NET Framework CultureInfo and NumberFormat Documentation
Related Articles
- Archiving PCS 7 V8.2 Process Tags to Process Historian 2014 Compatibility and Licensing
- Troubleshooting Process Historian 2020 Inactive State and Database Creation Failure on IPC847E
- Diagnosing Process Historian 2020 SP2 UPD1 DatabaseInstallationWizard Failure on IPC847E
Related Tags
- Process Historian
- PH HW Advisor
- Regional Settings
- InvalidCastException
- .NET Framework
- Hardware Sizing