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

Add 'pv linking' functionality shortcut: non-TwinCAT PV updates -> write to PLC #166

Closed klauer closed 4 years ago

klauer commented 4 years ago

With a channel access link via OMSL=closed_loop/DOL=OTHER:PV CPP (CA link that causes processing of the record), we can automatically couple non-TwinCAT/ads-ioc PVs to a TwinCAT PLC.

Proposing some new syntax:

pv: TWINCAT:PVNAME
link: OTHER:PV

Additional thought needs to go into how to deal with adding alarm severity information - to determine the validity of the value. A 'linked structure' provided in lcls-twincat-general could take care of it generically, but there'd have to be a structure for each type (ST_LinkedPV_Int, ST_LinkedPV_Float, etc.), I think... (thoughts, @ZLLentz @n-wbrown?)

EPICS db example from @ghalym:

``` record(ao, "$(P)G1:GCC:PMON"){ field(PINI, "1") field(TSE, -2) field(DTYP, "asynFloat64") field(DOL, "CXI:SC2:GCC:01:PMON CPP") field(OUT, "@asyn($(PORT),0,1)ADSPORT=851/MAIN.fG1PMON=") field(OMSL, "closed_loop") field(SCAN, "Passive") field(PREC, 3) } record(bo, "$(P)G1:GCC:SP1_DI"){ field(PINI, "1") field(TSE, -2) field(DTYP, "asynInt32") field(DOL, "CXI:SC2:GCC:01:SP1_DI CPP") field(OUT, "@asyn($(PORT),0,1)ADSPORT=851/MAIN.bG1SP1_DI=") field(OMSL, "closed_loop") field(SCAN, "Passive") field(ZNAM, "Zero") field(ONAM, "One") } record (ao, "$(P)G1PMON:SEVR"){ field(DOL, "$(P)G1:GCC:SP1_DI.SEVR CPP") field(OMSL,"closed_loop") field(FLNK,"$(P)G1PMON:SEVR.VAL") } record(ao, "$(P)nG1SEVR"){ field(PINI, "1") field(TSE, -2) field(DTYP, "asynInt32") field(DOL, "$(P)G1PMON:SEVR CPP") field(OUT, "@asyn($(PORT),0,1)ADSPORT=851/MAIN.nG1SEVR=") field(OMSL, "closed_loop") field(SCAN, "Passive") } ```