LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Intermittent issues communicating to USB device, but only with executable version

I have a program that communicates to a Keithley 2100 DMM via USB.  Currently runs in LabVIEW 2015 (was created in earlier version).  The program basically measures total indicator runout using a vibration probe, measuring 200mv/mil.  DC voltage only.  The program runs perfect on my origin laptop, even the application, on the original laptop.  But when I make an exe and deploy to the target machine, it works fine for a while but eventually bombs out with -410 query interrupted.  However, it might run fine for hours and then give me this error.  The target machine is Win 7, 64 bit, with the Keithley Drivers already installed.

 

As a bandaid I have really dumbed down my SCPI code to talk to the Keithley and it seems to be running better, but time will tell.  However, with the dumbed down code, I and not turning on averaging and not determining a resolution.  This is all default to the DMM.  Thus now my graph for the DC voltage has a glitch or freeze every second or so.  Like it reading 100 samples and reporting the reading or something.

 

I did play around with their resolution setting, called NPLC (power line cycles) where 1 PLC = 16.67ms.  If I changed it to .1, the graph of voltage DC is smooth and the program is very smooth.  I would also combine that with turning on averaging and setting it to read 10 or 5 sample (I was playing with both).  However, this additional SCPI code seems to be the issue, but only on the target PC, and the original PC.

 

I know some might say this is a Keithly forum post, but I have gotten a lot of valuable information from this forum.  

Download All
0 Kudos
Message 1 of 5
(2,929 Views)

Can someone take a look at my programs and just tell me if i am doing anything completey stupid as far as talking to the Keithley?  I am really not using Keithley vi.s to talk to the instrument, just the error querey.  Im not sure uf this is good or bad.  Also, is the 4096 bytes good for the read?  

0 Kudos
Message 2 of 5
(2,905 Views)

Here is a list of SCPI error codes: http://na.support.keysight.com/pna/help/latest/Support/SCPI_Errors.htm.

 

What is happening is you are sending a new command before the old one has completed.  This could be happening only in the executable because you are on the edge of this conditon anyway, and optimizations that happen during the building of the executable causes you to go over the edge.

 

I haven't been able to look at your code, but see if the command you are using is capable using the *OPC? command.  With compatible commands, this instructs the equipment to return something (usually a "1" or some variation, like "01") to the read buffer when the command has completed.  Since this is now a query - i.e., a command write follwed by a read - the application will not proceed until something is detected in the read buffer.  This will stop your computer from sending commands before the equipment is ready.  In fact, it's good practice to use *OPC? wherever possible to ensure that the computer isn't trying to send commands when the equipment isn't ready.

 

This is particularly useful when measurement times vary.  You only wait as long as you need to - no more, no less.

 

 

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 3 of 5
(2,885 Views)

I went looking for a link for suggestions on setting up VISA, but didn't find it.  However, here are some hints:

  • Since many VISA protocols work as Command/Response (you send a Command, such as "Read", and the device sends back a Response), you need (a) to wait for the Response to be present, and (b) be able to read all of the Response.
  • One way to do this is to configure VISA to use Termination Characters (typically <CR> or <LF>).
  • When VISA notifies you that a Response has been received (and, right now, I don't recall how it does this, but know that Termination Characters are involved), you then query the Bytes at Port property so that you can configure the subsequent VISA Read properly.
  • Doing these things makes it more likely that you won't get "hung up" while doing serial transfers.  However, you do want to have Error Handling enabled, because (in my experience) Serial Communication does have a tendency to either "get stuck" or "throw errors" -- not sure if this is "noise in the signal line" or something else ...

Bob Schor

0 Kudos
Message 4 of 5
(2,866 Views)

@Bob_Schor wrote:

I went looking for a link for suggestions on setting up VISA, but didn't find it.  However, here are some hints:

  • Since many VISA protocols work as Command/Response (you send a Command, such as "Read", and the device sends back a Response), you need (a) to wait for the Response to be present, and (b) be able to read all of the Response.
  • One way to do this is to configure VISA to use Termination Characters (typically <CR> or <LF>).
  • When VISA notifies you that a Response has been received (and, right now, I don't recall how it does this, but know that Termination Characters are involved), you then query the Bytes at Port property so that you can configure the subsequent VISA Read properly.
  • Doing these things makes it more likely that you won't get "hung up" while doing serial transfers.  However, you do want to have Error Handling enabled, because (in my experience) Serial Communication does have a tendency to either "get stuck" or "throw errors" -- not sure if this is "noise in the signal line" or something else ...

Bob Schor


-410 query interrupted is a SCPI-specific error which means you sent another command while the equipment was still processing the last one.  I think everything is working fine except the commands aren't sent in such a manner as to let the equipment control the flow of data - i.e., not giving the equipment a chance to process the command.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 5 of 5
(2,862 Views)