I wrote a program to generate sqaure wave in DAQ PCI-6259 using VB6. There is no error to the program, but no signal found in the ocillator. What is the problem?
here is my code:
Private Sub Command1_Click()
Dim channel As String
Dim minVoltage, maxVoltage As Double
Dim samplesPerChannelPerWrite As Long
Dim sampleRate As Double
Dim sampleMode As Long
Dim temp As Long
' Get values from UI controls
channel = "Dev1/ao0"
minVoltage = -10
maxVoltage = 10
samplesPerChannelPerWrite = 100
sampleRate = 1000
' Configure the task
temp = DAQmxCreateTask("", taskhandle)
temp = DAQmxCreateAOVoltageChan(taskhandle, channel, "", minVoltage, maxVoltage, DAQmx_Val_VoltageUnits2_Volts, vbNullString)
temp = DAQmxCfgSampClkTiming(taskhandle, "", sampleRate, DAQmx_Val_Rising, DAQmx_Val_AcquisitionType_ContSamps, samplesPerChannelPerWrite)
temp = DAQmxWriteAnalogF64(taskhandle, samplesPerChannelPerWrite, False, -1, DAQmx_Val_GroupByScanNumber, waveform(0), samplesPerChannelPerWrite, vbNullString)
' Start the DAQmx Task
DAQmxStartTask (taskhandle)
End Sub
Private Sub Command2_Click()
DAQmxClearTask (taskhandle)
End Sub
Private Sub Form_Load()
analog_signal
End Sub