12-22-2009 07:10 AM
I am trying to read data from a instrument(Yokogawa WT210). I have a program that was written in Visual Basic 6 but do not know how to do the same thing in VB.NET. Here is the code from the VB6:
Dim varYokoData as Variant
CWGPIB1.Write "MEASURE:VALUE?"
varYokoData = CWGPIB1.Tasks.Item("Number Parser").Read
cweYokoVolts.Value = varYokoData(0)
cweYokoAmps.Value = varYokoData(1)
cweYokoWatts.Value = varYokoData(2)
I can read the data using GpibDevice.ReadByteArray. I get some numbers back but I don't know what to do to them to put them into the same format as the above code did in VB6. In VB6 it put the values in an array where you could pick which number in that array you needed. I did not write the code for VB6 and am pretty new to using VB.NET. I don't really know what the "Number Parser" used in the above code does. Anyone have any solutions? Thanks.
12-23-2009 02:29 PM
What sort of number do you get back? Could you try the read string command instead to see what you are reading? Does help, F1, give you any insights to the functions and methods you are using? I would open an example in .net and modify it to fit your needs before I tried to recreate something from scratch.