Skip to content

feat:unravel vector for dnp3/modbus#18

Open
Astarry wants to merge 1 commit into
patsec:mainfrom
Astarry:3phase
Open

feat:unravel vector for dnp3/modbus#18
Astarry wants to merge 1 commit into
patsec:mainfrom
Astarry:3phase

Conversation

@Astarry
Copy link
Copy Markdown
Contributor

@Astarry Astarry commented May 13, 2026

This lets the ot-sim device handle 3 phase vector subscriptions from Helics. The MR cracks open the list and publishes the values individually. It assumes the tags on the dnp3 side will be named with the suffix "_{index}"

Comment thread src/python/otsim/io/io.py
points.append({'tag': tag, 'value': float(v), 'ts': 0})
if isinstance(v, list):
for i, x in enumerate(v):
points.append({'tag': f'{tag}_{i}', 'value': float(x), 'ts': 0})
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is it assumed that the tags are 1-indexed, so these should be tag_1, tag_2, and tag_3, essentially matching the phase #?

Copy link
Copy Markdown
Contributor Author

@Astarry Astarry May 13, 2026

Choose a reason for hiding this comment

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

It is essentially whatever meaning the user assigns to the items in the list. Currently three phase+pyDss/opendss puts out a vector with 4 values, 3 phases+neutral, some other simulator could put out neutral, A, B, C, D. I think indexing from 0 is simpler (with associated ot-sim app changes), but I can switch to indexing from 1. I have confirmed functionality with a manual injection of ot-sim config.xml file with 3 phases.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Makes sense, probably best to just leave it 0-indexed and let the user assign more specific meaning instead of assuming.

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.

2 participants