LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Aquiring waveform from HP 8590L

Despite my lack of programming ability, I've managed to configure the frequency, span, sweep, etc., of my spectrum analyzer.  However, I can't figure out the data acquisition, depsite having this VI.  I don't get any data out of it, and I can't figure out why.  Any ideas?  It seems easy to manipulate the array once I get it, but this step has stumped me.  Thanks!
0 Kudos
Message 1 of 3
(2,409 Views)
Hello Rjohanso,

It seems like you are reading your data from the device as a string, in the second VISA Read where you are reading 4096 bytes of data from your instrument.  First, place a probe or an indicator on that string to see if you are truly reading acceptable data from your device.  You are then performing some conversions on that string data to turn it into an array of DBLs.  My guess would be that this is where your problem is.  Place indicators after each step of the conversion process to see if these conversions are working correctly.  You first use a 'string to byte array' function.  By opening the detailed help for this function (right-click and select Help), I find that it creates an array of integers, where each element is the ASCII value of each character in the string.  Therefore, if your string has 4096 characters, you will get an array with 4096 elements, and each element will be the ASCII code for that character.  I doubt this is really what you want to do, because the ASCII code for the character 1 as a string is actually 49 as an integer.  Take a look at www.asciitable.com for a complete list of the decimal representations of ASCII characters.  Instead, I would use the 'Fract/Exp String to Number' function to convert the string representation of a number to a DBL representation of that number, i.e. convert the string characters 1,2, and 3, to the number 123.  You'll have to use the String Subset function to parse out each sample from the whole 4096 byte long string and convert them individually, perhaps within a for loop.  Just a suggestion, and let us know how it turns out.

Regards,
Travis G.
Applications Engineering

Message Edited by Travis G. on 04-03-2006 03:57 PM

0 Kudos
Message 2 of 3
(2,395 Views)
Hey Travis G.,

Thanks for the great suggestion. It turns out that the reference number was set to zero, and so right before the output my values were all being mulltiplied by zero. I didn't see it because the case structure is default false, not true as in the picture I posted. Should have thought of that! Thanks for all the help,
Russ
0 Kudos
Message 3 of 3
(2,378 Views)