Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #12081

Re: C-DLL with paramter VARIANT and FILETIME?

From "Karl-Heinz" <invalid@invalid.invalid>
Newsgroups comp.lang.clipper.visual-objects
Subject Re: C-DLL with paramter VARIANT and FILETIME?
Date 2018-10-23 18:20 +0200
Message-ID <g3906iFim07U1@mid.individual.net> (permalink)
References (4 earlier) <pqhtkh$di7$1@news-1.m-online.net> <g33h9aFei8aU1@mid.individual.net> <pqkq76$8hj$1@news-1.m-online.net> <g36m7sF46l2U1@mid.individual.net> <pqncac$vuj$1@news-1.m-online.net>

Show all headers | View raw


Hi  Gerhard,

puuh, i´m running out of ideas...

In the VO28RUN.dll there are two more "Variant" funcs. After reading your
msgs again, it seems you didn´t try the Usual2Variant() till now ?

_DLL FUNCTION Usual2Variant    (pItem AS PTR, pvarg AS PTR)           AS
LOGIC PASCAL:VO28RUN.Usual2Variant
_DLL FUNCTION Variant2Usual    (pvarg AS PTR, pItem AS PTR)           AS
LOGIC PASCAL:VO28RUN.Variant2Usual

i´ve searched the SDK prg sources but both funcs are never used. So the
param usage is not clear.

i think the best would be to contact the vendor for a C sample that shows
the OPCReaditem() usage.

Good luck !

regards
Karl-Heinz




"Gerhard Bunzel"  schrieb im Newsbeitrag
news:pqncac$vuj$1@news-1.m-online.net...

Hi Karl-Heinz,

thanks for your answer.

In VB a Handle is a LONG - so I used it the same way. A PTR is also only a
numeric value.
http://codingdomain.com/visualbasic/win32api/datatypes/

A C-Wrapper for VPE from Wolfgang Riedmann is also using LONG for the
handle - and it's working perfect.

The VB-Sample is working and shows the items values.
This is from that sample:
Private Record(1 To 1000) As Rec
Private myconnectionhandle(100), mygrouphandle(100), myitemhandle(1000) As
Long
Private mytimestamp As Date
Private myitemdata As Variant
Private myrate, myquality As Long

Private Type Rec
      Key As String
      ConnectionHandle As Long
      GroupHandle As Long
      TagHandle As Long
      Description As String
      Kind As String
      Units As String
      ArrayNumber As Integer
      Room As Integer
      Value As Variant
      FieldName As String
End Type

And here reading of an item:
tf = ReadOPCItem(ByVal Record(i).ConnectionHandle, ByVal
Record(i).GroupHandle, ByVal Record(i).TagHandle, Record(i).Value,
mytimestamp, myquality)


Out of the file opcda.h from a C-Sample:
typedef DWORD OPCHANDLE;

The data type LONG for the handles schound not b the problem. All other
functions without VARIANT and FILETIME are working.
I can read the server- and the itemnames, connect to the server, create a
group, add an item to the group, disconnect from server.
But I can't read a itemvalue :-(


Thanks in advance.

Best regards

Gerhard



Am 22.10.2018 um 21:20 schrieb Karl-Heinz:
> Hi Gerhard,
>
>> ReadOPCItem(myserverhandle, mygrouphandle, myItemhandle, ptrVariant,
>> ptrFileTime, @nQuality)
>> gives back a TRUE. GetLastError() is 0 - no Error.
>
> strange ....
>
>
>> This is the C-function:
>> BOOL ReadOPCItem (HANDLE hConnect, HANDLE hGroup, HANDLE hItem, VARIANT
>> *pVar, FILETIME *pTimeStamp, DWORD *pQuality);
>
>
> _DLL FUNCTION ReadOPCItem (nConnect AS LONG, pGroupConnect AS LONG,
> pItemConnect AS LONG, pVariant AS _winVARIANT, pFileTime AS _winFILETIME,
> pQuality REF DWORD) AS LOGIC PASCAL:WTclient._ReadOPCItem@24
>
> Why "AS LONG" ?  IMO nConnect, pGroupConnect and pItemConnect should be
> declared "AS PTR" and not "AS LONG" ?
>
> Have you tried to run the VB sample exe files that are included in
> WTclient.zip - just to see that ReadOPCItem() works at least with VB ?
>
>
> Isn´t there any C sample that shows how ReadOPCItem()  is called ?
>
>
> regards
> Karl -Heinz 

Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

C-DLL with paramter VARIANT and FILETIME? Gerhard Bunzel <g.bunzel@domonet.de> - 2018-10-19 04:38 +0200
  Re: C-DLL with paramter VARIANT and FILETIME? "Wolfgang Riedmann" <wriedmann@gmail.com> - 2018-10-19 06:18 +0200
    Re: C-DLL with paramter VARIANT and FILETIME? Gerhard Bunzel <g.bunzel@domonet.de> - 2018-10-19 11:29 +0200
      Re: C-DLL with paramter VARIANT and FILETIME? "Wolfgang Riedmann" <wriedmann@gmail.com> - 2018-10-21 05:58 +0200
        Re: C-DLL with paramter VARIANT and FILETIME? Gerhard Bunzel <g.bunzel@domonet.de> - 2018-10-21 15:06 +0200
          Re: C-DLL with paramter VARIANT and FILETIME? "Karl-Heinz" <invalid@invalid.invalid> - 2018-10-21 16:36 +0200
            Re: C-DLL with paramter VARIANT and FILETIME? Gerhard Bunzel <g.bunzel@domonet.de> - 2018-10-22 17:26 +0200
              Re: C-DLL with paramter VARIANT and FILETIME? "Karl-Heinz" <invalid@invalid.invalid> - 2018-10-22 21:20 +0200
                Re: C-DLL with paramter VARIANT and FILETIME? Gerhard Bunzel <g.bunzel@domonet.de> - 2018-10-23 16:47 +0200
                Re: C-DLL with paramter VARIANT and FILETIME? "Karl-Heinz" <invalid@invalid.invalid> - 2018-10-23 18:20 +0200
                Re: C-DLL with paramter VARIANT and FILETIME? "Karl-Heinz" <invalid@invalid.invalid> - 2018-10-23 21:07 +0200

csiph-web