VISA read timeout error

Good day to all,
I have this problem with my LabView program. It is being used to interface with a Energy Meter to retrieve the data. I am able to execute "Open" and "Write" VISA, but am unable to execute "Read" VISA. Attached below is the screenshot of the error.
EKI1521 is being used to interface serial connection from the meter to ethernet, connecting to the computer with
labview program. Attached are the settings for the EKI1521.
This is extracted from the main program after narrowing the problem down to the VISA Read function. The subVIs in this program are proprietary protocols of the meter and does not contribute to this Reading error.
It might be interesting to note that I am able to run another program to interface with another meter using Modbus protocol. It also used the same EKI1521 with the correct VCOM settings. (This should free the EKI1521 from any faults). 
Thanks & Regards,
Andrew
Attachments:
1.png ‏169 KB
2.png ‏210 KB

Hi,
Stop me if I make a mistake, but you don't set Visa properties in your Labview code (type, baudrate... etc).
Best regards,
V-F

Similar Messages

  • VISA READ timeout error - multiple GPIB resources

    Hi,
    I am working on a 3 instruments GPIB network (optical attenuator, fiber amplifier, spectrum analyzer), controlled using VISA sessions in Labview. When run separately, the three corresponding VIs (which are located in three different Labview projects) work as expected. However, when they are ran simultaneously, one of them gives VISA READ -1073807339 timeout errors. These errors seem to happen when an other instrument is sending / receiving data / instructions at the same time as it is.
    The exact context for these error is either :
      -  an other VI is running, which includes sending several queries and reading the answers every 100 ms,
      - upon starting the failing VI, I get a  timeout error from one of the first subVI containing a VISA READ operation to be executed (sometimes initialize.vi (in state 1), sometimes one of the subVIs ran from the Idle state (state 0) upon timeout of the event structure).
    or :
      - the failing VI is running,
      - upon starting an other VI, which includes repetitively sending queries and reading answers, the failing VI throws an error from one of the first subVI containing a VISA READ operation to be executed (one of the subVIs ran from the Idle state (state 0) upon timeout of the event structure).
    What I tried :
      -  gradually increasing the delay between the VISA WRITE and READ operations for the relevant instrument (from 10 ms to 10s), to no avail. More puzzling is my obseration that, when this VI is run alone, increasing the WRITE / READ delay leads to the same timeout errors. I could not find any mention of such behavior through google and forum searches. Hopefully this can point to a solution to the main issue,
      - switching between synchronous and asynchronous VISA WRITE / READ operations,
      - reordering the GPIB network from a star topology to a linear topology (all three instruments do have different GPIB addresses in case anyone wonders).
    My thoughts :
    It seems to me that the error is related to a delay introduced between a VISA query and its associated read operation by the transmission of another query to another instrument in the same GPIB network. However I have no idea why transmitting a query to another instrument would introduce such a delay, or why this delay would lead to a timeout error (and only from one instrument, while the write / read VIs in each driver are basically the same). Hopefully a more experienced Labview-er will be able to shed some light on my issue.
    Included is the project containing the failing VI (main.vi) and the custom driver it makes use of. 
    Solved!
    Go to Solution.
    Attachments:
    Manlight EDFA Control - Failing VI.zip ‏73 KB
    EXFO FVA 3150 - Driver.zip ‏348 KB

    Thank you for your input crossrulz. This is indeed what I realized while looking into semaphores.
    Let me first make our architecture clear so that I'm 100% certain we are talking about the same thing. We have a NI GPIB-USB-HS GPIB Controller connected to a linear GPIB network of three instruments. I was convinced that a network allowing up to 15 instruments to be connected at the same time would allow for parallel operation, but it seems I was mistaken.
    I like how semaphores work, and I don't see any obstacle to gathering all these VIs into one project. My conception of a Labview project was that one Labview project was intended to gather subVIs, libraries and controls used in a more complex "main" VI, which would ultimately be made into a single standalone executable. It seems I was mistaken too and that a single Labview project should be used to gather several standalone VIs designed to work together, and their subVIs. Hopefully I got it right now.
    The other option that you suggest for accessing the same GPIB bus from different projects (having a TCP control interface running and controlling communications through the bus) might indeed be a bit overkill for what I'm tring to achieve, and I would need to spend too much time learning and developing it.
    A last option I looked into is the VISA Lock Async VI, but I don't understand yet if 1. locking the VISA session for an instrument in the bus would lock the entire bus ; 2. if it would be possible to use this approach with VIs running in different projects and 3. if it would not just yield errors when one VI is trying to access the locked GPIB bus instead of making it wait until the resource is available.
    I'll look further into these options today, but would appreciate any additional information / advice you might have. Thank you.

  • How to run vi continuous​ly when VISA read timeout happens

    Hello,
    I am using LabView 2010 to read an Agilent 6000 series Oscilloscope. The Oscilloscope reads data from another experimental machine which fails occasionally due to sample failure. When the machine fails, it stops sending signal to the oscilloscope and leads to the VISA read timeout error and the whole vi is terminated.  Is there a way that I can continuously run the vi when the error happens? For example, when the error happens, it stores the error in the error wire. When the vi read the error code from the wire, it sends a command to stop my experimental machine then stop the vi. 
    So far, it just simply stops during executing the visa read function. In this case, why do we have error in and out? The vi simply stops when the error happens. 
    Thanks
    Lawrence
    Solved!
    Go to Solution.

    I'll start of with automatic error handling. By default, LabVIEW enables the automatic error handling. So consider the case like the one below,
    If let's say the VISA Read returns an error, but you did you pass the error information to VISA Close, what will happen is that LabVIEW will highlight the VISA Read (since the error comes from that function), pause the execution at the VISA Read and an error dialog box will appear. From the dialog box, it will prompt to either continue (Move on to the VISA Close) or stop (LabVIEW will stop the VI at VISA Read)
    Now, consider another scenario like this,
    By passing the error information from one function to another, let's say if VISA Read returns an error, that error will pass to VISA Close and finally to Simple Error Handler.vi. So Simple Error Handler will generate error dialog box after all the VISA operation is completed. This is called manual error handling (It can be enabled by just wiring the error information from one function to another and terminates at Simple Error Handler).
    http://www.ni.com/gettingstarted/labviewbasics/han​dlingerrors.htm
    As for VISA Close, here is the information about VISA Close.
    http://zone.ni.com/reference/en-XX/help/371361K-01​/lvinstio/visa_close/
    See that button on the left side of this post...
    If you feel my post is helpful, all you need is just (at most) 2 seconds to click that button, to show your appreciation. Thank you~~

  • VISA read timeout

    I dont know why im getting a timeout error at the VISA read function(error says "timeout expired before operation completed"). I made sure the Labview serial port and my devices serial port are configured exactly the same. I even tested hyperterminal with the same port settings as in labview and it works perfectly but my labview program gives me an error. My device terminates each command it sends with a carriage return so i set up VISA READ to stop reading data when it  encounters the CR character. I also made sure the carriage return was infact being sent by my device. Any thoughts?
    Solved!
    Go to Solution.

    I think it's not seeing your termination character on the read and/or write.  When I send a string to the serial bus, I always use "Concatenate Strings" to add the appropriate termination character(s) to the end.  Assuming your read termination is CR/LF, I've always had better luck stopping on the LF and stripping the CR with "Trim Whitespace."
    Also, don't be afraid of making the timeout a second or two.  If everything is going right, it will (normally) give the serial port plenty of time to complete its operation, but if things are going wrong, it will give you time to "notice" something is wrong.
    Bill
    (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.

  • Visa Read Timeout Occurs with multiple Reentrant VI Calls

    I have written a test application in Labview (6.1) which will be used to test (burn-in) up to 15 serial instruments through a 16 Port USB->RS232 Hub. Here's how it works:
    When the App loads, I am transmitting a Connect command to each of 15 com ports (one-at-a-time) using VISA. If I receive the proper response from the unit on that port, I add the port to an array and continue on to the next system. Once I've found all systems on the hub, I wire my array of active Visa references to a for loop in which I open up to 15 reentrant VIs which will run in the background in parallel. Each of these reentrant VIs (all are idential with the exception of the Visa Resource they use) running in the background are sending commands to the the respective instrument and receiving a response. One Function in particular "Get Unit Status" is important and the response determines whether or not the instrument is functioning correctly. Here's the problem -- In my Main Loop, I am continuously acquiring indicator values from each of the reentrant VIs that are running in the background. After a period of time (not consistent) I will lose communication with a port (the symptom is no response from the unit). I've looked closely at the COMM engine I created and found that the Visa Write function is completing without error, then when I perform a Visa Read I immediately get the "Timeout occured before operation completed" error (please keep in mind that this occurs after 100-5000 successful attempts at writing/reading). Eventually another port will drop out, followed by another. This seems to stop occurring and the remaining systems run to completion without a problem.
    Some background on what how I'm setting up my Visa Sessions...
    When I originally scan for systems (before I load and run the Reentrant VIs)
    - Init Visa Port
    - 19200, 8, N, 1
    - Use Termination = True
    - Timeout = 400mS (I've tried larger values already) 400mS should be plenty
    - Termination Char=13 (/r)
    - Open Visa Session
    - Visa Write "CONN18/r" (the command required to connect to my instrument)
    - Visa Read with 1 for requrested byte count to read 1 byte at-a-time, concatenating the results until /r is received (or 1000mS timeout occurs -- this is not a VISA timeout) I've also tried 16 for requested byte count and just waiting for Visa to timeout -- both methods work.
    Once all 16 ports are scanned I Close ALL of the ports using the Visa Close Function.
    It is important to know at this time that I "AM" using proper wiring flow to ensure open occurs before write, write occurs before read, etc.
    I'm assuming at this time that all of my Visa sessions are closed.
    On to the Reentrant VIs:
    Inside each reentrant VI I first Initialize all of my variables and Init/Open a 'New'? Visa session using the same parameters mentioned above.
    Then I enter the "Run" case structure where all of the communication begins.
    I am using the same Communications Engine to operate the instrument as before (the only difference being that all of the VIs in the comm engine are now reentrant and operate at higher priorities) I have actually saved two different versions of the engine (one for the reentrant calls and one for when I first scan for systems from my Main GUI).
    When I init the reentrant VI, I am placing the Duplicate Visa Resource output of my Visa Open Function on a shift register. When I enter the Run case, it takes the Resource from the register on the left, wires through any Comm Engine Vis then back out to the shift register on the right and keeps going for a 12-hour period or until "Get Unit Status" has returned 60 naughty results.
    On my Main GUI I am continuously (every 500mS) I am Getting certain Indicator Values from each reentrant VI AND I am also setting some control Values on each reentrant VI. There is no VISA interaction between each Reentrant VI, and the Main GUI.
    As I said earlier, up to 15 systems will run for a time, then one will stop responding, followed by another, and another until a few remaining systems will run to completion.
    Any advice as to why I'm encountering the timeouts with the VISA read fucntion as I have metioned would be appreciated. I managed to find one suggestion which uses the Bytes at Port function to ensure there is data at the port before doing a Read otherwise, skip the read and retry the whole operation -- I haven't tried this yet.
    Sorry for the wordiness of my question. If anyone would like some screen shots of portions of my code (I can't submit the actual code because some of it is confidential) I'd be happy to post them.
    Doug.

    Hi Doug,
    The first thing I would recommend is the solution you have already found, to check and see if there is data at the port before attempting a read. I would be interested to see if this will solve the problem. Does there seem to be any trend to which ports have this timeout error? How many ports does it cut down to before operation seems to continue as expected? Does this number vary, or is it always the same number of ports? I think the best thing to do will be to identify constant attributes of how the error is occurring so that we can narrow it down and see what is going on.
    John M

  • VISA Read Timeout and VISA Write not working

    I'm writing a program that sets a triangle wave pattern voltage (using Triangle Wave VI) to a DC power source (GWInstek PST-3202) through a RS-232 connection.  I know my instrument parameters are set up correctly because I've been able to control this power source using a different VI with the same parameters.  I also know I am connected to the power source because I can talk to it using MAX.  I have a string indicator before my VISA Write statement that shows me the command being sent to VISA Write.  It shows the correct syntax for setting a voltage on this instrument.  However, when I run the VI, the voltage is not changed on my instrument, even though the correct command is sent to the instrument.  After the VISA Write operation I have inserted a VISA Read function in order to read the newly set voltage from both a numeric and a waveform indicator.  Using the Error Out cluster I am able to see that there is a timeout error from VISA Read.  I thought perhaps I needed to clear or flush the buffer after each Read statement, but that didn't work either.  I'm stumped as to why VISA Write isn't writing to the device.  I have included my VI below, as well as the initialization subVI for the power supply.  
    Attachments:
    Triangle Volt Mod.vi ‏27 KB
    GW Instek initialization.vi ‏18 KB

    Yep, you need to append the End of Line character to the end of your command.  And for your read to work properly, you need to request the data.  That requires a querry command to be sent.  Look closely at the differences in command and communication structures between your working VI and your mod.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • GPIB locks up after about 15 minutes with a VISA Write Timeout Error

    I am using GPIB to control two electronic loads.  After about 15 minutes of runtime on the program, the GPIB communication locks up.  A probe reveals an error message about a Visa Write Timeout.  When this occurs, I have to stop the program, cycle the power on the two loads, and then restart the LabView program. When addressing the loads, I use the same routine every time.  1) Initialize communication, 2) Send command/request, 3) Close communication.  I thought I might have been overloading the GPIB bus, so that's when I added the close command after each sequence. However, it didn't seem to make a difference.  Could there be a compatability issue with the GPIB of the loads and the NI GPIB or Windows version? (I'm using XP and LV 10)  The electronic loads are older models, so I'm not sure how that impacts this scenario.

    Hi kcarbon80, 
    As this thread is over 2 years old, I do not know what solution was found for the previous problem being addressed, if any. However, if the device is locking up in the middle of your program, you may want to try clearing the device programmatically using the DevClear.vi that comes with the NI 488.2 driver. 
    I hope this helps. 
    Best Regards,
    Thomas B.
    National Instruments
    Applications Engineer

  • Socket Read Timeout error in weblogic logs happening every 30 min

    One of my customer is getting Socket Read Time out error, when creating connection pool.
    java.sql.SQLException: Socket read timed out
         at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:74)
         at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:135)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:203)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:489)
         at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:439)
         at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:640)
         at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:205)
         at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
         at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:554)
         at weblogic.jdbc.common.internal.ConnectionEnvFactory.makeConnection(ConnectionEnvFactory.java:327)
         at weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(ConnectionEnvFactory.java:227)
         at weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:1193)
         at weblogic.common.resourcepool.ResourcePoolImpl$ResourcePoolMaintanenceTask.timerExpired(ResourcePoolImpl.java:2451)
         at weblogic.timers.internal.TimerImpl.run(TimerImpl.java:273)
         at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Caused By: oracle.net.ns.NetException: Socket read timed out
         at oracle.net.ns.Packet.receive(Packet.java:333)
         at oracle.net.ns.DataPacket.receive(DataPacket.java:94)
         at oracle.net.ns.NetInputStream.getNextPacket(NetInputStream.java:176)
         at oracle.net.ns.NetInputStream.read(NetInputStream.java:121)
         at oracle.net.ns.NetInputStream.read(NetInputStream.java:96)
         at oracle.net.ns.Packet.extractData(Packet.java:443)
         at oracle.net.ns.AcceptPacket.<init>(AcceptPacket.java:108)
         at oracle.net.ns.NSProtocol.setNetStreams(NSProtocol.java:697)
         at oracle.net.ns.NSProtocol.connect(NSProtocol.java:386)
         at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1088)
         at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:305)
         at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:642)
         at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:205)
         at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:554)
         at weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(ConnectionEnvFactory.java:227)
         at weblogic.common.resourcepool.ResourcePoolImpl$ResourcePoolMaintanenceTask.timerExpired(ResourcePoolImpl.java:2451)
         at weblogic.timers.internal.TimerImpl.run(TimerImpl.java:273)
         at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Any suggestions?

    Could be a firewall rule terminating an idle connection?

  • Read timeout error when invoking webservice

    When I test one of our RPC style webservices from my Java
    client, I get this error at random intervals :
    org.xml.sax.SAXParseException: Unbalanced ELEMENT got:detail expected:init at
    weblogic.xml.babel.baseparser.SAXElementFactory.createSAXParseException(SAXElementFactory.java:67)
    at weblogic.xml.babel.parsers.StreamParser.streamParseSome(StreamParser.java:136)
    at weblogic.xml.babel.parsers.BabelXMLEventStream.parseSome(BabelXMLEventStream.java:46)
    at weblogicx.xml.stream.SubEventStream.parseSome(SubEventStream.java:48) at weblogicx.xml.stream.SubElementEventStream.parseSome(SubElementEventStream.java:38)
    at weblogicx.xml.stream.SubEventStream.parseSome(SubEventStream.java:48) at weblogicx.xml.stream.SubElementEventStream.parseSome(SubElementEventStream.java:38)
    at weblogicx.xml.stream.XMLEventStreamBase.hasNext(XMLEventStreamBase.java:135)
    at weblogicx.xml.stream.helpers.TextBuilder.process(TextBuilder.java:23) at weblogic.soap.codec.SoapEncodingCodec.decode(SoapEncodingCodec.java:194)
    at weblogic.soap.codec.SoapEncodingCodec.decode(SoapEncodingCodec.java:145) at
    weblogic.soap.codec.CodecFactory.decode(CodecFactory.java:66) at weblogic.soap.codec.Operation.read(Operation.java:97)
    at weblogic.soap.codec.SoapMessage.readOperation(SoapMessage.java:200) at weblogic.soap.codec.SoapMessage.read(SoapMessage.java:130)
    at weblogic.soap.WebServiceProxy.receive(WebServiceProxy.java:480) at weblogic.soap.WebServiceProxy.invoke(WebServiceProxy.java:431)
    at weblogic.soap.SoapMethod.invoke(SoapMethod.java:186)
    it seems to be caused by a read time out :
    Server side error: java.io.InterruptedIOException:
    Read timed out at java.net.SocketInputStream.socketRead(Native Method) at java.net.SocketInputStream.read(SocketInputStream.java:86)
    at weblogic.servlet.internal.PostInputStream.read(PostInputStream.java:124) at
    weblogic.servlet.internal.ServletInputStreamImpl.read(ServletInputStreamImpl.java:97)
    at java.io.FilterInputStream.read(FilterInputStream.java:114) at java.io.PushbackInputStream.read(PushbackInputStream.java:164)
    at java.io.FilterInputStream.read(FilterInputStream.java:93) at weblogic.xml.babel.reader.XmlReader.(XmlReader.java:247)
    at weblogic.xml.babel.reader.XmlReader.createReader(XmlReader.java:124) at weblogic.xml.babel.baseparser.BaseParser.init(BaseParser.java:98)
    at weblogic.xml.babel.parsers.StreamParser.(StreamParser.java:42) at weblogic.xml.babel.parsers.BabelXMLEventStream.startDocument(BabelXMLEventStream.java:28)
    at weblogic.soap.server.servlet.StatelessBeanAdapter.getXMLStream(StatelessBeanAdapter.java:216)
    at weblogic.soap.server.servlet.StatelessBeanAdapter.getInputMessage(StatelessBeanAdapter.java:151)
    at weblogic.soap.server.servlet.StatelessBeanAdapter.doPost(StatelessBeanAdapter.java:113)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2456)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2039)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    Does anybody have som hints for this situation?
    Regards,
    Per Mengshoel

    Hi all,
    as many developers I have encountered the famous "java.rmi.MarshallException:(1)Missing end tag for Body or Envelope" during the development of my WS app for J2ME (JSR 172).
    It is correct that is the empty tag <soapenv:Header /> causing this error.
    To fix this error, it is necessary to stop the server to generate this empty header in the response stream.
    I have fixed this error for Axis2: unfortunaly it is necessary to modify a class in Axiom library. This library is used in Axis2 to produce the SOAP response, you can download the source code at http://ws.apache.org/commons/axiom/source-repository.html.
    Here the class to modify:
    axiom\modules\axiom-impl\src\main\java\org\apache\axiom\soap\impl\llom\soap11\SOAP11Factory.java
    by commenting the line 273 in the method called getDefaultEnvelope() to prevent the empty header insertion in SOAP response:
    public SOAPEnvelope getDefaultEnvelope() throws SOAPProcessingException {
            OMNamespace ns =
                    new OMNamespaceImpl(
                            SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI,
                            SOAP11Constants.SOAP_DEFAULT_NAMESPACE_PREFIX);
            SOAPEnvelopeImpl env = new SOAPEnvelopeImpl(ns, this);
            //createSOAPHeader(env); the line to be commented
            createSOAPBody(env);
            return env;
        }Finally you have to recompile Axiom using Maven to obtain the fixed package axiom-impl.jar and to replace this package on the lib repository of your Axis2 server.
    A little tricky to fix this bug but now my app runs perfectly ;)
    Enjoy!
    Romain Pellerin
    http://www.gasp-mobilegaming.org

  • Memory leak in Real-Time caused by VISA Read and Timed Loop data nodes? Doesn't make sense.

    Working with LV 8.2.1 real-time to develop a host of applications that monitor or emulate computers on RS-422 busses.   The following screen shots were taken from an application that monitors a 200Hz transmission.  After a few hours, the PXI station would crash with an awesome array of angry messages...most implying something about a loss of memory.  After much hair pulling and passing of the buck, my associate was able to discover while watching the available memory on the controller that memory loss was occurring with every loop containing a VISA read and error propogation using the data nodes (see Memory Leak.jpg).  He found that if he switched the error propogation to regular old-fashioned shift registers, then the available memory was rock-solid.  (a la No Memory Leak.jpg)
    Any ideas what could be causing this?  Do you see any problems with the way we code these sorts of loops?  We are always attempting to optimize the way we use memory on our time-critical applications and VISA reads and DAQmx Reads give us the most heartache as we are never able to preallocate memory for these VIs.  Any tips?
    Dan Marlow
    GDLS
    Solved!
    Go to Solution.
    Attachments:
    Memory Leak.JPG ‏136 KB
    No Memory Leak.JPG ‏137 KB

    Hi thisisnotadream,
    This problem has been reported, and you seem to be exactly reproducing the conditions required to see this problem. This was reported to R&D (# 134314) for further investigation. There are multiple possible workarounds, one of which is the one that you have already found of wiring the error directly into the loop. Other situations that result in no memory leak are:
    1.  If the bytes at port property node is not there and a read just happens in every iteration and resulting timeouts are ignored.
    2.  If the case structure is gone and just blindly check the bytes at port and read every iteration.
    3.  If the Timed Loop is turned into a While loop.
    Thanks for the feedback!
    Regards,Stephen S.
    National Instruments
    Applications Engineering

  • VISA Read over USB Problem: After a while the xBFFF0015 Timeout Error occurred

    Hi,
    I have trouble using labview with my non-NI USB device:
    The device is an analog input DAQ board. I was able to setup communication with the board using a VISA driver specifically created for this board and direct FW calls using the product's firmware specification provided by the manufacturer.
    This method has been working pretty good so far, but when I try to get large amount of data (64k samples @100ksps), the VISA Read returns the 'VISA: (Hex 0xBFFF0015) Timeout expired before operation completed.' error.
    Please see the attached screenshot of the block diagram for details.
    First, an 'analog input scan start' command is sent to the DAQ device, and then the vi tries to read all collected data from the device, once the right amount of data retrieved, or no more data is available the data collecting process (the while loop) ends and an 'analog input scan stop' command is sent to the DAQ device.
    The data collection starts with no problem, but after a while, in loop# 400, the VISA Read hangs and then returns the error mentioned above.
    I tried to increase the time out value, but it didn't help, the error occurred after the same number of loops, the VISA Read got hosed and the error occurred after the longer timeout expired.
    I also tried to add some delays in the loop, but it didn't help either.
    I am not sure what do I miss here and I would highly appreciate if anyone could give me some guidance how to solve this issue.
    Thanks,
    John
    Attachments:
    usb-read.png ‏18 KB

    I just wanted to specify that this is not an NI board avoiding to make people think this is a hardware issue. And I think that the rest of the code is irrelevant in this case.
    I believe that I don't use the VISA functions correctly. I assumed that someone who used these functions before would be able to point out the obvious steps missing in the data collecting process using the VISA functions.

  • Timeout error (Hex 0xBFFF0015) in NI VISA test panel when attempting to read from device

    Hello,
    I am attempting to control the set position of three daisy chained four-way actuator valves. They are VICI Valco and model # EUHA. I have them connected via RS-232 to USB into my computer. I was able to communicate with them when I sent some simple commands through hyperterminal and when I open MAX the devices appear and the panel says the devices are functioning properly. However, when I go into the test panel and try to run some default commands, I get the timeout error, 0xBFFF0015, when reading the command. Thank you for any help you can provide.
    Solved!
    Go to Solution.

    Okay I'm running it again today and I'm noticing that its displaying results when I attempt to read from the valve but still tells me it timed out. Aside from the timeout error, both hyperterminal and visa are providing comparable results. The two commands I have been trying to read from the valves are AM (to check what mode the actuator is set to) and CP (to check what position the valve is at).

  • Error -1073807253 occurred at VISA Read in transient SR830.vi VISA: (Hex 0xBFFF006B) A framing error occurred during transfer.

    Hi,
    I am have written a program with labview to make transient c-v measurement using a stanford research SR830 lockin amplifier. The program seems to be runing fine, but sometimes it is givvibg an error:
    Error -1073807253 occurred at VISA Read in transient SR830.vi
    Possible reason(s):
    VISA:  (Hex 0xBFFF006B) A framing error occurred during transfer.
    Error -1073807253 occurred at VISA Read in transient SR830.vi
    Possible reason(s):
    VISA:  (Hex 0xBFFF006B) A framing error occurred during transfer.
    but if I press ok, the program again starts running. What might be the poblem? BTW I googled a bit and I see that in the labview topic "RS-232 Framing Error with HP 34401A Mulitmeter" by pkennedy32 this is what is said about framing error:
    ""Framing Error" in an RS-232 context means a very specific thing - when the receiver was expecting a stop bit, the line was not in SPACE condition. This can be the result of:
    1... Baud rate mismatch (although other problems would likely crop up first).
    2... Data Length problem, If I send 8 data bits and you expect 7, the stop bit is in the wrong place.
    3... Parity setting mismatch - If I send 7 data bits + parity and you expect 7 data bits and no parity, the stop bit is in the wrong place.
    4... Mismatch in # Stop bits - If I send you 7 Data bits + parity + one stop bit, and you expect 7 data bits + parity + TWO stop bits, the second one might not be correct, although most devices do not complain about this.
    But, I must say that this is the same com port setting that I use to measure c-v hysterysis, but I never gt this error there.
    I attach the program herewith for your kind perusal. Please help me resolve this issue.
    Thanks in advance.
    Solved!
    Go to Solution.
    Attachments:
    transient SR830.vi ‏94 KB
    csac.vi ‏8 KB
    sr830 initialize1.vi ‏15 KB

    @Dennis Knutson  you are right I checked the read indicator in backslash mode, and instead of a \n it is sending \r. So I changed the \n in my write strings to \r. But, if I keep the CLOSE VISA outside my loop instead of inside as you suggested, the termination character appears to come in the middle of the read string instead at the end. And since the read terminates at the \r so it is displaying some junk value before the \r, but if I put the CLOSE VISA outside the loop and play along with the bytes at the read buffer, I see the whole read string with the \r  at the end of the string. But, whenever the values are in exponential form (when close to zero) like 6.938839 e-5, I always get a time out error whatever be the timeout that I put at the VISA initialize. And subsequently, if I stop the program and run it again the machine program hangs and I donot get any reading. Then after I close it again and start, sometimes it hangs for some more or starts working. If I put an arbitrarily large byte count at the READ VISA, then I always get the time out before the operation completed error.
    @ Ravens Fan I have removed the CSAC VI altogether and taking the CH! And CH” reading separately, instead as one string. So, no more issues with that.
    I use the control at the delay so that I can choose how much delay I want to set, and I use the math operation because I am using adding up the delay time to keep track of the time elapsed. Because in the end I have t plot a time vs. CH! And CH” readings.
    I am not sure but probably I am making some silly errors. Please help me out. 
    Attachments:
    transient SR830-2.vi ‏103 KB
    sr830 initialize1.vi ‏15 KB

  • Getting an VISANS timeout error even though VISA Status is 0

    I have an application that runs well on my development system but consistently fails at the user site giving out timeout errors even though the user experiences no time outs. Indeed, VISA returns a success status. Yet, it raises timeout exceptions such as in this segment from my trace log:
    DefaultSource, Verbose, 8, Setting timeout to 30000, "CONNECT", 2008-08-12 00:47:21Z, 2077539389311920
    DefaultSource, Information, 0, GPIB0::26::INSTR termination character set to 10, "CONNECT", 2008-08-12 00:47:21Z, 2077539630487436
    DefaultSource, Verbose, 8, Checking GPIB0::26::INSTR message available, "FR, CONNECT", 2008-08-12 00:47:21Z, 2077539636730532
    DefaultSource, Verbose, 8, Flushing read GPIB0::26::INSTR buffer, "FR, CONNECT", 2008-08-12 00:47:21Z, 2077539673800216
    DefaultSource, Error, 2, Flushing read GPIB0::26::INSTR buffer failed: NationalInstruments.VisaNS.VisaException: Timeout expired before operation completed.  VISA error code -1073807339 (0xBFFF0015), ErrorTimeout
       at NationalInstruments.VisaNS.Internal.ErrorChecker.CheckStatusAndThrow(Int32 status, VisaHandle visaObject)
       at NationalInstruments.VisaNS.Session.CheckStatusAndThrow(Int32 status)
       at NationalInstruments.VisaNS.Session.BufferedReaderService.NationalInstruments.VisaNS.Internal.IBufferedReader.Scan(String scanSpecifier, Int32& count, StringBuilder receiver)
       at NationalInstruments.VisaNS.MessageBasedSessionReader.CommonReadString(String scanString, Int32 count)
       at NationalInstruments.VisaNS.MessageBasedSessionReader.ReadLine()
       at isr.Visa.MessageBasedReader.ReadLine()
       at isr.Visa.GpibSession.ReadLine()
       at isr.Visa.Ieee4882.Instrument.ReadString()
       at isr.Visa.Ieee4882.Instrument._flushRead(). VISA status=Success, "FR, CONNECT", 2008-08-12 00:47:21Z, 2077539717184364
    DefaultSource, Verbose, 8, Flushing GPIB0::26::INSTR write buffers, "FW, CONNECT", 2008-08-12 00:47:21Z, 2077539723797900
    DefaultSource, Verbose, 8, , "WRITE, FW, CONNECT", 2008-08-12 00:47:21Z, 2077539731761192
    DefaultSource, Error, 2, Flushing GPIB0::26::INSTR write buffers failed: NationalInstruments.VisaNS.VisaException: Timeout expired before operation completed.  VISA error code -1073807339 (0xBFFF0015), ErrorTimeout
       at NationalInstruments.VisaNS.Internal.ErrorChecker.CheckStatusAndThrow(Int32 status, VisaHandle visaObject)
       at NationalInstruments.VisaNS.Session.CheckStatusAndThrow(Int32 status)
       at NationalInstruments.VisaNS.Session.BufferedWriterService.NationalInstruments.VisaNS.Internal.IBufferedWriter.WriteLine()
       at NationalInstruments.VisaNS.MessageBasedSessionWriter.WriteLine()
       at isr.Visa.MessageBasedWriter.WriteLine(String queryCommand)
       at isr.Visa.GpibSession.WriteLine(String queryCommand)
       at isr.Visa.Ieee4882.Instrument.WriteLine(String value)
       at isr.Tsp.TspVisaIO.WriteLine(String value)
       at isr.Visa.Ieee4882.Instrument._flushWrite(). VISA status=Success, "WRITE, FW, CONNECT", 2008-08-12 00:47:21Z, 2077539742753448
    The first exception above is raised on the session Message Based Reader ReadLine() command.
    Note that I check for message available before issuing read. 
    Note also that VISA NS returns a status code of success:   VISA status=Success (this is what I log above)
    The second exception is raised after I try to clear the write buffers using the Message Based Writer command: WriteLine()
    Here too VISA reports success.
    Note also that the above segment executes in less than one second whereas the time out is set to 30 seconds. 
    The user runs VISA 4.3 runtime.  I am using NationaInstruments.VisaNS 8.1.20.222.
    I would be most grateful for some clues as to how to further explore this issue.  We have been at it for a few days already and are not seeing any light at the end of this tunnel.
    David

    Hello David,
    It looks like you are not passing any valid handlers in your viUninstallHandler command.  Calling viUninstallHandler removes the specified handler from the list of
    active handlers on the given session.  You can see the exact error information for your error in the picture below.
    Useful information can be found in the manual:  VISA Programmers Reference Manual Pages 5-146 & 7
    Have a great day!
    Meghan R
    Applications Engineer
    National Instruments
    Message Edited by Meghan R on 08-15-2008 11:39 AM
    Attachments:
    ScreenHunter_01 Aug. 15 11.33.gif ‏9 KB

  • Visa Read Errors

    Hey, Im using a Model 81000 ultrasonic anemometer and Im having a few problems with visa errors. I have it running at 38400 baud rate, which is what it should be running at. Ive run it in hyperterminal and it works fine.
    The problem Im mainly getting is that when I run it, sometimes it starts with a random sybol or character, and then it stops running and tells me I have a framing error. Sometimes as well, when I start it, nothing happens at all, and then after a lttle wait, it says I have a timeout error. Another error I sometimes get is the string that comes in is separated and placed on to 2 separate lines which I cannot work with. About half of the time it works fine, but for the other half im getting these errors.
    When running fine, it should read one line of data which works out to 35 bytes. I have the anemometer running at 32 lines of data per second, so I changed the delay to give me just one line so that I can break up the string into various tokens, which I then save to a file.
    Any help would be greatly appreciated.
    Attachments:
    Serial Read.vi ‏72 KB
    Retrieve Token String.vi ‏8 KB
    Channel Name.vi ‏36 KB

    You've indicated you have two different problems. One is the timeout error. Since you've disabled termination character recognition on reads you need to specify the correct number of bytes to read. The previous suggestion is the correct approach. You will need to use a shift register to carry around what's been read so far, and when you actually have 35 characters then you can do whatever it is you need to do.
    The other problem is the framing error. Framing errors are generated by the UART on your motherboard. Thus, it's hardware-related. A typical cause is a mismatch in baud rate or other serial port configuration. Another cause is a bad cable or noise on the line. Do a search on framing errors and you'll come across a lot of hits.

Maybe you are looking for