Skip to content

Fix the input parameter types accepted by the Ethernet IP PLC block for PLC reads/writes#2061

Open
shntu wants to merge 8 commits intomainfrom
sb/fix-plc-block-tags
Open

Fix the input parameter types accepted by the Ethernet IP PLC block for PLC reads/writes#2061
shntu wants to merge 8 commits intomainfrom
sb/fix-plc-block-tags

Conversation

@shntu
Copy link
Contributor

@shntu shntu commented Mar 2, 2026

What does this PR do?

This PR fixes a mismatch in the input types accepted by the tags_to_write function - tags_to_read needs a LIST_OF_VALUES_KIND since it specifies a list of keys for which values need to be read.

For tags_to_write we need to use a DICTIONARY_KIND since these are key/value pairs that need to be written.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

Testing

  • I have tested this change locally
  • I have added/updated tests for this change

Test details:

I included a set of unit tests that check the behavior of this block against a mocked server - also tested the code against a local development server.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code where necessary, particularly in hard-to-understand areas
  • My changes generate no new warnings or errors
  • I have updated the documentation accordingly (if applicable)

Additional Context

Currently, this block allows users to read from a PLC properly, but the tag writing functionality does not work when a workflow output step is used because of a mismatch in the expected type.


tags_to_write: Union[
Dict[str, Union[int, float, str]],
WorkflowParameterSelector(kind=[LIST_OF_VALUES_KIND]),
Copy link
Contributor Author

@shntu shntu Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LIST_OF_VALUES_KIND is incorrect here - when writing, we want a dictionary to match the Dict[str, Union[int, float, str]] in the previous line

tags_to_read: Union[
List[str], WorkflowParameterSelector(kind=[LIST_OF_VALUES_KIND])
List[str],
Selector(kind=[LIST_OF_VALUES_KIND]),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This block also does not include support for the regular Selector

@shntu shntu changed the title Fix the input blocks accepted for PLC writes Fix the input parameter types accepted by the Ethernet IP PLC block for PLC reads/writes Mar 2, 2026
@shntu shntu marked this pull request as ready for review March 2, 2026 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant