Added 2 parameters for S7Endpoint to Disable PLC and load Tags dynamically #148
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Added dynamic endpoint configuration
✨ New Features
S7 Endpoint Configuration Interface
The image above shows the enhanced S7 endpoint configuration interface with numbered references to the new and modified features:
1. Address Field (Existing)
Standard IP address configuration for the PLC connection. This field was already functional and no modifications were made.
10.0.0.102${S7_IP}${YOUR_PORT_VAR}2. Port Field (Enhanced)
Enhanced with environment variable support:
102${S7_PORT}${YOUR_PORT_VAR}3. Rack Field (Enhanced)
Enhanced with environment variable support:
0${S7_RACK}${YOUR_RACK_VAR}4. Slot Field (Enhanced)
Enhanced with environment variable support:
2${S7_SLOT}${YOUR_SLOT_VAR}5. PLC Enabled Field (NEW)
New field for dynamic PLC enable/disable:
true: PLC enabled (default behavior)falseor0: PLC disabled${S7_ENABLE}: Environment variable${YOUR_ENABLE_VAR}When PLC is disabled:
6. CSV File Path Field (NEW)
New field for external variable configuration:
C:\config\s7_tags.csv./config/tags.csv${S7_CSV_FILE}${YOUR_CSV_VAR}Dynamic Configuration Management
CSV File Loading
The CSV file allows loading the variable list from an external file instead of the node configuration. This facilitates:
CSV file format:
The CSV file takes priority over internal configuration. If the file doesn't exist or is empty, the node configuration is used.
Environment Variables Benefits
Using environment variables for fields 1-6 allows configuring different environments (development, test, production) using the same flow but with different connection parameters.
Technical Notes