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.

ReadMultipleItem return an error with OPC DA Schneider

More
22 Nov 2021 08:14 #10372 by support
Hello.

Can you please clarify some details:

1. You wrote "... return the value but also this error:...". I do not understand this. You cannot get the value and the error at the same time. Are you trying to say that it sometimes works and sometimes not? Or, that it works consistently for some items but does not work for others? Please clarify.

2. Can you specify what is actually inside the parameters you are passing in (server.MachineName, server.ServerClass, item.ItemID, item.UpdateRate ) ?

Thank you

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

More
22 Nov 2021 08:07 #10371 by v.parma
My problem is on Schneider OPC DA Client with ReadMultipIetem function, this working fine with other OPC Server, with OPC DA Scheider of my customer return the value but also this error: Incorrect parameter + The client method called (or event/callback invoked) was 'ReadMultipleItems[2]'

The code is:
void DAServerReadDataSync()
        {
            List<DAReadItemArguments> rgcItems = new List<DAReadItemArguments>();
 
            foreach (COPCDAServer server in lstDAServer)
            {
 
                foreach (COPCDAItem item in server.Items)
                    rgcItems.Add(new DAReadItemArguments(server.MachineName, server.ServerClass, item.ItemID, item.UpdateRate));
 
            }
 
            if (rgcItems.Count > 0)
            {
                DAVtqResult[] res = clientDA.ReadMultipleItems(rgcItems.ToArray());
                int iIndex = 0;
 
                foreach (COPCDAServer server in lstDAServer)
                    foreach (COPCDAItem item in server.Items)
                    {
                        //Se dato è valido aggiorno il valore del tag, altrimenti indico "FAILURE" e aggiungo un log testo
                        if (res[iIndex].Succeeded)
                        {
                            try
                            {
                                item.ItemValueReal = Convert.ToDouble(res[iIndex].Vtq.Value);
                            }
                            catch
                            {
                                item.ItemValueReal = 0;
                            }
 
                            item.ItemValueString = Convert.ToString(res[iIndex].Vtq.Value);
                            item.LastUpdatedDateTime = DateTime.Now;
                            item.ItemQuality = res[iIndex].Vtq.Quality.ToString();
                            item.UpdateOnDatabase = true;
 
                            //Loggo il valore tag solo se il log esteso è abilitato
                            if ((eventLogs != null) && (extendedLogs))
                            {
                                ExtendedLog log = new ExtendedLog();
                                log.LogText = DateTime.Now.ToString("yyyyMMddHHmmss000") + " TAG: " + item.ItemID + " VALORE: " + item.ItemValueString + " STATO: " + item.ItemQuality;
                                eventLogs(this, log);
                            }
 
                        }
                        else
                        {
                            //item.ItemValueReal = 0.0;
                            //item.ItemValueString = "FAILURE " + e.Arguments.ItemDescriptor.ItemId + " " + e.ErrorMessageBrief;
                            item.ItemQuality = "FAILURE";
                            item.UpdateOnDatabase = true;
 
                            if (eventLogs != null)
                            {
                                ExtendedLog log = new ExtendedLog();
                                //log.LogText = DateTime.Now.ToString("yyyyMMddHHmmss000") + " - ERRORE lettura del tag DA " + item.ItemID + " " + item.ItemValueString + " " + res[iIndex].ErrorCode + "" + res[iIndex].ErrorMessage;
                                log.LogText = DateTime.Now.ToString("yyyyMMddHHmmss000") + " - ERRORE lettura del tag DA " + item.ItemID + " " + item.ItemValueString +  " " + res[iIndex].ErrorMessage;
                                eventLogs(this, log);
                            }
 
                        }
                        UpdateDAItemOnDatabase(item);//Aggiorna il valore tag nel dataset utente
                        iIndex++;
                    }
            }
        }
 

The res[iIndex].Succeeded return False and res[iIndex].ErrorMessage return the message above.

Can help me.
Thanks.

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

Moderators: support
Time to create page: 0.100 seconds