VISA Wait On Event Crashes LabVIEW

While "VISA Wait On Event" is pending on an event, and in another thread the "VISA resource name" input to "VISA Wait On Event" is closed using "VISA Close" vi LabVIEW crashes.
I had a need to programmatically cause "VISA Wait On Event" to unblock so the LabVIEW program it is running in can be closed, or the "VISA resource name" originally input to "VISA Wait On Event" can be changed. I expected that executing "VISA Close" in another thread would cause "VISA Wait On Event" to unblock with an error. Instead LabVIEW crashes.

James-K wrote:
Artst,
Can you post a screenshot of your code to further clarify?  
It sounds like you are trying to stop the VIs by clearing the reference while it is still in use which will lead to a crash.  There is not a way to "unblock" a VI once it is running.  Can you specify a timeout instead?
Well, I think this is not giving enough credit to the actual problem. One common VISA programming paradigme in the standard C API is to actually let a VISA Read (and of course a VISA Wait on Event) to terminate with an error by issuing the viTerminate() function, which I believe should be possible to get optionally be called by VISA Close too. Unfortunately there is no direct access to any VISA Terminate function in the LabVIEW palettes, but I have in the past created a small VI which calls the underlaying VISA API directly to abort any stuck operations on a session. Possibly this VI could solve the problem, making the VISA Wait On Event return before the VISA Close pulls its session under its feet.
PS: Why can't I upload the VI directly to the board? Is it because it is in LabVIEW 7.1 format??
Rolf Kalbermatter
CIT Engineering Netherlands
a division of Test & Measurement Solutions
Attachments:
VISA Close with Abort.zip ‏10 KB

Similar Messages

  • VISA wait on Event crashes RT target

    After adding code that included a VISA wait on event (serial character), my cFP-2220 with LVRT 2012SP1 stopped answering when LabVIEW tries to halt the running code to do a build or deploy...(The code works otherwise works fine).
    The code on the controller seems to stop (all activity can be seen halting), but the VISA-part seems to still be hanging, or have crashed the controller (web and ftp interface goes down as well).  If I just reduce the given timeout from 100 ms to 50 ms, the problem disappears. 
    My own interpretation of this is that the rules that is supposed to enable the host PC to halt code on the RT-target is simply not abided by the VISA wait function, and if that function happens to be waiting while the command is issued, and this wait does not happen to time out relatively shortly after the command has arrived, it will cause a crash.
    Is this a bug, is there a workaround other than not using events (I changed the code from polling to events to be able to detect 5/10 ms silence time on serial ports without using all processing time on it...), or is it expected and not considered an issue?
    MTO

    James-K wrote:
    Artst,
    Can you post a screenshot of your code to further clarify?  
    It sounds like you are trying to stop the VIs by clearing the reference while it is still in use which will lead to a crash.  There is not a way to "unblock" a VI once it is running.  Can you specify a timeout instead?
    Well, I think this is not giving enough credit to the actual problem. One common VISA programming paradigme in the standard C API is to actually let a VISA Read (and of course a VISA Wait on Event) to terminate with an error by issuing the viTerminate() function, which I believe should be possible to get optionally be called by VISA Close too. Unfortunately there is no direct access to any VISA Terminate function in the LabVIEW palettes, but I have in the past created a small VI which calls the underlaying VISA API directly to abort any stuck operations on a session. Possibly this VI could solve the problem, making the VISA Wait On Event return before the VISA Close pulls its session under its feet.
    PS: Why can't I upload the VI directly to the board? Is it because it is in LabVIEW 7.1 format??
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions
    Attachments:
    VISA Close with Abort.zip ‏10 KB

  • VISA Wait on Event User Event

    I have a Producer/Consumer program that uses an Event Structure to handle the UI button presses.  I want to be able to use the VISA wait on Event to read characters from the RS232 port.  So in my Event Structure I created a case for dynamic user events.
    I also create a while loop that has the VISA Enable Event and VISA Wait on Event in it. I enabled the "Serial Character" event only.  When I get this event I use the Create User Event.VI and Register for Events to get a Event Refnum
    How do I get the Event Refnum from this loop into my Producer loop?
    Solved!
    Go to Solution.

    Paul_Knight_Lockheed_Martin wrote:
    Here is the code
    No, that is not the code. That is one subVI and a picture. Where are you waiting for the VISA events? Where are you generating your user event? Based on the picture you are calling the Initialize_Controller_Communication and remaing in that code until the Stop buuton is pressed. You will not start your event structure in the producer loop until this VI completes. So, if you are not hitting the stop button to complete your initializtion it is no wonder you are never seeing your event structure run.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • VISA wait on event Error -107380731​3

    Hello, I am trying to zero and calibrate a pair of HP power meters.
    After sending the command to zero one of the meters, I use the VISA Wait for RQS.vi which throws this error:
    Error -1073807313 occurred at VISA Wait on Event in Wait for RQS.VI->HP 437B_visa.vi->PowerMeterSetup.vi
    Possible reason(s):
    VISA: (Hex 0xBFFF002F) You must be enabled for events of the specified type in order to receive them.
    I opened up the "Wait for RQS.vi" to examine the "Wait on Event.vi". The "Wait on Event.vi" has the hexidecimal constant 3FFF200B (Service Request) attached to the event type input, and there is a VISA event class controller set to "Generic Event" attached to the event resource class input.
    So, why the error?
    Thanks,
    Victor

    On NI's web site there is a tutorial, app note, and examples on using VISA for handling service requests. Below are links to each.
    Tutorial: http://www.ni.com/swf/presentation/us/visa/
    Application Note: http://zone.ni.com/devzone/conceptd.nsf/webmain/1A​760883EEF23D7E86256DBA006C9C00?opendocument
    Examples: http://sine.ni.com/apps/we/niepd_web_display.DISPL​AY_EPD4?p_guid=C99424CC48EC1273E034080020E74861&p_​...

  • Selecting VI Server.Strictly Typed VIs in Class Browser crashes LabView

    Hi!
    My LabView 8.0 Pro on WinXP crashes in the following way:
    0. Opening Blank VI.
    1. Placing VI ref num on the front panel.
    2. Going to "Select VI Server Class -> Strictly Typed VIs -> Browse..."
    3. Loading any VI (say, "myVI").
    4. Then going to menu: View -> Class Browser
    5. Selecting Object Library: VI Server.
    6. Selecting Class: Strictly Typed VIs - "myVI" icon.
    Result: LabView crashes saying that there's error and application will be closed.
    Besides there's a little question:
    Did I get it right that if I change myVI connector layout or pins it's not refreshed in my
    VI ref num and I have to load VI again (see step 2)?
    Thanks in advance for any help.
    Rashid.Message Edited by Rashid on 02-22-2006 11:17 AM

    Hello,
    I have reproduced this, but I think the menu navigation you indicated in step 2 has a mistake.  I reproduce it with the following steps, and have filed a corrective action request to R&D on the matter:
    0. Open a Blank VI.
    1. Place a VI Refnum on the front panel.
    2. Right-click on the VI Refnum and choose: Select VI Server Class -> Browse...
    3. Select any VI (say MyVI.vi).
    4. In LabVIEW click: View -> Class Browser
    5. Select Object Library: VI Server.
    6. Select Class: Strictly Typed VIs -> MyVI.vi connector pane icon.
    Sorry for any inconvenience - the problem should be addressed in a future version of LabVIEW.
    For your question, "Did I get it right that if I change myVI connector layout or pins it's not refreshed in my VI ref num and I have to load VI again (see step 2)?" - yes, I see the same behavior - you should save the VI and then select it again in the VI Refnum.
    Best Regards,
    JLS
    Best,
    JLS
    Sixclear

  • Register Event Crashes LabVIEW if Event Type isn't Selected.

    Hi I think I have found a possible bug in LV2011 SP1.
    - Wire a Reg Event property node to the Dynamic Event Registration Terminal of an event structure
    - Add an event case
    - Click the Dynamic Event
    - LV Crashes
    Source code included, try to add the unspecified event and watch as LV crashes.
    Br,
    /Roger
    Solved!
    Go to Solution.
    Attachments:
    LVCrash.vi ‏5 KB

    Intaris wrote:
    I had a case very similar to this today, I think it was to do with exactly what you describe but it was in LV 2012.
    I seem to have a knack of crashing LV.  I'm really good at it.  Maybe I should be an internal tester for NI?
    Shane.
    What? they do testing? When did this happen?
    I'm just kidding, or, perhaps not? 
    We all like to Love/Hate NI, right? 

  • HP 34401A - wait on event in Wait on RQS

    Hello,
    i'm in a desperate situation. I want to measure resistance with LabView 7.1 over GPIB. The equipment i use is the HP 34401A multimeter. For many times it was no problem. The single read example worked without failures and returned the measured values.
    Then a short time later, nothing worked as before. I always receive this error: "VISA Wait on Event in Wait for RQS.VI->HP34401A Read Meas.vi->HP34401A Single Read Example.vi"
    I know this question is not asked for the first time. But the answers given in the other threads don't help.
    The timeout time i changed from 10000 to 60000 ms. The failure is in the wait for RQS.vi .
    Please help me, that would be very kind!
    Thanks a lot
    Greg

    I have one of those multimeters as well, and use it from time to time in a program to verify the voltage from a power supply...
    I always use the method in the vi attached, since I've always found it easier (again, easier for me anyways), since you can control everything. You may want to vary the wait in between the read and the write, since my meter is an Agilent (newer than if it says HP...they had to branch it off for some reason), and it might be different, but I doubt it.
    All the commands are in the manual... Hope this helps,
    Geoff
    Attachments:
    GPIB Write-Read.vi ‏22 KB

  • Wait on Event causes serial communication errors

    Hi,
        I've been trying to to create a VI that can send and receive text data to a device via RS-232.  I started out with the Basic Serial Read and Write.vi that comes as an example with LabView and that works.  However, all it does is wait for specified amount of time before trying to read incoming data.  I thought to make that example more robust by polling the serial port for incoming characters.  I did some Googling and I came upon this page:
    http://digital.ni.com/public.nsf/allkb/179E61F87CF8B340862571EA0037CFA3
    Preventing LabVIEW from Continuously Polling the Serial Port.
    When I modified the Basic ... VI to include this however, I get all manner of errors.  Sometimes, I don't get any response at all.  Sometimes, I get response data from a previous request (but not all of it), and sometimes the device I'm communicating with tells me it's seeing a framing error.  I don't think I've ever actually received a correct response.  Can someone tell me if I've implemented this incorrectly?  Does the page above ONLY apply to PXI controllers or can I use this for RS-232 communication?  Do I need to be waiting on a different event?
    Thanks,
    Jason Mazzotta 

    Seems like your expected string is actually terminated by a linefeed character. VISA supports character terminated reads and even enables that for serial ports by default.
    The entire loop in the middle and the "wait for event "can be simply replaced by a single VISA Read when you let VISA use read termination mode. It even uses line feed by default as termination character but you can easily modify that at the VISA Serial Init function.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • NiDCPower Wait For Event

    Hello,
    I am using the PXIe-4139 SMU to source a current sequence that starts when a trigger is received and takes about 40 seconds to complete.
    After the niDCPower Initiate VI I have inserted the niDCPower Wait For Event VI with a timeout set to 300 seconds to allow for enough time to receive the trigger and complete the sequence. This VI waits for the Sequence Engine Done Event.
    Now this works fine, however, when the user wishes to stop the programm for whatever reasons, they have to wait the full 300 seconds until the Wait For Event VI produces a timeout error and stops the programm. This is rather inconvenient. How can I change the programm so that the user can stop it even when the Wait For Event VI hasn't reached its timeout?
    I tried this:
    But this doesn't work. For some reason, I get a timeout error with code -200474 but the boolean operator returns FALSE.
    Any other ideas?

    If there an output on the wait for event VI that flags a timeout? If so, set the timeout short (like 100 msec) and wait for 3000 timeouts before continuing on.
    Oh, and use an event structure. Timeout event (timeout=0) checks the wait for event, value change event for button breaks out of loop.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Simple Math VI crashes LabVIEW 2009 SP1

    Hi,
    We previously filed a related issue, (ref #: 7302858). The last problem was resolved by 
    Andy Hertzka from NI re-compiled the VI and send it back to us. That re-compilation solved the LabVIEW crashing.
    However, the interesting crash happens again.
    I attached a working VI before the change and a non working VI after the change and save. All the change I applied to the VI is
    1. Add the "Word bits" as a connector on the diagram
    2. Save it Then the VI begin to crash LabVIEW 2009 SP1.
    Before the change, the VI was functioning all right.
    Any idea why this might be happening? Can you try to recompile the non_working version and send it back to me for a try?
    Thanks,
    Tian
    Attachments:
    Non_working_AfterChange_RECOMPILED LRSample_U32in_U32output.vi ‏110 KB
    Working_B4Change_RECOMPILED LRSample_U32in_U32output.vi ‏110 KB

    Tian,
    Like Andy I was unable to see why this code is unstable on your machine. I am able to run the code fine on my computer without any problems. Looking at the code on the block diagram I do not see any major "crash worthy" issues with it. 
    I have resaved the VIs like Andy had in order to fix your issue. By the way what OS are you using, windows 7? It might be helpful to save the log file for the LabVIEW crash. You should get this option when LabVIEW is restarted. 
    <Joel Khan | Applications Engineering | National Instruments | Rice University BSEE> 
    Attachments:
    Non_working_AfterChange_RECOMPILED LRSample_U32in_U32output1.vi ‏108 KB
    Working_B4Change_RECOMPILED LRSample_U32in_U32output1.vi ‏108 KB

  • Emergency - Please Help LV6.1 win2k Wait on Event 'Ignore Previous' Doesn't work

    I am using an activex control to access an OCX for IRDA communications. My
    VI is setup to wait on events, The event name is 'OnDataAvailable' I have
    selected 'ignore previous' on the activex wait on event subvi but both my
    events fire simultaniously. I have read this is a multithreading problem in
    windows 2k and XP and by changing the execution thread to user interface it
    can be resolved, that didn't work. Please help any information would be
    greatly appreciated. I am using the OCX to comm to an IRDA device which is
    written in the IRLPT protocol. Labview doesn't support IRLPT service names
    in the IRDA functions.
    Franticly awaiting,
    Jamie

    Can you post a stripped down Vi? Are you using activeX events or the event structure?
    Jeremy

  • Process chain Error: This AND process is not waiting for event RSPROCESS

    Hi All,
    I am facing an error in the process chain in PRD.
    Error message: This AND process is not waiting for event RSPROCESS.
    We had a process chain which had two sub chains which run parallel and below of this we had AND process type and below of the AND process we had 4 more jobs.
    Once the two subchains got successfully loaded, the and process should turn to green and further 4 jobs should start.
    It is a daily load , it worked fine from past years,but suddenly the AND processtype is getting failed.The thing is in the two subchains if one got completed, the AND process process is not waiting for 2nd subchain to get completed.The AND process is turning to RED (status: cancelled) . I tried to repeat the AND process once after above 2 subchains loaded, but it didnt worked.
    And i removed the existing AND process and created a new one and placed it in same place and activated and schedules again.but still it is getting failed with same error.
    Thanks in advance,
    Sai Chand.S

    Hi,
    If you did any transports related to that metachain we face similar kind of issues.
    not only the AND process , we need to remove all the process before executing the AND process and create it again.
    It helps you, you said your in production So you should take the proper approvals and do it.
    Regards,
    Yerrabelli.

  • Query on Using fork with wait for event

    Hi All,
    I have a scenario in which a fork has two branches and one branch has the multiple steps along the line and also calls a subworkflow in one of the steps.
    The second branch has a single wait for event to complete the workflow in case of a cancel event.
    My understanding is that when the branch one executes and is on a single step decision or have gone inside a subworkflow and wating for user decision on the workitem created
    Whenever the wait event is triggered on the main workflow the second branch gets executed completing the workflow and all the branch one steps and the subworkflow gets logically deleted removing all the workitem from the inbox.
    Do I have to do any specific process control in main workflow to make sure that the subworkflow is deleted .
    Please clarify on this.
    Thanks,
    Charan.

    It should be taken care by itself. No additional steps required.
    Regards, IA

  • Error in Workflow wait for event node

    Hello Experts,
    I am working on one QM notification. I shall explain the scenario first:
    1) User will take the usage decision on inspection lot in QA11. When user will take decision and save inspection lot BUS2045 event USAGEDECISIONMADE will be triggered and initiate my workflow here.
    2) After workflow initiation system will create notification and send to approver, but here i have wait step in my workflow for BUS2078 - Created (Notification).
    wait for Event step
    BO: BUS2078
    EV: CREATED
    I am posting error below:
    Error when starting work item 000000294361
    Error when processing node '0000000060' (ParForEach index 000000)
    Error when creating a component of type 'Wait Step'
    Error when creating an event item
    Error within method CL_SWF_RUN_WIM_EVENT->_CREATE_WORKITEM_CONTAINER
    Error within method CL_SWF_RUN_WIM_EVENT->_GET_INIT_WORKITEM_CONTAINER
    Workflow 000000294361 wait step 0000000060: No valid object ID in container element 'Notification
    Node 60 - wait for event step.
    Re.,
    Guri

    Hi,
    Based on your description what I felt is you are making use  of a wait step in which you have choose to wait till BUS2078 event CREATED is occured ... right.. Now can you please clear me that where and how this event will triggered.
    or is it some thign like you are making use of event creator step and in this case, When ever you are making use of the eventcreator  step and a BOR object inside it make sure that specific BOR object is already instatitaed in the workflow container , if it is instantiated then only it will try to identify the instance  or the BOR and it will try to rasie the event.
    Regards
    Pavan

  • Save for previous version 8.5 to 8.2 generates code that crashes Labview (uses classes)

    Hello,
    I'm working on some java style interfaces for labview for hot swapping of instrumentation for design patterns. When I try to port this code, developed on Labview 8.5 back to labview 8.2, the code it generates crashes labview (both 8.5 and 8.2).
    Included is a small snipet of the work that demonstrates this behavior.
    It includes to classes:
    untitledProject1 - the containing project (version 8.5)
    FunctionGeneratorI - Similar to a Java style interface (A class with all Dynamic VI's with no useful functionality)
    FunctionGenerator33220a - An intended implementation of Function generator (only a few functions implemented)
    and a folder "labview8_2Distribution"
    Which contains the port of the 8.5 code to 8.2.
    To recreate the error:
    A.
    1. Open "labview8_2Distribution\Users\Laptop\Desktop\objec​t\Untitled Project 1" (8.2 save)
    2. Verify it crashes labview 8.5 and labview 8.2.
    3. Watch labview crash?
    B.
    1. Open the "Untitled project 1" in the root directory. (Using labview 8.5)
    2. Save the project as a labview 8.2 type.
    3. Try to open the saved version with 8.5 and 8.2.
    4. Watch labview crash?
    Greg Sonnenfeld
    Attachments:
    error.zip ‏885 KB

    Hello Karunya,
    In regards to your questions:
    >Can you post your code? Have you tested this by creating another project?
    Do you have an xcontrols in your projects? Do you have typedefs? Do you
    have a LVOOP constant on your block diagram? Are you also using Classes?
    I cannot post the cost as it is way too big. Not really my code but a spaghetti code from a previous programmer. I think problems saving it to a previous version have to do with a few things:
    1) Memory - I have 1 GB of RAM and I am running XP. I notice the available RAM dropping quickly as it is saving and then it blow up.
    2) Long Filenames - The directory path of the original file is incorporated into the saved "previous version" of the code. While a good design, it does make the file/path a bit longer when saving
    3) One of teh things it saves is the drivers and their menus. This is due to the drivers being in a subdirectory of the original code and not in the c:\program files\national instruments\labview 8.5\instr.lib directory. I saw this when I tried to save the file as an LLB.
    4) If I work with smaller parts of the code without long paths, it saves fine.
    There probably are xcontrols, definitely typedefs, no LVOOP's or Classes. Hope you can do something with all this. It just seems that converting to a later version of the code should be reversable. Thanks.
    Michael

Maybe you are looking for

  • SMARTFORM GUI_DOWNLOAD PDF error opening Adobe document

    When attempting to open Adobe document from Smartform converted to pdf using CONVERT_OTF and GUI_DOWNLOAD I get error.  The abap completed each step with no errors and oddly the final pdf file created to PC was either 10 or 15 Mb even.  The 15Mb vers

  • Automatic clearing for document posted via FBB1 with foreign currency

    Hi SAP Gurus, Can anyone help to explain on why does the document posted in FBB1 with document currency USD was auto cleared even without satisfying the rule in OB74. But when the document currency is SGD it can be automatically cleared. Scenarion is

  • View created on which table in oracle

    Hi, How can we get the information that view is created for which table. Please suggest

  • IDCS3 v5.0.2 running slowly

    Just upgraded over the weekend to CS3 (fromCS2) on a new Mac Pro 2.8. Running Leopard. Simple InDesign documents (one or two pages, perhaps a photo or two) take forever to open and longer to save. I thought that 'Display Performance' settings might b

  • Creating a Oracle Form as a Spreadsheet

    Has anyone created an Oracle Form to function as a spreadsheet? Thank you.