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~~

Similar Messages

  • How to skale or increase text, when i read an ebook created by ibook-author?

    How to scale or increase text, when i read an ebook created by ibook-author?

    If the book is in portrait mode, the text is fluid - top of the screen is a resize option. Basically whole effect is the same as an ePub file.
    If reading a book in landscape mode, resizing text simply isn't an option because it's considered fixed format.
    I've been working with landscape only books and I tend to increase the size of my body text in iBooks Author - to at least size 18. It appears that although this would be large if printed, when displayed on an ipad it's closer to about size 12, which is standard anyway.
    Jenny

  • Launchd: How to Run a Job Only When Waking?

    I want to run a script when the computer wakes from sleep. I've read everything I can find about launchd and cannot find a solution.
    I tried RunAtLoad, but it did not run the script when the computer woke from sleep.
    Is there a parameter for launchd that will run a job only when the computer wakes from sleep?
    I know other parameters like StartInterval will run any "queued" jobs when the computer wakes up, but I'm looking for a parameter that runs the job only when the computer wakes up.
    Any help is appreciated.
    Thanks
    Brett

    Sorry, but there is no capacity for that built into launchd.  You might be able to hack something together (I've tried before, with some limited success), but it will be easier and more stable to use sleepwatcher. 

  • 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 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.

  • 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

  • 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

  • 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.

  • How to run tests in Firefox when running script using runScript.bat

    I am trying to run OATS script from commandline without opening Openscript IDE(eclipse). I use the following command to execute my script:
    runScript "<scriptpath>/<scriptName>.jwg"The script starts to execute and launches IE. I wanted to run my test on Firefox but it always launches IE even if Firefox is my default browser.
    If I run my script from Openscript IDE it honours the Browser settings in View > OpenScript preferences... OpenScript > General > Browsers. When running thorugh cmd line, these settings are not taken into account as Eclipse preferences settings are applicable only for the workspace selected for the IDE.
    Any thought on how to set these preferences when running scripts using runScript.bat file?
    Thanks,
    Manish Khatre

    Hello
    You need to pass the value/parameters (preferences) to the command line as documented in the OpenScriptUserGuide.pdf.
    Something like
    -browser.type type
    Specify the browser type to use for script playback
    where type is one of the following (use exact case
    and no spaces):
    ■ InternetExplorer
    ■ Firefox
    The default is InternetExplorer
    JB

  • Why won't exe run over vi server when VIs will?

    Hello,
    I have a "Server" which I intend to run on a locat machine at my desk.  It's function is to simply gather messages in a text box from multiple clients.  I'm using the VI Server method.  The VIs work but when I build them there is no communication.  On "My Computer" I checked "TCP/IP" and set the port to 3368, I currently have another server on 3363.
    I can't figure out what my issue is.  I have rebuilt the client exe many times with various inputs (using static ip for the machine name setting, then using the service name for port number and service name, and the port 3368).  These various builds were not successful.
    I think I have gone through the appropriate steps to attempt to correct the issue but I can't solve it.

    If the client is an EXE you don't need to enable VI Server for it. This can cause problems because of the port being in use by the VI. The client exe can basically have an empty ini file (just the section name in the first line is sufficient).
    Did you specify the machine name to connect to in the exe? If the client exe and the server are on the same machine use localhost or 127.0.0.1 or the hostname. Leaving it empty will not work because this will return an application reference to the current application instance (in this case the exe itself) no matter what port you specify.

  • How to run a addon automatic when firefox started

    Starting the addon need to click. I want to do it automatic when firefox started

    Many add-ons start away when Firefox is opened. Was an add-on in particular? Also, most add-on support questions should be directed to the developer who knows more. We are mainly volunteers in this forum and so there are some things behind the scene we aren't aware about.

  • How to Invoke a BPEL process when Insert/Update/Delete happens

    Hi
    As client requirement is we want to execute a BPEL process when there is a DML Operation (Insert/Update/Delete) on a particular table.
    How do we handle this situation. Is there any alternatives if it is not possible.
    Please point me if any documentaion is available.
    Regards
    Kiran

    Hi Kiran,
    What integration tool you are using.
    In Oracle BPEL PM, you can create an empty BPEL process with a "receive" activity and a database adapter partnerlink which polls for change in table records every specified time interval.
    After receiving the table change, you can fire the appropriate BPEL process through "invoke" activity.
    thanks
    Saurabh

  • How to search/split a string from visa read

    hello all, i have a string coming from the serial port... the pattern is:
    \00\s\s\s\s0,\s\s\s\s12,\s\s\s\s\s0,\s\s\s\s\s0\r\n
    where the data is read as 0, 12, 0 , 0. i would like to save this data into a Write to Measurement File, for which i have to convert this text data into decimal format. can anyone please suggest me how to reduce the data from the string? I know I can save the data in a text file, but i am limited to use the Write to Measurement FIle.vi
    please help.
    Now on LabVIEW 10.0 on Win7

    Hello LV_Enthu,
    Have you played around with the functions in the Functions palette>>String at all? There are a few helpful functions like search/split strings and match string pattern that can be helpful, but here is an example from our website as well that does just this. Please let me know if you have any further questions.
    Thank you,
    Deborah Y.
    LabVIEW Real-Time Product Marketing Manager
    Certified LabVIEW Architect
    National Instruments

  • How to run the indexing pdf in adobe reader 11

    Hi All,
    i have created indexing files for some pdf, while searching in adobe reader 10.
    it works fine, but in reader 11 not working.
    Regards,
    Vinoth

    Hi Shakthi,
    Please find the below link
    http://forums.adobe.com/thread/1083659?tstart=0
    Please let me know if you requried more details.
    Regards,
    Vinoth

  • How can i know the data that labview takes when calls visa read?????????????

    First sorry for my english!
    I have a program in wich i read data trough USB(in bulk mode) from a FIFO(from a microprocesor) . I don´t know if when i do a visa read and the program that is running in my microprocessor is waiting for the FIFO full, what data catch the visa read?, because labview don´t wait, always take data when visa read is call!!
    THANKS THANKS......

    A read operation just retrieves the bytes that are available on the serial port. Means that these bytes are there because they have already been sent by the connected device. They may be remains from a previous communication.
    Your protocol should ensure that
    1/ the serial buffer is empty before your start your communication session.
    2/ you read either a specified number of bytes, or all the incoming bytes, using a timeout in case of failure
    3/ you leave things clean after communication (empty buffer, close port...).
    Try to be e more specific if you need further help.
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        

Maybe you are looking for

  • Difficulty downloding Adobe Reader and Error 1327. Invalid Drive H:\

    I am having a difficulty downloading Adobe reader on my laptop. For some reasons, I am getting error 1327. Invalid Drive H:\ notification. I have followed the tips on how to resolve this issue from Adobe's help and FAQ pages, but I am still not able

  • The screen of my iMac is black and doesnt work....Why and what to do?? helllpppp

    oKAY So I use my iMac everyday... and need this fix asap like everybody else that experience this problem I guess... One morning I just start my computer like usual and nothing happen to it during the night and I had use it without any trouble the da

  • New user with an  massive array/string headache

    Working with a large (365 source files, 65 mxml files) SDK 3.6.0 project in FB 4.5 and continually get : Resource Path Location Description Type TB4.mxml /the0bot_1/src/the0bot/gui line 1 1067: Implicit coercion of a value of type String to an unrela

  • TREX indexing on content server performance

    Hi guys, Our Portal is integrated with SAP CRM (using webdav) that manages documents stored in SAP content server. We use TREX to index these documents such that users in Portal can search for these documents. Currently we're evaluating the performan

  • OGG Vorbis in iTunes 10?

    How to play OGG Vorbis in iTunes 10? Tried XiphQT 0.1.9 and oggvorbis_r45 component, but no luck.. Any ideas ?