GithubHelp home page GithubHelp logo

pcdshub / lcls-twincat-pmps Goto Github PK

View Code? Open in Web Editor NEW
2.0 5.0 7.0 9.71 MB

Photon Machine Protection System (PMPS) TwinCAT library for LCLS-II

Home Page: https://pcdshub.github.io/lcls-twincat-pmps

License: Other

pmps

lcls-twincat-pmps's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

lcls-twincat-pmps's Issues

PMPS override daily digest

There should be some mechanism to alert everyone daily that there are pmps overrides active, as per the morning tailgate today

Remove Pulse Energy

Pulse energy is not a knob we can really turn, so we'll be removing it (from pytmc)

Project that includes pmps lib does not build

image

File here:

ArbitrateBP.astAttenuators[idx].nTran := MIN(stBP1.astAttenuators[idx].nTran, stBP2.astAttenuators[idx].nTran);

References commented out property:

(*
{attribute 'pytmc' := 'pv: Att
io: i
field: EGU %
'}
nTran : UINT;
{attribute 'pytmc' := 'pv: OK
io: i
'}
xAttOK : UINT; // true = no errors and attenuator is stable
*)

Uninitialized constant is possible cause of compilation issues

An uninitialized variable found here may be causing some issues. While the code can normally be built in normal conditions, builds preempting a "login w/ change" fail. Pihl speculates that this could be a potential cause of the issue.

DUMMY_AUX_ATT_ARRAY : ARRAY [1..PMPS_GVL.AUX_ATTENUATORS] OF ST_PMPS_Attenuator;

Include a PV that lets us know when an Arbiter is vetoed

Current Behavior

No such PV

Expected Behavior

I should be able to caget a value that lets me know if an arbiter is vetoed or not.

Context / environment

Latest

Suggested Solution

  • Add a pragma'd BOOL to FB_Arbiter (and all I_LowerAuthority things)
  • Write to this pragma's BOOL from FB_VetoArbiter

BP_IO Mismatches Between Versions

BP_IO can be mismatched between versions leading to uncaught invalid structure mapping between BP_IO and BP.

BP_IO needs to carry a version number that can be used to catch mismatches.

Pressure FFO

The FB is is part of the pmps lib but will be used by the other PLCs / devices to fault on Pressure.
The FB should have as inputs Pressure threshold, hysteresys, gauge ok bit, and as inout output the FB_HardwareFFOutput.
Maybe also a veto input?

Allow bypass with no fault

I tried to activate a bypass that was not already faulted as a preventative measure, but it rejected me.

This would have been good for testing the HOMS_XRT today to set the bypasses prior to there being any faults to prevent interruptions after the initial miscommunication.

This will be more generally useful in cases where a bad fault is intermittent and clears itself quickly.

Open to discussion

Add happi/desc fields for future PMPS GUI update

  • :HAPPI pv linked to .HappiName could be used to open a relevant typhos ui straight from the diagnostic. This could be included both for FFOs and for the PVs we see in the pre-emptive request screen.
  • :DESC pv linked somewhere for the pre-emptive request screen.

I intended to add these myself today but it's a bit late so I'm at least writing them down

No request in pool evaluates to 10Hz

For some reason no request in the arbiter pool evaluates to 10Hz.

Turns out this is because the ST_BeamParams_IO struct has 10Hz as the default value.... that should be corrected going forward.

Also the arbiter should probably initialize with an elevation cycle request.

JsonToDoc - JsonDocToBP

Create a FB_JsonToDoc That will:

  1. Read a local json file (check the file is correct)
  2. Parse the file into a global PMPS.JsonDoc, that will be available to all devices to load their states BP.

Create a FB_JsonDocToBP That will:

  1. Parse the global JsonDoc object, find the device/state data and load them to the PB structrue.

BPTM changes to include beam class bit mask

When the device is requested to move, part of it's safe beam parameters include this new beam class bit mask that first evaluates if it is ok for this device to be inserted or fault accordingly.

Human readable preemptive requests

Need to modify preemptive request system to provide a device name associated with a request ID inline in the PMPS UI. This probably doesn't have to happen in the core beam parameter structure.

Refactor to transmission

Transmission (rather than attenuation) is a more natural parameter and is technically more failsafe.

PMPS Constants Checker

This might be more for LCLS General... an FB that can verify the value of a "global constant" against what another PLC has. Useful in instances with the PMPS where the arbiter and subsystem PLCs keep independent versions of these constants. Think, photon energy bitmask ranges, or full beam rate.

Temperature FFO FB

The FB is is part of the pmps lib but will be used by the other PLCs / devices to fault on temperature.
The FB should have as inputs temp threshold and hysteresys, and as inout output the FB_HardwareFFOutput.
Maybe also a veto input. if the device is retracted, then the fault should be vetoed.

Create a function block for the Solid Attenuators

Function block in the library, to copy the attenuator requests and status to and from the IO interface.
Currently, a P_SATT is running on lfe-arbiter and kfe-arbiter that includes a lot of repetitive statements for each PLC.

Fix nTran to rTran

The Transmission was an INT changed to Real.
The variable name needs to be changes. Its in the IO interface.

Can wait until enough changes are requested for the IO interface

Fix usage of lcls-twincat-general / duplicate GVL_Logger symbols

Downstream libraries which include both lcls-twincat-general and lcls-twincat-pmps result in duplicate symbols for GVL_Logger which breaks IOC generation.

Unclear as to the exact fix; this needs some research.

Duplicate symbols:

$ pytmc summary --symbols plc/plc-kfe-vac/plc-kfe-vac.tsproj  |grep GVL_Log
    GVL_Logger.TCPADS_MAXUDP_BUFFSIZE : UDINT (3072800 32)
    GVL_Logger.TCPADS_MAXUDP_BUFFSIZE : UDINT (19932800 32)
    GVL_Logger.cLogHost : STRING(15) (3072896 128)
    GVL_Logger.cLogHost : STRING(15) (19932608 128)
    GVL_Logger.fbRootLogger : LCLS_General.FB_LogMessage (3073728 26944)
    GVL_Logger.fbRootLogger : PMPS.LCLS_General.FB_LogMessage (21634560 80896)
    GVL_Logger.iLogPort : UINT (3072144 16)
    GVL_Logger.iLogPort : UINT (19932512 16)
    GVL_Logger.sIpTidbit : STRING(6) (3073024 56)
    GVL_Logger.sIpTidbit : STRING(6) (19932736 56)
    GVL_Logger.sPlcHostname : STRING(80) (3073080 648)
    GVL_Logger.sPlcHostname : STRING(80) (19952480 648)

Note that the above symbols are allocated twice on the PLC at different locations.

Short-term hack to allow this bad behavior in pytmc:

pytmc db --allow-errors ...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.