Professional OPC
Development Tools

logos

Online Forums

Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.

Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.

Do not use the Contact page for technical issues.

Siemens S7-1500F : Schreiben von Tags

More
21 Nov 2019 12:55 #7986 by support

Please Log in or Create an account to join the conversation.

More
21 Nov 2019 11:11 #7984 by tmouslih
Hallo,

Do have any idea what can we change in the settings of the KEPWare server to solve this issue?

Many thanks

Please Log in or Create an account to join the conversation.

More
20 Nov 2019 14:22 #7983 by support
Thank you.

You are actually using OPC "Classic", not OPC UA.
But the error handling looks correct in principle.

I believe that this is a server problem. If you disagree, then the way to decide it would be to put an OPC Analyzer between the client and server, and check the captured communication. Some more related info:
- kb.opclabs.com/How_to_use_OPC_Analyzer
- kb.opclabs.com/Collecting_information_for_troubleshooting

Let me know if you want to proceed this way.

Best regards

Please Log in or Create an account to join the conversation.

More
20 Nov 2019 11:50 - 20 Nov 2019 12:04 #7980 by tmouslih
Hallo,

Please see fowing code:
public TKSY.Types.OPC.Tag_Info_Tag  WriteTagValue(string tagName, object value)
        {
            try
            {
                if (_OPCActive == false)
                    return new TKSY.Types.OPC.Tag_Info_Tag();
 
                TAG_Info item = _TagInfoList.Find(x => x.TAG.TAGFullName.Equals(tagName));
 
                if (item != null)
                {
                    if (item.TAG.VtgValue == null)
                        item.TAG.VtgValue = new DAVtq(value);
 
                    item.TAG.VtgValue.Value = value;
                    if (item.TAG.IsArray == true)
                    {
                        // check data length of writting array. If not the same length, then Write() will cause an exception
                        if (item.TAG.ArrayLength != ((Array)value).GetUpperBound(0) + 1)
                        {
                            if (OnLoggingHandler != null)
                                OnLoggingHandler(this, new LoggingArgs(LogLevel.Error, string.Format("Tag write -> tag=<{0}> OPC array length=<{1}>, writing data length=<{2}>", tagName, item.TAG.ArrayLength, ((Array)value).GetLowerBound(0))));
 
                            return null;
                        }
                    }
 
                    _easyDaClient.WriteItemValue(_ServerAdress, _ServerClass, tagName, value);
 
                    if (OnLoggingHandler != null)
                        OnLoggingHandler(this, new LoggingArgs(LogLevel.OPC, string.Format("Tag write -> tag=<{0}>, Value=<{1}>", tagName, OPCTypeConverter.GetStringValueFromArray(item.TAG))));
 
                    return item.TAG;
                }
                else
                {
                    if (OnLoggingHandler != null)
                        OnLoggingHandler(this, new LoggingArgs(LogLevel.OPC, string.Format("Tag write -> tag=<{0}> unkown / not find in internal list.", tagName)));
                }
            }
            catch (OpcException oex)
            {
                if (OnLoggingHandler != null)
                    OnLoggingHandler(this, new LoggingArgs(LogLevel.Exception, string.Format("Error during OPC WriteItemValue tag=<{0}>, value=<{1}>", tagName, value), oex, ExceptionType.OpcException));
            }
            catch (Exception ex)
            {
                if (OnLoggingHandler != null)
                    OnLoggingHandler(this, new LoggingArgs(LogLevel.Exception, string.Format("Error during OPC WriteItemValue tag=<{0}>, value=<{1}>", tagName, value), ex, ExceptionType.Exception));
            }
            return null;
        }
Best regards
Last edit: 20 Nov 2019 12:04 by support.

Please Log in or Create an account to join the conversation.

More
20 Nov 2019 11:47 #7979 by support
3. How are you doing handling of possible errors from the "write" call? Please supply the relevant piece of code.

Please Log in or Create an account to join the conversation.

More
20 Nov 2019 11:13 #7978 by tmouslih
Hallo,

1) We are using OPC UA.
2) The method is WriteItemValue().
3) We don't get any errors, even the write function executes succefull, as can see in the log file. But only sometimes the value of the tag doesn't change.

Many thanks in avanced.
Best regards.

Please Log in or Create an account to join the conversation.

More
20 Nov 2019 09:56 #7977 by support
Hello,

please provide more details:

1. Are you using OPC UA or OPC Classic?
2. We do not have WriteTagValue() method in our product. Which method are you actually calling?
3. How are you doing handling of possible errors from the "write" call? Please supply the relevant piece of code.
4. Assuming that you are checking for errors, do you get any errors from the "write" call?

Best regards

Please Log in or Create an account to join the conversation.

More
20 Nov 2019 08:21 #7976 by tmouslih
Hallo,

Seit kurzer Zeit haben wir ein Problem mit dem Schreien von Tags.
Das Problem ist erst aufgetaucht seitdem wir die Steuerung Siemens S7-1500F einsetzen. Mit anderen Steuerungen (z.B. Simatic ET200 und Simatic S7 300) haben wir das Problem nicht.
Wenn wir Werte in den Tags mit WriteTagValue() schreiben, werden sie im kepware Server sporalisch ab und zu nicht geschrieben und somit falsch von der SPS ausgewertet.
Für mehr Detais bitte s ehen Sie den Signalablauf im Anhang.

Wir setzen QuickOPC2018.3 und KEPServer6.6 und die Steuerung Siemens S7-1500F.

Ich würde Ihnen seht danbar wenn sie die Frage umgehend beantworten könnten.

MfG.
Tarik
Attachments:

Please Log in or Create an account to join the conversation.

Moderators: support
Time to create page: 0.085 seconds