LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help me troubleshoot: ERROR -1073807339.

Solved!
Go to solution

I'm trying to create a VI that reads voltage data off of all 10-input channels of a Low Current Scanner Card of a 6517b Keithley Electrometer. I currently have a VI that reads data of input 1, I'm currently troubleshooting a new VI I made which is supposed to read inputs 1 and 2 at the same time and then display it on a multiple input waveform chart. The issue happens when the Second Visa Read function is outputting data to the VISA Close function. I receive a timeout error:2024-03-22 (12).png

 

2024-03-22 (11).png

0 Kudos
Message 1 of 19
(917 Views)

Try the shipping examples in Keithley 6517B Electrometer/High Resistance M - Instrument Driver 

Download and extract the content to <LabVIEW>\instr.lib

-------------------------------------------------------
Control Lead | Intelline Inc
Message 2 of 19
(911 Views)

This error occurred, because you reading same port in two parallel executed reads - this is kind of race condition:

 

 

Screenshot 2024-03-24 07.10.14.png

Usually when working with multichannel device like this, you might have different commands to read out single channel or all channels, but it is always Write/Read pair:

 

Screenshot 2024-03-24 07.16.10.png

Message 3 of 19
(867 Views)

Ah, I see what you’re saying. Do you think that adding another VISA Write to read the second channel would fix it? Also, Is that an example that you’ve attached? Could I see where you got it from?

0 Kudos
Message 4 of 19
(861 Views)
Solution
Accepted by cArol32

@cArol32 wrote:

Ah, I see what you’re saying. Do you think that adding another VISA Write to read the second channel would fix it? Also, Is that an example that you’ve attached? Could I see where you got it from?


Yes, sure this will help, but also here avoid race condition. If you will try to send something and read parallel, this will not work, you should do this sequentially:

Screenshot 2024-03-24 08.05.52.png

Also important to read exact amount of bytes which will be returned by instrument. If you will try to read too much, then you will get timeout again. But if you will try to read less amount of bytes, then unreaded bytes will be "queued" in serial, then you will get these on next read operarion, and this will make a problem to parse feedback. Termination character is also important. Refer to the API doc supplied with you instrument. The screenshot above was taken from the Keithley 6517B Electrometer/High Resistance M - Instrument Driver , more exactly from keithley_6517\Keithley 6517\Public\Data\Read Measurement Data.vi. You can try to use it, but strange, I haven't seen MEAS:VOLT command. Anyway, if you will download the driver, then open VI Tree.vi, here all SubVIs are collected on one diagram:

Screenshot 2024-03-24 08.13.17.png

In general nothing wrong if you program everything "from the scratch", using low level comm, but using this may save your development time, if the provided driver is compatible with your device.

Message 5 of 19
(856 Views)

Yes, that makes sense. I did try to read it sequentially at first but It would not work properly probably because I didn’t pair the Write functions and the Read functions as it should’ve been. I’ll put this to practice and see how it goes. Thank you, this has been very helpful! 

0 Kudos
Message 6 of 19
(834 Views)

How would I know the exact amount of bytes I need to read? I've tried the code but I get a query unterminated =-420 error on the machine and a timeout error on my code as you mentioned.

0 Kudos
Message 7 of 19
(744 Views)

@cArol32 wrote:

How would I know the exact amount of bytes I need to read? I've tried the code but I get a query unterminated =-420 error on the machine and a timeout error on my code as you mentioned.


From the documentation, of course, I haven't seen instrument with variable length so far.

In worst case you read byte to byte, until timeout occurred, in easiest way something like this:

Screenshot 2024-03-25 16.32.19.png

If you have unterminated comms, then obviously VISA Configure Serial Port shall be properly configured (Termination OFF).

Also please read this topic: Serial Read unknown bytes no termination character.

0 Kudos
Message 8 of 19
(737 Views)

I'm sorry if it's a silly question but how do I do that? How can I configure VISA to Termination OFF?

0 Kudos
Message 9 of 19
(717 Views)

@cArol32 wrote:

I'm sorry if it's a silly question but how do I do that? How can I configure VISA to Termination OFF?


Ups, sorry, all the time I was sure that you're working with pure serial port, and mean this one:

Screenshot 2024-03-26 02.47.08.png

but your device is GPIB. Then this is starting point for you: GPIB Instrument Control Tutorial.

Termination in this case is something different, GPIB data transfers are terminated either when the GPIB EOI line is asserted with the last byte of a transfer or when a preconfigured end-of-string (EOS) character is transmitted.

 

Screenshot 2024-03-26 02.43.33.png

0 Kudos
Message 10 of 19
(687 Views)