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

Allow for max record length checks #221

Closed klauer closed 3 years ago

klauer commented 4 years ago

Not all facilities have this configured, but LCLS apparently does. We're limited to 60 chars for record names, and attempts to load something longer can create issues during dbLoadRecords.

Considering an environment variable setting as it's site-specific (and so that the parameter doesn't have to be passed around everywhere).

klauer commented 3 years ago

I think I may have been wrong here, but either no one knew better to correct it or it was shrugged off:

https://github.com/slac-epics/epics-base/blob/275d8604b08af9bcf37b595f712165b269fe3554/modules/libcom/src/misc/dbDefs.h#L57-L60

/*Process Variable Name Size */
/* PVNAME_STRINGSZ includes the nil terminator */
#define PVNAME_STRINGSZ 61
#define PVNAME_SZ (PVNAME_STRINGSZ - 1)

This is the source of the 60 character (61 with null terminator) limit on database record names. It is an upstream constant that we can use as a default, at least, for these checks.