Je possède actuellement une carte K8055 et j’envisage d’acheter une k8061 car celle-ci possède plus d’entrée analogiques.
Je désire mesurer sur un banc de puissance plusieurs paramètres simultanément comme une vitesse de rotation, des témpératures et des pressions et piloter un frein à partir du gradateur k8038.
Ma question est la suivante : Quel est le taux d’échantillonage maximum que je pourrai obtenir en utilisant toutes les entrées analogiques en même temps ?
Ce que j’aimerai faire :
Acquisition deux vitesses toutes les 0.01 ou 0.1s
Changement de la valeur de pilotage du k8038 toutes les 0.01 ou 0.1s
Acquisition de températures et de pression toutes les 0.5 sec
Et est-il possible de faire ceci en utilisant plusieurs cartes K8055 ou K8061 simultanément ?
Vous pouvez me répondre en anglais.
Merci
Hello,
I currently own a K8055 card and I plan to buy a K8061 because it has more analog inputs.
I want to measure on a dynamometer several parameters simultaneously as speed, temperature and pressure and drive a brake from the dimmer k8038.
My question is: What is the maximum sample rate that I can achieve using all analog inputs at the same time?
What I do:
measure of two speed every 0.01 or 0.1s
Change the value of steering k8038 all 0.01 or 0.1s
measure of temperature and pressure every 0.5 sec
And is it possible to do this using several cards simultaneously K8055 or K8061?
It seems that the sampling interval is about 3ms if all the 8 AD channels are read simultaneously.
If only one channel is read the sampling interval is 2ms.
Here are the Delphi codes used to test the sampling rate.
procedure TForm1.Button2Click(Sender: TObject);
var i, j: Integer;
buffer: array [0..8] of Longint;
data: array [0..7,0..99] of Longint;
begin
memo1.Clear;
for i:=0 to 99 do
begin
ReadAllAnalog(CardAddress,@buffer[0]);
for j:=0 to 7 do
data[j,i]:=buffer[j];
end;
for i:=0 to 99 do
begin
memo1.lines.add(inttostr(data[0,i])
+chr(9)+IntToStr(data[1,i])
+chr(9)+IntToStr(data[2,i])
+chr(9)+IntToStr(data[3,i])
+chr(9)+IntToStr(data[4,i])
+chr(9)+IntToStr(data[5,i])
+chr(9)+IntToStr(data[6,i])
+chr(9)+IntToStr(data[7,i]));
end;
memo1.SelectAll;
memo1.CopyToClipboard;
end;
procedure TForm1.Button8Click(Sender: TObject);
var i: Integer;
data: array [0..99] of Longint;
begin
memo1.Clear;
for i:=0 to 99 do
data[i]:=ReadAnalogChannel(CardAddress, 1);
for i:=0 to 99 do
memo1.lines.add(inttostr(data[i]));
memo1.SelectAll;
memo1.CopyToClipboard;
end;
Here are the Excel charts of the results.
A 10Hz sine wave sampled on all 8 AD channels:
A 10Hz sine wave sampled on one AD channel:
[quote]And is it possible to do this using several cards simultaneously K8055 or K8061?[/quote]Yes, four K8055 cards and eight K8061 cards can be connected to the PC.
[quote=“bretzel_59”]And is it possible to do this using several cards simultaneously K8055 or K8061?
Yes, four K8055 cards and eight K8061 cards can be connected to the PC.[/quote]
But What is the sampling interval if i connect 2 or more cards ? the same ?
[quote]But What is the sampling interval if i connect 2 or more cards ? the same ?[/quote]I think there is no big difference if more than one K8061 cards are used.
You just simply change the card address number in this function call to address other card:
ReadAllAnalog(CardAddress,@Data[0]);
Bonsoir, je suis navré mais c’est faux ! j’ai justement ce probléme
[color=#0000FF]hello, I’m sorry but this is wrong! I have just this problem[/color]
1-on ne peux pas avoir une K8055 et une K8061 sur un même PC, les déclaration de DLL sont trop communes, il serait vraiment intéréssant d’avoir des appels différents !
[color=#0000FF]1-we can not have a K8055 and K8061 on the same PC, the statement DLLs are too common, it would be really interesting to have different calls! [/color]
EX Vm110 :
Private Declare Sub CloseDevice Lib “k8055d.dll” ()
EX Vm140 :
Private Declare Sub CloseDevices Lib “k8061.dll” ()
résultat le soft ne sait plus qui on utilise et refuse ce double appel de DLL !
Il suffirait de finir les méthodes par un numéro de carte !
[color=#0000FF]result the soft does not know who uses it and refuses to call this double DLL!
He would finish the methods by a card number![/color]
EX Vm110 :
Private Declare Sub CloseDevice55 Lib “k8055d.dll” ()
EX Vm140 :
Private Declare Sub CloseDevices61 Lib “k8061.dll” ()
2-Pour le temps d’acquisition de multicarte :
Le temps sur un timer s’accumule ! si on appel readalldigitalchannel(1,data) on a 10 à 12ms
Puis l’instruction suivante readalldigitalchannel(2,data) on a encore 10 à 12ms, etc…
Soit pour lire 4 cartes 12*4 = 50ms !
la solution réside non pas en de multiples timers, mais en utilisant des threads différents pour chaque lecture.
[color=#0000FF]2-for the time of acquisition of Multicards:
The time accumulated on a timer! if you call readalldigitalchannel (1, data) it use 10 to 12ms
Then the following statement readalldigitalchannel (2, data) it use again 10 to 12ms, etc. …
For 4 cards to read analog we have : 12 * 4 = 50ms!
the solution is not multiple timers, but using differents threads for each reading.[/color]
See this example in VB.NET for one k8055, duplicate it for more cards, whit another name :
[code]’ déclaration of thread :
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
’ déclare et lance le tread de scrutation des entrées
Dim lire_entrees As New System.Threading.Thread(AddressOf sub_lecture1)
lire_entrees.IsBackground = True ’ ferme le thread en même temps que l’appli (form1)
lire_entrees.Start() 'lance le thread
’ déclare les mémoires d’entrées virtuels
dim entrees() as boolean
end sub
Private Sub sub_lecture1()
While True
'traitement carte 1
SetCurrentDevice(1)
Dim Val_entrees As Integer = ReadAllDigital 'lit toutes les entrées d’un coup (8 bits sur un int)
For boucle As Integer = 0 To 5 'pour chaque entrées TOR
Dim C As Integer = CInt(2 ^ boucle) 'calcul la puissance de 2 : 2^0,2^1,2^3,2^4…
entrees(boucle) = CBool((Val_entrees And C) \ C) 'les mémoires entrees sont adréssées
Next
’ redonne la main au thread principal pendant 10ms
System.Threading.Thread.Sleep(10)
End While
End Sub ’ thread de scrutation des entrées de la carte 1[/code]
En éspérant que cela serve, MErci de me tenir au courant sur l’évolution proposé des DLL de ces deux cartes pour pouvoir les utiliser ensembles !
[color=#0000FF]Hoping that this will be useful, please keep me informed on developments proposed DLL these two cards can use them together! [/color]
[quote]En éspérant que cela serve, MErci de me tenir au courant sur l’évolution proposé des DLL de ces deux cartes pour pouvoir les utiliser ensembles !
Hoping that this will be useful, please keep me informed on developments proposed DLL these two cards can use them together![/quote]There are solutions available.
In Visual basic you can use alias names if two DLLs contain same function names.
See example in this thread: viewtopic.php?f=15&t=1807
In C++ you can use namespaces or use my special made K8061.DLL.
I added “X” to the K8061 function names.
See the thread: viewtopic.php?f=3&t=2295
Private Declare Sub CloseDevice Lib "k8055d.dll" () Alias "closedevices55" ()
Private Declare Sub CloseDevices Lib "k8061.dll" () Alias "closedevices61" ()
it’s true ? i test it soon and many thank’s for this help !
regards @dn