Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

NI6221????? ?VB??AO???? ??????

3 views
Skip to first unread message

Ü4

unread,
Jun 3, 2008, 8:40:13 AM6/3/08
to
NI6221????? ?VB??AO???? ??????
 ?AO???????? ??????????
???????????
??ao????????????????
Private Sub AO(double MV)        Dim numSampsPerChannel As Integer        numSampsPerChannel = samplesPerBufferTextBox.Text        ReDim data(numSampsPerChannel)'  Create the DAQmx task.        DAQmxErrChk DAQmxCreateTask("", taskHandle)
'  Add an analog output channel to the task and check to see whether there is only ONE task.        DAQmxErrChk DAQmxCreateAOVoltageChan(taskHandle, "Dev1/ai0", "aoChannel", -10#, 10#, DAQmx_Val_VoltageUnits2_Volts, "")
 '  Write to the desired channel(s).
        DAQmxErrChk DAQmxWriteAnalogF64(taskHandle, numSampsPerChannel, True, 10#, _        DAQmx_Val_GroupByScanNumber, MV1, sampsPerChanWritten, ByVal 0&)
   MV=MV1      Exit Sub            ErrorHandler:    If taskIsRunning = True Then        DAQmxStopTask taskHandle        DAQmxClearTask taskHandle        taskIsRunning = False    End If
    generatingLabel.Visible = False    CmdStart.Enabled = True    CmdEnd.Enabled = False        MsgBox "Error: " & Err.Number & " " & Err.Description, , "Error"End Sub
?????????~
0 new messages