Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

Parsing instrument data vb6

Hi!

I am using Measurement Studio 6 and VB 6. I also use NI AT-GPIB/TNT card and GN Nettest TD3486 OTDR connected on this card. I have captured data from this OTDR. In the manuals for this OTDR writes that returned data is » Trace Data Packet ( as specified in ANSI/IEEE Std 728-1982 for block transmission of binary data ). The OTDR recognize command » OT » to return data from OTDR.
I receive data in this form ( 11917,512,0.000000058 ), that I can not use.I have tried some tools from your site to parse this data, but it did not work.

Thanks for your help!

Edvard
0 Kudos
Message 1 of 14
(8,273 Views)
Edvard,
I've got a few questions that might help us get you to a solution. I can't seem to find a manual for that device online anywhere. Are you expecting the instrument to return data in the definite length binary block data? When you say you receive data in the form "( 11917,512,0.000000058 )" do you mean you literally get back a string from the instrument that looks like a parenthesis-enclosed list of comma-delimited numbers? What tools from NI have you tried to use to parse the data you're getting back?
0 Kudos
Message 2 of 14
(8,267 Views)
I have received data in form 11917,512,0.000000058 whitout parenthesis-enclosed.I have used the parsing tool that is included in Measurement Studio in command CWGPIB.
The manual also said that the :
firs output number means: number of data points as Integer;
second:total number of scans ( samples ) which were taken ( averaged ) expressed as Integer;
third:distance in meters between consecutive data points in the array, expressed as a Fixed point number
How should I become some useful array of data?

Edvard
0 Kudos
Message 3 of 14
(8,257 Views)
Are those three values all of what's being returned from the instrument? Is there another command that actually returns the acquired data? Do you have a soft copy of the manual you could attach or email to me? Not having the command set for the device makes it difficult to know what you should do with the returned results. Also, can you post some code that shows what you've been able to do up to this point?
0 Kudos
Message 4 of 14
(8,256 Views)
Hi!

There are actually two commands that returns the acquired data.This are OT and OF command.(manuals are in attachment).Here is some part of VB code that I use!
Edvard
Dim Response As Variant
Dim data As String, datapoints As Integer, scancount As Integer, delta As Long
Private Sub cmdGetData_Click()
CWGPIB1.Write "OT"
Text4.Text = CWGPIB1.Read
End Sub
Private Sub cmdParseString_Click()
data = Text4.Text
Response = CWGPIB1.Tasks.Item("SteviloElementov").Parse(data)
datapoints = Response(0)
scancount = Response(1)
delta = Response(2)
0 Kudos
Message 5 of 14
(8,214 Views)
Hi!
Here is a second part of the manuals!
Edvard!
0 Kudos
Message 6 of 14
(8,213 Views)
I don't really have much experience with the VB6 controls. If you're having trouble using them, your best bet would be to go through customer support. If you're just having trouble with the data parsing, I think I can help with that.

It looks like the data is in a multi-part binary format. The OT command actually returns multiple messages - the first one is the three number header you're already getting back. The second message is the binary data. So you could:

1) Read the header "#B"
2) Read 2 bytes as a signed 16 bit value - this is the number of bytes of data.
3) Read in the number of bytes of data, and then cast that byte array to a an int16 array.
4) Read in one byte to get the checksum byte at the end of the data.
5) If you want to scale the data to get dB, divide each 16 bit integer value by 340.0.

I hope that this helps. I'm going to check with some people who have more direct experience with the VB6 parsing controls and see if I can get some sample code for this.
0 Kudos
Message 7 of 14
(8,200 Views)
Hi!
Thanks for your help!
I will be very greatfull for additional help!

Edvard!
0 Kudos
Message 8 of 14
(8,174 Views)
Sorry for the delay Evdard. I'm working on getting the CW GPIB tools installed correctly on my machine so I can look more into this for you...
0 Kudos
Message 9 of 14
(8,127 Views)
Hi!

I am sorry to disturb you, but have you find out something that could help me to solve my problem.
Thanks for your help!

Edvard!
0 Kudos
Message 10 of 14
(7,986 Views)