Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

log acquire data to text file for just 1 channel

refer to the Ni measurement studio example: data logger, the example is to log acquire data from 2 channel to text file. If i would like to log just 1 channel to text file...what whould i do. ?
thanks
0 Kudos
Message 1 of 2
(5,720 Views)
Hello 5000,

Two things:

1) Don't add the second channel in the cmdStart_Click subroutine.

2) Since you're acquiring data from one channel only, then your ScaledData Variant would be only 1-dimensional, not 2-dimensional. So you'll want to modify the LogData subroutine to only loop through the single dimension of ScaledData:

' Print the title of the column
Print #FileNumber, vbTab & "Ch " & RTrim(CWAI1.Channels(1).ChannelString)

' Channels string
For iScans = LBound(ScaledData) To UBound(ScaledData)
sData = Format(ScaledData(iScans), ".###0")
Print #FileNumber, vbTab & sData
Next

David Mc.
NI Applications Engineer
0 Kudos
Message 2 of 2
(5,720 Views)