Added 2 parameters for S7Endpoint to Disable PLC and load Tags dynamically#148
Open
lucagem wants to merge 2 commits intost-one-io:masterfrom
Open
Added 2 parameters for S7Endpoint to Disable PLC and load Tags dynamically#148lucagem wants to merge 2 commits intost-one-io:masterfrom
lucagem wants to merge 2 commits intost-one-io:masterfrom
Conversation
- Add PLC enabled/disabled functionality via env variable - Add CSV file loading for variable definitions via variable - Add environment variable support for Port, Rack, Slot parameters - Maintain backward compatibility with existing configurations - Add comprehensive error handling and logging - Update documentation with usage examples and technical notes
5801f8c to
05b26aa
Compare
Author
|
🔄 Updated to latest master (v3.1.0) Hi maintainers! 👋 This PR has been automatically updated to be fully compatible with the latest master branch. Why this feature is valuable:
The dynamic configuration capabilities (environment variables + CSV loading) are highly requested features in industrial Node-RED deployments. Ready for review - Happy to address any feedback! 🙏 Thanks for maintaining this excellent S7 library! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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