In Mervis IDE, dynamic parameters allow you to query the system for real-time diagnostic information.
The dynamic parameter stats.communication.proxy.status is used to retrieve the current connection state of the communication proxy.
You can retrieve this status using the dynpar.trygetdynamicparamint function in your ST program:
program main var result : dint; strParam : string; end_var strParam := "stats.communication.proxy.status"; dynpar.trygetdynamicparamint(strParam, value => result); end_program
The result variable will return one of the following integer values representing the proxy's current state:
| Value | Status Definition |
|---|---|
| 0 | Disabled |
| 1 | NotUsed |
| 2 | Idle |
| 3 | Connected |
| 4 | Unauthorized |
| 5 | NotAvailable |
| 6 | FailedToConnect |
| 7 | HostNotFound |
| 8 | Connecting |
| 9 | PageNotFound |
| 10 | DbError |
| 11 | SslError |
| 12 | NoData |