OPC DA to OPC UA pipeline: “uncertain” tags are becoming “BAD”

Forum Home Forums Communicating with Devices OPC OPC DA to OPC UA pipeline: “uncertain” tags are becoming “BAD”

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #17422
    _FIreDemon_
    Participant

    I was trying to use Rapid-Scada Communicator to transfer tags from OPC DA server (Yokogawa Exaopc) to Linux client machine via OPC UA protocol. Everything works fine for tags with “GOOD” quality, however, tags with “uncertain” quality are transferred as “BAD” quality with now value in them. More strangely, I can write in these tags from Linux client with no errors but the quality will remain “BAD”.

    #17423
    _FIreDemon_
    Participant
    #17424
    _FIreDemon_
    Participant

    Sorry, don’t know why the images were not properly loaded, here is the link on imgur:
    Images

    #17426
    Mikhail
    Moderator

    Hello,
    The OPC Classic driver requires GOOD quality to display data as valid. Otherwise, it marks the tag as undefined. Undefined tags are provided to OPC UA with BAD quality.

    #17430
    _FIreDemon_
    Participant

    Thank you for your answer, Mikhail. Is there any way to bypass this?

    #17435
    Mikhail
    Moderator

    I suppose, it’s better to fix the OPC server to get GOOD values.
    Alternatively, you can change the source code of the driver to solve this certain issue for your needs. There is no plan to change the driver for all users, because “uncertain” means that data is not good.

    • This reply was modified 4 months, 3 weeks ago by Mikhail.
    #17441
    _FIreDemon_
    Participant

    As far as I know, this is an expected behavior for tags in manual mode.
    Anyways, do you mind sharing a guide or a link for the already existing solution on how to compile a new driver with this bypass?

    #17443
    Mikhail
    Moderator

    > As far as I know, this is an expected behavior for tags in manual mode.
    May be you right.

    1. Download and try to build the community part as described here.
    2. Download and try to build the OPC Classic driver. Link
    When the above is done, I’ll help to find the code to change.

    #17451
    _FIreDemon_
    Participant

    So, I’ve built everything. The only problem was that my NuGet couldn’t find
    <PackageReference Include=”OpcComRcw” Version=”2.1.108″ />
    <PackageReference Include=”OpcNetApi” Version=”2.1.108″ />
    <PackageReference Include=”OpcNetApi.Com” Version=”2.1.108″ />
    and I had to use “Quick.” version of these packages

    #17452
    Mikhail
    Moderator

    You can find that DLLs in the Rapid SCADA installation folder.

    #17462
    _FIreDemon_
    Participant

    Ok, I’ve compiled everything using those DLLs

    #17493
    _FIreDemon_
    Participant

    I’ve changed condition in DevOpcClassicLogic.cs from

    /// <summary>
    /// Gets the tag status corresponding to the item quality.
    /// </summary>
    private static int GetTagStatus(Opc.Da.ItemValueResult itemValue)
    {
     return itemValue.QualitySpecified && itemValue.Quality.QualityBits == Opc.Da.qualityBits.good ?
     CnlStatusID.Defined : CnlStatusID.Undefined;
    }

    to

    private static int GetTagStatus(Opc.Da.ItemValueResult itemValue)
    {
     return itemValue.QualitySpecified && itemValue.Quality.QualityBits == Opc.Da.qualityBits.good || itemValue.QualitySpecified && itemValue.Quality.QualityBits == Opc.Da.qualityBits.uncertain ?
     CnlStatusID.Defined : CnlStatusID.Undefined;
    }

    Then I’ve compiled DrvOpcClassic.Logic.csproj and swapped the driver logic DLL. Now “uncertain” tags are showing in OPC UA. Hope this is a somewhat safe change.
    Thanks a lot for the help!

    • This reply was modified 4 months, 2 weeks ago by _FIreDemon_.
    #17495
    Mikhail
    Moderator

    🙂

Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.