Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Early processing (SDIS via CP) blocks records completely #126

Closed
ralphlange opened this issue Sep 15, 2021 · 3 comments
Closed

Early processing (SDIS via CP) blocks records completely #126

ralphlange opened this issue Sep 15, 2021 · 3 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@ralphlange
Copy link
Member

Reported by @bkuner:

Description
Early processing of an input record (e.g., by an SDIS link that is CP) leaves the record with PACT=1, which effectively blocks it until the next reboot.

To Reproduce

  1. Setup server
  2. Create IOC database with records that have SDIS links using CP
  3. Start IOC.
    Records are processed by scanOnce early (before the first processing by the OPC UA support)
  4. All affected records have PACT=1 and don't get processed anymore

Expected
Early processing should be ignored. Definitely such processing should be synchronous and PACT may not be set if there was no OPC UA request sent out.

Debug Output

## EPICS R3.15.6
## EPICS Base built Aug  7 2019
############################################################################
OPC UA Client Device Support 0.9.2 (v0.9.2-0-g1b09f6e-dirty); using Unified Automation
 C++ Client SDK v1.6.3-406
PAHX:Ctrl:rdLlRfPwrRflLineIn parsing info items
PAHX:Ctrl:rdLlRfPwrRflLineIn parsing inp/out link 'PAHXCTRL ns=2;s=S7-1.DB_CtrlSsaAll.RdLLRF_PowLineInRev'
PAHX:Ctrl:rdLlRfPwrRflLineIn : session=PAHXctrl ns=2 id(s)=S7-1.DB_CtrlSsaAll.RdLLRF_PowLineInRev sampling=-1 qsize=1 cqsize=3 discard=old registered=n timestamp=server output=n monitor=y bini=read
PAHX:Ctrl:rdSsaPwrOutFrw parsing info items
PAHX:Ctrl:rdSsaPwrOutFrw parsing inp/out link 'PAHXCTRL ns=2;s=S7-1.DB_CtrlSsaAll.RdLLRF_SsaPowOutFor'
PAHX:Ctrl:rdSsaPwrOutFrw : session=PAHXctrl ns=2 id(s)=S7-1.DB_CtrlSsaAll.RdLLRF_SsaPowOutFor sampling=-1 qsize=1 cqsize=3 discard=old registered=n timestamp=server output=n monitor=y bini=read
...
OPC UA: Autoconnecting sessions
Session PAHXcre: (disconnect) already disconnected (Disconnected)
Session PAHXcre: (setupClientSecurityInfo) setting up PKI provider
Session PAHXcre: (setupClientSecurityInfo) no client certificate configured
Session PAHXcre: (setupSecurity) no security configured 
scanOnce: Process PAHX:Ctrl:rdLlRfPwrRflLineIn
scanOnce: Process PAHX:Ctrl:rdSsaPwrOutFrw
OPC UA session PAHXcre: connection status changed from Disconnected to Connected
OPC UA session PAHXcre: connected as 'Anonymous' (sec-mode: None; sec-policy: None)
OPC UA session PAHXcre: WARNING - this session uses *** NO SECURITY ***
Session PAHXcre: (updateNamespaceMap) namespace array with 5 elements read; updating index map with 0 entries
Session PAHXcre: triggering initial read for all 0 items
Session PAHXcre: connect service succeeded
Element [ROOT] set event (connectionLoss) for record PAHX:Ctrl:rdLlRfPwrRflLineIn (queue use 1/3)
Registering record PAHX:Ctrl:rdLlRfPwrRflLineIn for processing (connectionLoss)
Element [ROOT] set event (connectionLoss) for record PAHX:Ctrl:rdSsaPwrOutFrw (queue use 1/3)
Registering record PAHX:Ctrl:rdSsaPwrOutFrw for processingcbLow: Active PAHX:Ctrl:rdLlRfPwrRflLineIn (connectionLoss)
cbLow: Active PAHX:Ctrl:rdSsaPwrOutFrw

Setup:

  • OPCUA Support: 0.9.2
  • Platform: Debian
  • EPICS Base: 3.15.6
  • Client library: UA SDK 1.6.3
  • Server: Softing UaGate
@ralphlange ralphlange self-assigned this Sep 15, 2021
@ralphlange ralphlange added the bug Something isn't working label Sep 15, 2021
@ralphlange ralphlange added this to the 0.10 pre-release milestone Sep 15, 2021
@ralphlange
Copy link
Member Author

I can reproduce the behavior on an up-to-date system (Debian Testing, Base 7.0.6, master branch of OPC UA) against the UA Demo Server.

If a record has SDIS as a CP link, it gets PACT=1 and is blocked.

epics> dbpr OPC:DSS:bibool 1
AMSG:               ASG :               BKPT: 00            COSV: NO_ALARM      
DESC:               DISA: 0             DISP: 0             DISS: NO_ALARM      
DISV: 1             DTYP: OPCUA         EVNT:               FLNK: CONSTANT      
INP : INST_IO @SUB1 ns=2;s=Demo.Static.Scalar.Boolean       MASK: 0             
NAME: OPC:DSS:bibool                    NAMSG:              ONAM: true          
OSV : NO_ALARM      PACT: 1             PHAS: 0             PINI: NO            
PRIO: LOW           PUTF: 0             RPRO: 0             RVAL: 0             
SCAN: I/O Intr      SDIS: CA_LINK OPC:DSS:disable CP NMS    SEVR: INVALID       
SIML: CONSTANT      SIMM: NO            SIOL: CONSTANT      SSCN: <nil>         
STAT: UDF           SVAL: 0             TPRO: 0             TSE : -2            
TSEL: CONSTANT      UDF : 1             UDFS: INVALID       VAL : 0             
ZNAM: false         ZSV : NO_ALARM      

@ralphlange
Copy link
Member Author

Note:
Making the SDIS link CA instead of CP avoids the issue, and the record continues normally.

@ralphlange
Copy link
Member Author

Records are still wrongly processed and find the queue empty:

OPC UA: Autoconnecting sessions
Element [ROOT] set event (connectionLoss) for record PAHX:Cre:rdCurS1Drv (queue use 1/3)
Registering record PAHX:Cre:rdCurS1Drv for processing (connectionLoss)
cbLow: Process PAHX:Cre:rdCurS1Drv
PAHX:Cre:rdCurS1Drv: (client time 2021-09-17 12:00:33.364236080) connectionLoss --- remaining queue 0/3
PAHX:Cre:rdCurS1Drv: read (state=down, reason=connectionLoss, status=2, setVal=n) -> RVAL=0 (0000000000)
scanOnce: Process PAHX:Cre:rdCurS1Drv
PAHX:Cre:rdCurS1Drv : incoming data queue empty
PAHX:Cre:rdCurS1Drv: read (state=down, reason=connectionLoss, status=2, setVal=n) -> RVAL=0 (0000000000)
PAHX:Cre:rdCurS1M1 : incoming data queue empty
PAHX:Cre:rdCurS1M10 : incoming data queue empty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant