Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

I am trying to create a spreadsheet file from an array.

I keep getting an error 8 when trying to run my program.  I am writing an array into a spreadsheet file, but the program cannot open the file path. 
0 Kudos
Message 1 of 9
(4,890 Views)
You've posted to the instrument control forum. What language are you using? I'm going to make a wild guess and say it's LabVIEW. In LabVIEW, error 8 is a permission error so a file you select must be enabled for read/write if youwnat to append to an existing file and you have to have windows write permissions for that folder if you are attempting to create a new file.
Message 2 of 9
(4,879 Views)
Your assumption was correct and I have fixed the problem.  I am getting another error after the program runs for a while.  It is a Labview Error 6 GPIB Read error.  I thought I had fixed this problem by making the GPIB read function asynchronis, but I just got the error again.  I am using a PCI cable to measure two channels of an optometer.  I send a write command to the device to send channel 1 readings then I send the read command.  I then send a write command to the device to send channel 2 readings and then I send the read command.  Let me know if this is the correct way to take readings from two channels.
0 Kudos
Message 3 of 9
(4,859 Views)
That would be the general method unless there is a single command that will return both channels. The error you are getting is ' I/O operation aborted' and it may be that you are attempting to do the operations in parallel so that the command from one write is interupting one of the other commands. Are all of your VISA Writes and Reads done in sequence with error in/error out connections between them? When you do the VISA Read, are you requesting enough bytes? You can put some large number in the number of bytes to read. Making the VISA Read synchronous or asynchronous will have no affect. You are sending commands to a single instrument and an instrument can only process a single command at a time. Post an image of your code or the actual VI.
0 Kudos
Message 4 of 9
(4,820 Views)
I went ahead and sent both write commands at the same time.  This seems to fix the problem.  I have not tried to send both read commands at the same time, but I will try this on Tuesday after Thanksgiving, as I am off work till then.  I will post my vi. on Tuesday as well.  I did not connect any of the error ins or error outs as I was not exactly sure what to connect.  This is my first Labview program so I know there are probably a lot of things that could be done better.  I would really appreciate your advice on what I can do to improve the program after I post it on Tuesday.  Thanks for your advice so far. 
0 Kudos
Message 5 of 9
(4,809 Views)

Do NOT send write commands at the same time. You have to do things sequentially. Doing these in parallel is just the opposite of what I said to do and is the cause of your error. Your VI should look something like the picture below. You have to use the error in/out connections to enforce dataflow and since LabVIEW is a dataflow language, this is basic to understanding how it works and how to write programs that work.

Message Edited by Dennis Knutson on 11-17-2006 01:10 PM

0 Kudos
Message 6 of 9
(4,807 Views)
I decided to go ahead and use the code that you posted.  This also works for a while and then I get an error code 1073807339 VISA read error.  This seems to be about the same as the error code 6 I was getting for the GPIB read.  I placed a stop button in the while loop and whenever I press it I get the error code 1073807339.  But like I said above sometimes the error code just comes up after a few measurements. 
0 Kudos
Message 7 of 9
(4,741 Views)

That error is "Timeout expired before operation completed" and is quite a bit different than I/O Operation Aborted. In most cases, with a GPIB instrument, you get this error during a read when the instrument has no data as a result from a measurement. The buffer is empty so the VISA Read times out when attempting to do the transfer. Why the instrument has no data could be the result of a couple different things. In hardware triggered measurements, the trigger condition might not be present. It could also be possible that you are requesting data too fast for the instrument to acquire it. You might want to put a delay in the while loop to see whether that fixes the problem.

You haven't mentioned the make and model of the instrument you are using. That type of information is helpful. Someone on the forum may have experience with it and could provide additional help. Have you searched http://www.ni.com/devzone/idnet/default.htm to see if there is a driver already written for your instrument?

0 Kudos
Message 8 of 9
(4,734 Views)

I am using a UDT Instruments S380 Dual Channel Optometer.  I believe I found the reason for the error.  I was sending "F1AG" as the write command, which asks for data from channel 1, sets the autorange, and go.  I changed it to simply "F1".

0 Kudos
Message 9 of 9
(4,728 Views)