Measurement-computing TempBook rev.3.0 Manuel d'utilisateur Page 118

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 166
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 117
10-22
Enhanced
API Programming Models (TempBook) TempBook Users Manual
ret& = VBdaqAdcTransferSetBuffer(handle&, buf0%(), BLOCK&, DatmCycleOff& +
DatmUpdateSingle&)
Start the first transfer; the transfer will actually start upon trigger detection. In this case, the following
software trigger will start the transfer:
ret& = VBdaqAdcTransferStart(handle&)
Issue a software trigger command to the hardware to trigger the transfer:
ret& = VBdaqAdcSoftTrig&(handle&)
The next
do
loop swaps the active buffer back and forth from
buf0
to
buf1
and waits for the acquisition
to go inactive or the buffer to fill up. Swapping continues until the transfer goes inactive:
whichBuf& = 0
Do
The following line changes the current buffer:
If whichBuf& = 1 Then whichBuf& = 0 Else whichBuf& = 1
Wait for the acquisition to go inactive or the buffer to be filled:
Do
ret& = VBdaqAdcTransferGetStat(handle&, active&, retCount&)
Loop While ((active& <> 0) And (retCount& < BLOCK&))
If the previous acquisition is still active, start another transfer into the next buffer:
If (active& <> 0) Then
If whichBuf& = 0 Then
ret& = VBdaqAdcTransferSetBuffer(handle&, buf0%(), BLOCK&,
DatmCycleOff& + DatmUpdateSingle&)
ret& = VBdaqAdcTransferStart(handle&)
Otherwise, restart the transfer into the current buffer:
Else
'ret& = VBdaqAdcBufferTransfer(buf1%(0), BLOCK&, 0, 0, 0,
tmpActive&, tmpRetCount&)
ret& = VBdaqAdcTransferSetBuffer(handle&, buf1%(), BLOCK&,
DatmCycleOff& + DatmUpdateSingle&)
ret& = VBdaqAdcTransferStart(handle&)
End If
End If
Send the data into the process buffer,
totals()
:
If (retCount& > 0) Then
Average the readings in the process buffer and print the results:
For j& = 0 To channels& - 1
totals&(j&) = 0
Next j&
For i& = 0 To retCount& - 1
For j& = 0 To channels& - 1
Decide which buffer to add the data from:
If whichBuf& = 0 Then
totals&(j&) = totals&(j&) + buf1%(i& * channels& + j&)
Else
totals&(j&) = totals&(j&) + buf0%(i& * channels& + j&)
End If
Next j&
Next i&
Display the averaged results:
Print "Averages:";
For j& = 0 To channels& - 1
Print Tab(j& * 7 + 17); Format$((5# / 32768#) * totals&(j&) /
retCount&, "#0.000");
Next j&
Print
End If
Continue the do..while loop until the acquisition goes inactive:
Loop While (active& <> 0)
Close the device before exiting:
ret& = VBdaqClose(handle&)
Vue de la page 117
1 2 ... 113 114 115 116 117 118 119 120 121 122 123 ... 165 166

Commentaires sur ces manuels

Pas de commentaire