OPC write value issue-IBH opc server

Forum Home Forums Communicating with Devices OPC OPC write value issue-IBH opc server

This topic contains 95 replies, has 2 voices, and was last updated by Mikhail Mikhail 2 weeks, 4 days ago.

Viewing 6 posts - 91 through 96 (of 96 total)
  • Author
    Posts
  • #4676

    mariodavid
    Participant

    Why you don’t pass valid URL to new OpcCom.Da20.Server(url, server)?

    Becase I do not what is a valid URL. Could be “http://localhost/Scada/”? I really do not know.

    Interface is just a declaration. The runtime executes the method of an object that was actually created.

    I am trying to create a class derived from IOPCSyncIO interface. Implementing Something like this:

    “private IOPCSyncIO campo;
    public IdentifiedResult[] Write(ItemValue[] items)
    {
    if (this.campo == null)
    throw new NotConnectedException();
    ((IOPCSyncIO) this.campo).Write(items);
    }”
    without return, because IOPCSyncIO.write is void method

    but give me a NullReferenceException

    I am trying to create a instance of a interface, but that is not possible.

    #4677

    mariodavid
    Participant

    Why you don’t pass valid URL to new OpcCom.Da20.Server(url, server)?

    Becase I do not KNOW what is a valid URL. Could be “http://localhost/Scada/”? I really do not know.

    Excuse my mistakes when writing

    #4678

    mariodavid
    Participant

    I have passed all kinds of values to url: int, boolean, string. The compiler said that: can not be changed to an OPC.URL type.

    URL url = 12;
    URL url = “nashghda”;
    URL url = true;

    Only allows URL url = null;

    Do you know which is the valid URL to new OpcCom.Da20.Server(url, server)?

    #4684
    Mikhail
    Mikhail
    Moderator

    I suppose the URL here is the ID of the OPC server, e.g. Matrikon.OPC.Simulation/{f8582cf2-88fb-11d0-b850-00c0f0104305}

    #4685

    mariodavid
    Participant

    I tried this Opc.URL url = new Opc.URL(“”); Compile without error but appers: error sending command: remote server is not currently connected. There is no exception in the contructor with this meaning. Where do you think is the exception?. I probe it with “localhost” etc. Still the same error

    #4690
    Mikhail
    Mikhail
    Moderator

    Is there a method like Connect to connect to the OPC server?

Viewing 6 posts - 91 through 96 (of 96 total)

You must be logged in to reply to this topic.