Trigger a Web Request
- Last UpdatedAug 27, 2024
- 2 minute read
The WEBSVC Communication Driver supports both automatic and trigger-based polling
Automatic (Time-based) Polling
The WEBSVC Communication Driver supports automatic polling to trigger a data request, where a polling period can be configured. Different topics can be polled at different rates from a PLC by defining multiple device group names for the same PLC and setting a different update interval for each device group. Set the Update interval polling period to a number (in milli-seconds). The WEBSVC Communication Driver automatically requests the data from the web service on the period cycle.
The polling period should be set greater than the test response time. This ensures that the runtime collects data from the driver after a trigger.
When a test is performed, the reply test duration is displayed The reply test duration indicates the time taken to complete the requested operation. The Update Interval of a topic can be tuned based on the reply test duration.
Trigger-based (On Demand) Polling
The trigger-based (on demand) polling allows the web service to trigger the request on command. To perform trigger-based polling, set the update interval time to zero to prevent automatic polling. To force the web service to perform an update, set the "$op$ww.get.run" reference to True. Upon the execution of the operation, the web service will reset the parameter to False.
If a configuration change, such as a configuring the topic update interval, is made when the WEBSVC Communication Driver is running, it is highly recommended to perform a reset on the corresponding hierarchy.
-
Trigger-Based Polling for SOAP Connection: Triggering or Auto-Poll can be applied to any SOAP method, because it cannot be determined if the method is writing or reading from the web service.
-
Trigger-Based Polling for REST Connection: Triggering is required for POST, PUT, and DELETE. Triggering or Auto-Poll can be applied to GET.
Note: It is not recommended to mix topics with Trigger-based polling (zero update interval) and the topics with Time-based polling (non-zero update interval). If using Trigger-based polling, set all topics to zero.