Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

Parsing instrument data vb6

Sorry for the delay. What versions of NI-488.2 and MAX do you have on your machine?
0 Kudos
Message 11 of 14
(3,669 Views)
Sorry, I got hung up on the wrong question. All we're looking for is for how to parse through the data, right? If so, here's your code below that you posted, with a few necessary changes that needed to be made for you to be able to use the data.


Dim data() As String, datapoints As Integer, scancount As Integer, delta As Double
Dim textToParse as string


Private Sub cmdGetData_Click()
CWGPIB1.Write "OT"
Text4.Text = CWGPIB1.Read
textToParse = Text4.Text
End Sub

Private Sub cmdParseString_Click()
data = Split(textToParse , ",")
datapoints = CInt(data(0))
scancount = CInt(data(1))
delta = CDbl(data(2))

End Sub


1. data needs to be an array of strings for the Split function to work
2. delta needs to be a Double in order for you to maintain accuracy. Long variables truncate decimal points.
3. textToParse may not be necessary, but I used it to make sure that I didn't have any trouble with getting the data.
4. Split takes a string and creates an array of strings depending on the delimiter chosen, which in this case is ",".
5. CInt converts a string into an integer.
6. CDbl converts a string into a double.

Let me know if this was the information you were looking for! Have a great day!
0 Kudos
Message 12 of 14
(3,664 Views)
Hi!

Thanks for your help. I already become those results, but this is not the finally result.I do not know how to continue. I convert sample code from manuals in VB6 code, but I did not get any useful results.Can you give me some idea or VB6 sample code to get useful results.Manuals are in earlier post that I write!( OT.zip )
Thanks for your help!
Edvard!
0 Kudos
Message 13 of 14
(3,640 Views)
Hi Edvard,

Here is a tutorial that should help you parse your data in Visual Basic.

Hope this helps!

JenK
Message 14 of 14
(3,618 Views)