Welcome, Guest
Username: Password: Remember me

TOPIC: OPC SERVER

OPC SERVER 8 years 1 month ago #8477

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3217
  • Thank you received: 515
  • Karma: 134
Hi Ron,

I had a look in the wsdl specification, and the definition for ReturnValuesOnReply is quite simple. It says that the type is boolean and value is required. As gsoap sometimes omits the value, I more suspect gsoap than the wsdl file. The version of gsoap the we use is from the time the OPC interface was implemented in Proview, which could be 7-8 years ago. So I guess some bugfixes has been made since then and maybe the first thing we should do is to test a newer version of gsoap.

/Claes
The administrator has disabled public write access.
The following user(s) said Thank You: AutoMate

OPC SERVER 8 years 1 month ago #8479

  • AutoMate
  • AutoMate's Avatar
  • OFFLINE
  • Gold Boarder
  • Posts: 165
  • Thank you received: 6
  • Karma: 1
Hi Claes,

The current opc_msg.h file indicates code generation on 2007-03-15 via gSoap release 1.29d. An apt-get install gsoap loads 2013 version 2.8.16. The latest source version from SourceForge is gsoap_2.8.36. For now, gsoap version 2.8.16 is used to generate new .cpp code under folder ../opc/lib/opc/src/. A single warning was reported. Below is a soapcpp2 code generation session:

pwrp@redcat:~/Downloads/pwrsrc_5.4.0-1/opc/lib/opc/src$ soapcpp2 -j opc_msg.h

** The gSOAP code generator for C and C++, soapcpp2 release 2.8.16
** Copyright (C) 2000-2013, Robert van Engelen, Genivia Inc.
** All Rights Reserved. This product is provided "as is", without any warranty.
** The soapcpp2 tool is released under one of the following licenses:
** GPL or the commercial license by Genivia Inc.

opc_msg.h(433): *WARNING*: identifier 's0__interfaceVersion__XML_USCOREDA_USCOREVersion_USCORE1_USCORE0' starts with or embeds 'XML' character sequence exclusively reserved for the XML standard (for enum constants: please ignore this warning)

Saving soapStub.h annotated copy of the source input
Saving soapH.h interface declarations
Using s0 service name: Service
Using s0 service style: document
Using s0 service encoding: literal
Using s0 service location: http://localhost:80
Using s0 schema namespace: opcfoundation.org/webservices/XMLDA/1.0/
Saving soapServiceProxy.h client proxy class
Saving soapServiceProxy.cpp client proxy class
Saving soapServiceService.h service class
Saving soapServiceService.cpp service class
Saving Service.GetStatus.req.xml sample SOAP/XML request
Saving Service.GetStatus.res.xml sample SOAP/XML response
Saving Service.Read.req.xml sample SOAP/XML request
Saving Service.Read.res.xml sample SOAP/XML response
Saving Service.Write.req.xml sample SOAP/XML request
Saving Service.Write.res.xml sample SOAP/XML response
Saving Service.Subscribe.req.xml sample SOAP/XML request
Saving Service.Subscribe.res.xml sample SOAP/XML response
Saving Service.SubscriptionPolledRefresh.req.xml sample SOAP/XML request
Saving Service.SubscriptionPolledRefresh.res.xml sample SOAP/XML response
Saving Service.SubscriptionCancel.req.xml sample SOAP/XML request
Saving Service.SubscriptionCancel.res.xml sample SOAP/XML response
Saving Service.Browse.req.xml sample SOAP/XML request
Saving Service.Browse.res.xml sample SOAP/XML response
Saving Service.GetProperties.req.xml sample SOAP/XML request
Saving Service.GetProperties.res.xml sample SOAP/XML response
Saving Service.nsmap namespace mapping table
Saving soapC.cpp serializers

Compilation successful (1 warning)

The new gSoap file names are slightly truncated compared to the originals and there are many more files generated. Interestingly, the overall gsoap structure is more modular and intuitive, where every XML transaction is separated into individual XML files. For example, Service.Subscribe.req.xml is exactly as expected.

Following the Proview guidelines, I successfully compiled a fresh source version of pwrsrc_5.4.0-1 using pwre build_all_modules. Once the opc folder is updated with new gSoap code, an error is encountered, as follows:

pwre build_all_modules

-- Build all
--
-- Environment : x540x86
-- Module.........: opc
-- Source root....: /home/pwrp/Downloads/pwrsrc_5.4.0-1/src
-- Build root.....: /home/pwrp/pwr/x5-4-0/rls_dbg
-- Build type.....: dbg
-- OS.............: linux
-- Hardware.......: x86_64
-- Description....: New_gSoap_Compile

/home/pwrp/Downloads/pwrsrc_5.4.0-1/opc/lib/opc/src/.os_linux/.hw_x86_64
make: *** No rule to make target `../../stdsoap2.cpp', needed by `/home/pwrp/pwr/x5-4-0/rls_dbg/os_linux/hw_x86_64/bld/lib/opc/stdsoap2.o'. Stop.
himBH

At this point, I'm not sure whether the makefile or special.mk file requires modification due to wholesale changes in the gsoap code and / or filenames? Any help you may offer is greatly appreciated.

Regards,
Ron
The administrator has disabled public write access.

OPC SERVER 8 years 1 month ago #8480

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3217
  • Thank you received: 515
  • Karma: 134
Hi Ron,

stdsoap2.h and stdsoap2.cpp on opc/lib/opc/src were copied from gsoap source code, and should be removed now as they were part of the old gsoap version, and it seems as if stdsoap2.cpp already is removed. They should also be removed from opc/lib/opc/src/.os_linux/.hw_x86_64/special.mk. Instead opc_server and opc_provider should be linked with libgsoap, and -lgsoap should be added last in the 'link := ...' statement in opc/exe/opc_server/src/.os_linux/link_rule.mk and opc/exe/opc_provider/src/.os_linux/link_rule.mk.

Actually to be correct you should edit the mk-files on os_templ and os_templ/hw_templ and then execute 'pwre configure' to copy them to .os_linux and .os_linux/.hw_x86_64.

/Claes
Last Edit: 8 years 1 month ago by claes.
The administrator has disabled public write access.

OPC SERVER 8 years 3 weeks ago #8488

  • AutoMate
  • AutoMate's Avatar
  • OFFLINE
  • Gold Boarder
  • Posts: 165
  • Thank you received: 6
  • Karma: 1
Hi Claes,

While testing Kassl dOPC XCom product with Proview OPC Server, an error was received: "Invalid Time Offset". We've seen this same error with other OPC clients, too. A letter was sent to Kassl describing the symptom with supporting XML transaction info of a Get_Status query and response. Below is his answer:

=============

Hi,

First of all, thanks for purchasing our dOPC XGate.

Sorry, but I think your OPC XML server sends a
not correct datetime format.

The server is sending a wrong time zone offset: -4:00
that has to send -04:00

See also: www.w3.org/TR/NOTE-datetime

A time zone offset of "+hh:mm" indicates that the date/time uses a local time zone which is "hh" hours and "mm" minutes ahead of UTC. A time zone offset of "-hh:mm" indicates that the date/time uses a local time zone which is "hh" hours and "mm" minutes behind UTC.

Kind regards
Horst-Dieter Kassl
--
Dipl.-Ing. Horst-Dieter Kassl
Kassl GmbH
Alter Postweg Ost 9
27607 Langen (Germany)
Tel: +49 4743 911021
Fax: +49 4743 911022
Email: This email address is being protected from spambots. You need JavaScript enabled to view it.
Internet: www.kassl.de
Register Court Tostedt, HRB 111109
CEO: H.-D.Kassl
The administrator has disabled public write access.

OPC SERVER 8 years 3 weeks ago #8489

  • AutoMate
  • AutoMate's Avatar
  • OFFLINE
  • Gold Boarder
  • Posts: 165
  • Thank you received: 6
  • Karma: 1
Claes,

Is the Proview GetStatus returned time format routine processed in opc_util.cpp by the opc_time_OPCAsciiToA subroutine? If so, any suggestions on a format change to correct the mentioned time offset issue?

Regards,
Ron

case opc_eDataType_dateTime: {
xsd__dateTime *val = soap_new_xsd__dateTime( soap, -1);
char timstr[40];

time_AtoOPCAscii( (pwr_tTime *)bufp, timstr, sizeof(timstr));
val->__item.assign( timstr);
return val;
break;
}



pwr_tStatus opc_time_OPCAsciiToA( char *tstr, pwr_tTime *ts)
{
struct tm tt;
int tmphs = 0;
int tmps1, tmps2;
char buf[64];
int num;

strncpy(buf, tstr, sizeof(buf) - 1);
buf[sizeof(buf) - 1] = '\0';

num = sscanf(tstr, "%4d-%02d-%02dT%02d:%02d:%02d.%d-%02d:%02d", &tt.tm_year,
&tt.tm_mon, &tt.tm_mday, &tt.tm_hour, &tt.tm_min, &tt.tm_sec, &tmphs, &tmps1, &tmps2);
if ( num < 7)
return TIME__IVDTIME;

tt.tm_year -= 1900;
tt.tm_mon -= 1;
tt.tm_wday = -1;
tt.tm_yday = -1;
tt.tm_isdst = -1;

ts->tv_sec = mktime(&tt);
ts->tv_nsec = tmphs * 100;
return TIME__SUCCESS;
}
The administrator has disabled public write access.

OPC SERVER 8 years 3 weeks ago #8491

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3217
  • Thank you received: 515
  • Karma: 134
Hi Ron,

I think it's time_AtoOPCAscii() that should be changed. Here is a suggestion where the sprintf is modified with a '-' for negative tzone and printing abs(tzone) instead of tzone.

pwr_tStatus time_AtoOPCAscii (pwr_tTime *tp, char *buf, int bufsize)
{

   struct tm *tmpTm;
   int        buflen;
   char       tmpStr[16];
   pwr_tTime  t;
   int        tzone;

   if ( !tp) {
     time_GetTime( &t);
     tp = &t;
   }
  
   time_t sec = tp->tv_sec;
   tmpTm = localtime(&sec);
#if defined OS_CYGWIN
   tzone = 0;
#else
   tzone = tmpTm->tm_gmtoff / 3600;
#endif
   strftime(buf, bufsize, "%Y-%m-%dT%H:%M:%S", tmpTm);

   sprintf(tmpStr, ".%07d%s%02d:00", (int)(tp->tv_nsec / 100), tzone >= 0 ? "+" : "-", abs(tzone));
   buflen = strlen(buf);
   if (strlen(tmpStr) + buflen < (unsigned int) bufsize)
     strcpy(&buf[buflen], tmpStr);
 
   return TIME__SUCCESS;
}

/Claes
The administrator has disabled public write access.
The following user(s) said Thank You: AutoMate
Time to create page: 7.734 seconds