pcdshub / pytmc

Generate EPICS IOCs and records from TwinCAT projects - along with many TwinCAT project tools
https://pcdshub.github.io/pytmc/
Other
10 stars 11 forks source link

Pragma enhancement: "scale" key #261

Closed klauer closed 3 years ago

klauer commented 3 years ago

Request

Ability to scale integer (or floating point) values from the PLC on the EPICS side in a consistent way.

"scale" key

e.g.,

scale: 1.234
offset: 10.0

Presence of a scale key on a record normally generated as longin would then create an ai record instead.

Alternative: calc key

e.g., calc: 2 * value + 1.54

Maybe consider a calc field which may allow generic calculations by way of an auto-generated calc record. This could then allow for easy slope, offset, and perhaps even references to other symbols. (That last part is iffy, though)

cc @slacAWallace