From c001ac1ea71af71e99ec19b3cd0fc56dc4acbfe6 Mon Sep 17 00:00:00 2001 From: Peter Butzhammer Date: Fri, 9 Feb 2024 14:34:16 +0100 Subject: [PATCH] Document multi variable reads --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index a80d530..e1da309 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,21 @@ Here is a table of supported data types: > Identifiers marked with * are kept for compatability reasons and might be removed in the future. +## Performance considerations + +Frequent reads of variables using `GetValue` can cause performance pressure on the S7 PLC, resulting in an increase of cycle time. + +If you frequently read variables, like polling triggers, use `CreateNotification`. Internally all variable polling initialized with `CreateNotification` is pooled to a single (or some) multi-variable-reads. + +You can provide a cycle time (delay between consecutive multi variable reads) in the `Sharp7Plc` constructor: + +```csharp +public Sharp7Plc(string ipAddress, int rackNumber, int cpuMpiAddress, int port = 102, TimeSpan? multiVarRequestCycleTime = null) +``` + +The default value for `multiVarRequestCycleTime` is 100 ms, the minimal value is 5 ms. + + ## Would you like to contribute? Yes, please!