Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Has anybody used the GpibDevice.WritefromFile method with VB.Net? It seems to ignore multiple lines in the data file.

The routinge properly reads a single line and sends the data to the measurement device. However, for large data files, it is not practical to write all the strings in one line of the data file, instead it would be practical to write every data point in a new line. The GpibDevice.WriteFromFile method stops reading at the end of the first line. All following lines are ignored resulting in an error message because the number of data points transmitted to the measurement equipment is not correct (most of the points are missing).
0 Kudos
Message 1 of 3
(3,224 Views)
WriteFromFile is intended to be used when the file contains commands that are in exactly the format the instrument expects. Most devices don't accept commands with newlines embedded in them. Typically, they treat newlines as an "end of message" indicator. This is probably why you're seeing this problem. You can confirm this by manually loading the file, putting into a buffer, and, then writing out that buffer. I don't know how much data you're dealing with here, though. One way to work around this problem is to generate the file in such a way that the contents are in exactly the format (i.e., no line breaks) that the device expects. Are intending for these files to be human readable/writeable? If so, then you will need to do something in your app to load the file and convert the contents into something that the device can accept.
 
Hope this helps,
Glenn
0 Kudos
Message 2 of 3
(3,210 Views)

Hi Glen,

thanks for the feedback. In my case, I'm trying to program I/Q data into a signal generator (ESG from Agilent). The ESG has a couple of MB memory available for I/Q data. The string that the generator expects is basically a keyword and all these I/Q values formatted as 2-byte integer numbers attached to the leading keyword (the whole thing is ONE string). The gpibdevice.writefromfiel works fine for a single line, but it gets a problem for multiple lines. As you say, the newline is not accepted here. I'm wondering what happens if I produce an extremely long string in VB and write this very long string to a file (without any newlines). Maybe VB.net can then also read such a thing. I'll try.

Thanks,

Ruediger

 

0 Kudos
Message 3 of 3
(3,207 Views)