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

Similar Messages

  • 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

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

  • 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

  • BPM Scenario how to wait til file deleted in Target Directory

    Hi Frnds,
    I am working on one JMS to File scenario,my requirement is i am sending JMS message to File Directory,when i placed meg in target directory some vent wil read the message it wil process in to SAP.
    When i receive once again mesage in JMS scenario will start execute , is previous message still in File Directory i have to wait to event occured,after procesing only i have to place next message.
    How many different ways i can achieve this.
    many thanks,
    RAJ

    Hi,
    you can create a java proxy in your BPM that would check the file and if so wait for some time
    and check once more
    Regards,
    Michal Krawczyk

  • 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

  • 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

  • Exit CL_HRASR00_POBJ_WF_EXIT triggered exeception for event STATE_CHG and (target) status READY- ERROR EVENT_RAISED - Error updating the process object

    Hi All
    I have set up a simple custom HCM process and Form regarding Infotype TO CREATE AND CHANGE POSITION. I have checked the process and form consistency and it seems fine. Now when I run the process from HRASR_DT it generates a process number but it also gives an error workflow could not start.I get following error (SWIA log - Step history)
    Executing flow work item - Transaction brackets of the workflow has been damaged
    Exception occurred - Error when starting work item 000000007031
    PROCESS_NODE - Error when processing node '0000000014' (ParForEach index 000000)
    CREATE - Error when creating a component of type 'Step'
    CREATE_WIM_HANDLE - Error when creating a work item
    CREATE_VIA_WFM - Exit CL_HRASR00_POBJ_WF_EXIT triggered exeception for event CREATED and (target) status
    EVENT_RAISED - Error updating the process object
    Executing flow work item - Exit CL_HRASR00_POBJ_WF_EXIT triggered exeception for event STATE_CHG and (target) status READY->ERROR
    EVENT_RAISED - Error updating the process object
    Executing flow work item - Transaction brackets of the workflow has been damaged
    Executing flow work item - Work item 000000007031: Object FLOWITEM method EXECUTE cannot be executed
    Executing flow work item - Error when processing node '0000000014' (ParForEach index 000000)
    Points to be noted:
    1) I have searched few SAP notes such as 1384961(Notes for 6.0.4) but our system is in higher level patch 6.0.5
    2) WF-BATCH have SAP_NEW and SAP_ALL authorization.
    Appreciate your valuable suggestions.
    Thanks
    Ragav

    Hi Ragav
    did you try to debug this? maybe something is missing in config of P&F?
    Since you are on 605, the following note would be there in your system....use it to debug:
    1422496 - Debugging background workflow tasks in HCM P&F
    This will help you find the root cause.
    regards,
    modak

  • Bpm:message being sent and wait for event

    Hi,gurus:
    My scenario is about BPM.In the integration process I used a loop and correlation.The scenario worked successfully yesterday,but after I changed some thing,it did not work.The outbound status of the message in sxi_monitor said "message being sent".And when I clicked PE to see the workflow log, it said " wait for event".
    Thanks in advance.

    Could you tell me how to reimport the integration progress in ID?
    reimport means...delete the already imported BPM from ID.....this would affect the corresponding ID objects....save and activate....and then again run the import Integration Process wizard....create the objects once again.....seems time consuming.....hence mentioned it as the last option in the list:(
    Also from SWWL delete only the instance with status as ERROR.
    Edited by: abhishek salvi on May 20, 2009 9:30 AM

  • Message being sent and wait for event - BPM help.

    Hi Experts,
    I am doing BPM interface, in that i am receiving two files. Between these two files, i have set the coorelation in the BPM and included in the BPM's receive step1 and receive step2. After execution, when i look into the sxmb_moni, message status shows processed successfully, but when i look the Process engine status, it shows Message Being Sent and when i look into the BPM monitoring it shows message wait for event in the coorelation object.
    I have gone through the following forum :
    Link:[https://forums.sdn.sap.com/click.jspa?searchID=27600139&messageID=7561954]
    but everything is green and messages are set to Message being sent status.
    Experts kindly advise me.
    Regards
    Mani.

    Hi Abhishek,
    Here i have given my BPM design,
    Start
    Fork - two branches
    Branch1 - Receive File1
    Branch2 - Receive File2
    Transformation
    Send
    End.
    In coorelatin editor, i have specified container,involved messages and properties clearly.
    I have gone through the SAP basis contents as per your previous reply.
    One thing is, i have used the same design for my other interface, it is going through, but specifically for this interface i am getting error. If you could send me your mail, i will send you the exact screen shots, so that you can advise me.
    Pls i need to complete this in a short period, kindly help me to come out.
    Regards
    Mani..
    Edited by: mani_sg on Jun 18, 2009 10:21 AM

  • Problem with wait for event

    Hi everyone,
    I'm using wait for event step in my workflow of a custom event called zevent2.
    I'm not using the event as a start event of the workflow.The event is getting triggered at a certain point of the workflow programmatically.
    So for that what should be the entry in SWE2? I've maintained the following entry for zevent2 at swe2 tcode.
    Object type: BUS2000126
    Event: ZEVENT2
    Receiver type:
    Receiver function module: SWW_WI_CREATE_VIA_EVENT_IBF
    In swel I'm finding out that event got triggerd but it is giving error "No Receiver Entered".
    And the workflow is getting stuck at 'wait for step event'.
    So can anybody please tell me what is the step am I missing? is the swe2 correct?
    Thanks & Regards,
    Anirban

    HI....
    you have to specify RECIEVER TYPE without which you will be getting this error
    goto SWE2 and give the value and your problem will be done
    regards
    Edited by: Mohit Kumar on Feb 20, 2009 10:50 AM

  • Error in "Wait for event" step

    Hi,
    I try to use a wait for an event (CREATED) on a delegated subtype to business object KNB1.
    Container element in the wait step is empty at the time of creation of the runtime wait item but I know what the key of the container element has to be so my idea was to set in a check funktion module in trx. SWEINST and filter out irrelevant events.
    But when the waitstep is to be created, the workflow goes into error: WL 442 No valid object for the container element.
    Should this not be possible?
    Any suggestions for another solution?
    I have also tried to instantiate the object before the wait for event step - but since the object does not exist in the database yet - method GENERIC.INSTANTIATE goes in error, too.
    WAS 700 sp 11 with ERP 6.0 but also tried on a 620 with 4.7
    Thanks,
    Regards,
    Claus Lücking

    Hi Mark,
    Yes, you are right - I am waiting for an event on a object not yet created:
    I am waiting for a customer to be created in FI via change documents (table KNB1). Since the customer is going to be created in a company code that has a one-to-one reference to the sales organization where it is created first, I know the key of FI customer to be created.
    Example: A Customer 23 is created in sales area 1000-01-01 and the workflow is triggered via an event KNVV.CREATED. Then I would like to wait for event KNB1.CREATED for customer 23 in company code 1000.
    Thanks,
    Claus.

Maybe you are looking for