JCOP FWWG 23 Mar 2021

→ Europe/Zurich

JCOP FWWG Meeting, 23 March 2021

Participants: P.Golonka, B.Farnham, J.Arroyo, C.Gaspar, C.Vazquez Velez, F.Glege, F.Varela, G.Thomas, J.M.Pablo Rodriguez, M.Suder, M.Lechman, M.Ludwig, O.Pinazza, P.Bond, P.G.Verdini, P.Nikiel, R.Jimenez, R-P.Silvola, S.Schlenker, V.Falaleev, W.Karimeh

INDICO: https://indico.cern.ch/event/1014352/

 

Main topic:

Mapping of OPC UA status codes to DPE bits in WinCC OA

Presentation is attached to the indico event:
https://indico.cern.ch/event/1014352/attachments/2214064/3747923/OPC-UA%20status%20codes%20in%20wccoa.pdf

 

The document describing the mechanisms for the OPC-UA is at https://readthedocs.web.cern.ch/display/ICKB/OPC-UA+Item+Status+in+WCCOA+dpes

Ben presented a demo setup to experiment with OPC-UA status codes.
A package containing a test project and  the OPC-UA Server, for Linux, may be downloaded from
https://cernbox.cern.ch/index.php/s/rEOhdjxt8rDmUFI

Additional background information

  • WinCC OA "internal" status bits for the "_original" DPE config, with their position in the status word and meaning, as extracted from the WinCC OA help: https://indico.cern.ch/event/1014352/attachments/2214064/3747918/_original-config.pdf
  • In particular, the discussion was focusing on the bit 6, called "_aut_inv", which is used by WinCC OA drivers to flag "bad" values (see the PDF above for more)
  • Clarification: the complete 64-bit wide "_status64" in WinCC OA is made of 24 "internal" bits (such as the _aut_inv above) and 32 user bits
  • In particular, the discussion involved user bits 1 and 2 which OPC-DA used to store the quality information
  • The complete 64 bits (24 internal, 32 user, 8 reserved) are archived for every value
  • The OPC-UA specification predefines the values of some of  status codes ; this is available (thanks to Stefan!) at http://www.opcfoundation.org/UA/schemas/1.04/StatusCode.csv ; the complete phase-space for status code is 2^32 though.

 

Proposal of Ben: for the OPC-UA, we should only use the _aut_inv bit (which in the PARA modue is indicated as "D") to obtain the information about the quality of a particular value. Mapping of individual OPC status codes to WinCC OA user bits may not be optimal for this purpose.

  • PGV: would it be possible to have access to the test project and the OPC-UA server used by Ben? It would be quite interesting for tests: in particular, the use case is to monitor the aliveness of CAEN devices. The link will be added to minutes.
  • PNikiel: there are other interesting settings in WinCC OA, which could be enabled by the config file. For instance, the mechanism that propagates the OPC connectivity of items to invalid but on DPEs. Few people seem to be aware of it!

clarified after the meeting by Cristina : this might trigger some actions if you are using the invalid bit in your code.
"In OPC DA this wasn’t happening, this is when the server stopped or was restarted there was nothing being invalidated … so if for whatever reason subdetectors on their OPC DA components  take some actions when the data is invalid, those actions will be triggered now when the UA server is stopped or restarted if this config is in use, and that might have deeper implications… so this is not something to simply recommend to add to the config file, it must be taken with care and revise the whole code.”



   setInvalidForConnLoss

   Type: uint
   Default: 0
   Range: 0 - 2

   Using this config entry, the values sent by the driver can be set invalid when a connection loss occurs. 
   Optional the timestamp can be set to the time of the connection loss. Following options are available:
   0 => Invalid bit will not be set
   1 => Invalid bit will be set (and the timestamp will be changed)
   2 => Invalid bit will be set (without changing the timestamp)


  • Cristina: a review of the code in CMS indicates that in over 90% of cases people check the user bits 1 and 2 to inspect the "goodness". Therefore the transformation required in their code should be easy - they should use the _aut_inv internal status bit instead.
    Some code also check bit 5 which OPC-DA used to signal "bad communication". Not sure if this has ever been used at all - ie. not a concern.
  • Ben clarified that the core of the problem for mapping the quality into user bits is that there are many "good" status codes that would need to be mapped explicitly. And then mapping yet more OPCUA "bad" statuses to a limited set of user bits in WinCC OA cannot be done genericly.
  • Ben explained that on the contrary, the _aut_inv bit effectively collapses all the statuses into a single bit, following the conventions of the OPC Foundation
    • During the discussion, it was asked if one should have a config file option to control which of the status codes should trigger the _aut_inv bit; common agreement that this would be against the OPCUA specs, hence probably not useful
  • CMS has a temporary configuration which makes use of the status-code mapping as presented by Ben, to map the OPC-UA status code 0x00000000 ("vanilla good") to user bits 1 and 2, to provide compatibility with what OPC-DA was doing. This is based on the observation that the JCOP OPCUA Servers only present the "vanilla good" and other values have not been observed so far.
    If interested in keeping this compatibility mechanism going, it should be maintained. In the discussion that follows it seems that this will not be kept.
  • PGolonka asked about the mechanism on the OPC Server side that sets the status codes. Is it fully under control of the programmer? The programmer - at least when using Quasar - may flag any status code he wants (which was used for the test server). However, as there are some functions that are called for the new value (transformations, etc?), the OPC-UA layer might potentially change the code. Hence we may get, for instance, status codes for "good" values that are different even though the programmer emmitted the "vanilla good" (0x0), etc. Hence, in most generic case, we should be ready to accept any status code.
  • PNikiel clarified that in ATLAS there are around 25 OPC UA Servers nowadays, and out of many, many status codes for "bad" only a few are used
    SSchlenker forwarded the list of standardized status codes from OPC Foundation (see at the top of this document)
    ATLAS's experience shows that these status codes are NOT USEFUL for SCADA. ATLAS relies now only on the _aut_inv bit now in WinCC OA. To debug problem further, other tools are employed anyway by experts (eg. OPC Explorer)
  • FVR enforced this opinion by stating that one should distinguish use cases for operation and troubleshooting, and employ adequate tools. The Good/Bad should be sufficient for supervisory layer.
  • Raul points out that they do have a use case of a-posteriori analysis, in which they retrieve the statuses from the archive database.
    It was clarified, that both the user bits (1 and 2) and the internal bits (_auth_inv) are sent as a 64-bit number to archive, hence the transition would be to change the bit-mask in the query to look at the _auth_inv now.
  • SSchlenker pointed out that indeed, by not having OPC Status codes transferred to user bits one might not get very detailed information from the archive, for every DPE.
    However, the information on statuses could usually be retrieved from other OPC Items (eg. reflecting the diagnostic info of the OPC Server itself) and these could be archived and used in the analysis.
  • PGolonka pointed out that setting the user bits 1 and 2 by the server could probably be used to assure that the valid values were sent by the OPC Server, rather than, eg, set by the PARA module by mistake. Still, this information is availabe separately - we see the manager type and ID for every value, and it is archived. Hence, not really needed.
  • The discussion got into the detail of which of the "invalid bits" should be interpretted, and the conclusion was that the _aut_inv (internal bit number 6) should be used

To wrap up the discussion, PiotrG suggested to endorse the proposal of Ben, ie. for the DPEs that use OPC-UA addressing one should use the _aut_inv bit rather than user bits 1 and 2. There was no objection. The final approval will follow a short discussion at the JCOP CB.

Question raised about topics for the next FWWGs - Fernando pointed out a few that were internally discussed at the JCOP CB.

There was no AOB.

 

There are minutes attached to this event. Show them.
The agenda of this meeting is empty