Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using data from an ActiveX control
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
01488825
Message ID:
01488828
Vues:
65
>I have a data acquisition IP device on our network. This device comes with an ActiveX control that allows developers to query the data. It comes with many examples (C#, VB, Excel, Access), but no Foxpro example. I am looking for advise on how to get the data out of the device into something I can use within VFP. The relevant method to get this data is called GetDataEx. Based on the syntax below, what would the VFP equivalent be? I tried an VFP array, but it causes an error. Any ideas?
>
>Syntax:
> DataqSdk1.GetDataEx(A(0),Count)
>
>(A(0) is a pointer to a 16-bit integer array; Count is the number of data points, not scans, that you are requesting (32,767 maximum))
>
>Example:
> Dim A(10000) As Integer
>
>
>Private Sub DataqSdk1_ NewData(ByVal Count As Integer)
>
>DataqSdk1.GetDataEx A(0), Count
>
>DQChart1. ChartEx A(0), 1, Count
>
>Label1.Caption = A(0)
>
>'the next line of code converts the integer into volts - see Converting Counts to Volts
>
>Label2.Caption = Format((A(0) And &HFFFC) / 32768 * 10, "0.00")
>
>End Sub


Scott,

I do not think that ComArray() will be of any help

Instead, allocate a string
local s
s = repl(bintoc(0, '2rs'), 32768)

>DQChart1. ChartEx (@m.s, 1, 32768)

Then A(i) will be

ctobin(substr(m.s, i * 2 +1, 2), '2rs')
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform