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