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

Similar Messages

  • Serial communication error

    hello,
    when i try to run my application(serial communication simple data transfer using loop back), labview evaluaton 8.6 showing the erron as attached.I dont understand what went wrong, it was working fine earlier.
    Thanks,
    hari
    Solved!
    Go to Solution.
    Attachments:
    laberror.JPG ‏85 KB

    Is that mean permission from NI? it was working fine, once i terminated the labview application abruptly when not responding since then i have this problem.
    hari

  • Serial Communication Error Creation

    Okay, here goes.
    This is my second VI and I'm
    concerned
    if I'm using best practices for creating and
    handling
    errors.  My VI writes data out of a serial port and then waits for a specific response.
    The response should look like:
    /* General Packet Definition (Input Data)
       0        $A5 signature byte
       1        Address - (0=PC)
       2        packet length - total packet length, address through CRC
       3     command ()
       x        parameters or data
       y        2 byte CRC -   */
    If I do not read the signature byte, if the packet is not addressed to me, the packet length is incorrect or I never receive information I need to generate and error, close the port and exit the subVI and report the error.
    I've created my own error codes and edited the Error Code file.
    Am I doing this right?  Comments, suggestions or insults...all is
    appreciated
    Thanks
    Attachments:
    Serial_subVI.vi ‏35 KB

    KevinO,
    From everything that I can see in your code, it looks like you are programming correctly.  Your code is also very neat and easy to read, thank you! 
    Eric K
    Applications Engineering
    National Instruments

  • Transferring photos from my Nikon coolpix s7c  to my mac causes a "communications error" with the camera and will not transfer photos as it has done in the past. Seems to have stopped working with my Mac Lion upgrade?

    iphoto has stopped transferring my photos from my Nikno coolpix s7c camera. Seems like it stopped when I upgraded to Lion? It continues to work with a PC?

    As a Test:
    Hold down the option (or alt) key and launch iPhoto. From the resulting menu select 'Create Library'
    Import a few pics into this new, blank library. Is the Problem repeated there?

  • Communications Error-- could it be related to OS difference?

    I'm trying to join a multiperson chat with two friends who have Leopard, while I have the most updated Tiger. Could this be causing the "Communication Error"? The past one or two attempts haven't even said that though, they just come up with "starting chat" for a while and then eventually just say that one of my friends' screen names has "left the chat", when it never actually goes into the chat to begin with. When I hit software update it says everything is up to date. I have Mac OS X 4.11. Any help would be appreciated.

    Hi,
    iChat 3 can Multichat with iChat 4 users.
    If they have already started the Chat and invite you they can not have left the Chat - other than your Modem or Router seeing the amount of iChat Data as an Attack and cutting the ports that the Video and Audio feed is on.
    Go to the Set up pages of any ADSL Modem you and /or any router and check it has any DOS or SPI items disabled.
    Can you do one to one chats with these same Buddies ?
    3:12 PM Friday; December 26, 2008

  • Visa error handling in serial communication

    Greetings,
    I have a problem with the serial communication in my Labview program.
    I have made an application that reads from serial port, searches for beggining characters, and later counts data after that beggining characters into variables in Labview program.
    Everything work fine, but problem starts when I unplug the device from computer.
    Program blocks and I could not do anything. Even Visa Close does not do anything.
    I need to restart my computer to make my application works.
    I made some indicators in subVi, and I see that when I unplug the device the error from READ VISA changes.
    My question is:  How to handle this event(error) to restart or unblock my serial device.
    I am attaching a SubVi, that searches for starting characters " KBON,"
    Best regards,
    Chris
    Attachments:
    find_start.vi ‏12 KB

    Hi Chris,
    From the standpoint of VISA capabilities, you should be able to programmatically handle the desconection of the serial port. I am however not certain that your specific serial port hardware is OK with that.
    As to how to handle disconnection using VISA:
    I recommend using the "timeout" pin of the VISA Configure Serial Port VI
    when the timeout is reached and no data is transferred, you will get a timeout error on the error wire.
    You can then programmatically handle this error case in your code in a very similarly to this example.
    I recommend experimenting to see what error codes your application throws, or alternatively you can use the VISA error codes documentation to create the case structures needed to hande these errors.
    In all cases, you should close the VISA reference. Leaving the serial port rescource "open" in your operating system may be the reason why you need to restart your computer every time (as restarting will for sure free up the serial port rescource).
    Best Regards,
    T Simon
    National Instruments
    Applications Engineer
    Certified LabVIEW Developer - Certified TestStand Architect

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

  • 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

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

  • Error in wait for event activity

    hi all,
    i am gettin gfollowing error when i am using wait for event activity in my WF.
    wait step 0000000088: No valid object ID in container element 'EVENT_BOR'
    'EVENT_BOR' is my container element of type BOR object which contain event.
    please tell me correct way to use wait for event step.
    i am using this on one parallel branch of Fork.
    thanks.

    Hi,
    check the event in SWO1 if there is an import parameter defined. If there is one you have to define the binding in the task waiting for event. You have to bind the relevant object type from workflow to containerelement &_WI_OBJECT_ID& of the event container.
    reagrds,
    Steffen

  • XSL:Import causing End-Of-Communication error when called in PL/SQL.

    I have master xsl. I am importing another xsl in it. when I use xslTransform in my pl/sql stored procedure I receive end of communication error. I have used "file://" and "http://" both in xsl:import.
    Here's the import lines:
    <xsl:import href="file://D:/temp/Xsd/CommonFunctions.xsl"/>
    or
    <xsl:import href="http://www.v-tek.com/xsl/CommonFunctions.xsl"/>
    I am not sure what causes this error. I tested this in xmlspy and it works well.

    Hi Justin,
    I tried to reproduce your complaint, but wasnt able to. I didnt have a 10104 db to test against though, but I did test against 10105, and 10202, using the following dumb table:
    create table constr_test ( c1 number);
    alter table constr_test add constraint const_1 check (c1 in (1,2,null));
    insert into constr_test values (3);
    commit;
    Frequently a 3113 is the result of an ora-600 or ora-7445 on the database. The fact that it doesnt occur for you on 10.2 db leads me to believe that might be the case here. Have you checked your alert logs?
    Cheers,
    Greg

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

  • Error while completing Wait for event step

    Hi Gurus,
    I have a Workflow developed which has a "Wait for Event" step.
    In that step,I am facing a problem .It seems the step is not getting completed properly.
    When I check in SWEL it shows the Event is triggered.But the next which is a 'Send Mail' step is not getting executed.
    The Event shows action status as "Receiver started correctly".
    When i executed "Complete Manually " in SWIA,it executed correctly and also the further steps got executed.
    What could be the issue ?
    Many Thanks in advance !
    Regards,
    Ameya Kulkarni

    Hello Ameya !
                     To one of my replies to this thread you have stated that no container elements are configured to wait for event step.
                     Without business object,event and container element with object reference, wait for event will not fire.
                     When the user changes the status in KO02, event fires and is seen in SWEL.But, if it should reflect in workflow, afore- mentioned details needs to be configured in wait for event step.
                    Have you configured this wait for event step with event 2 ?
    Regards,
    S.Suresh

  • Satelite internet causes communication errors for audio/video ichat

    Have Wildblue satelite internet, can't use the audio or video ichat. It comes up with a Communication Error. Have changed the Quicktime streaming setting to 1.5 mbps. Wildblue says it is because of latency issues and they don't support video streaming. Any ideas????

    Hi
    One thing to try is you could try sending yourself a email with a large attachment(around 5Mb) and once it has run for a short while then try a video call.
    If the video starts quit the email sending.
    Tony

  • GPIB and serial port communication errors via an executalbe file.

    I have a data acquisition program that communicates with instruments via the serial port and GPIB bus. When I create an executable file and run it on another PC I get GPIB and serial port errors when the program tries to initialize these ports. Are there additional vi's I need to include when I build the executable?

    When you installed the GPIB board on the other pc, did you install just NI-GPIB? Did you configure the GPIB board? You also need NI-VISA if your're using VISA calls in your program. You can either install the full NI-VISA or just the run-time version.

Maybe you are looking for

  • Dynamically Fill PDF form (extended features enabled forms)

    Hi Tarek Firstly let me say thank you for the great help you are doing through the forum. With Google, I did a very long search to find out how to fill a PDF form from a database. I achieved this using the iTextSharp dll. But this dll not supporting

  • Photo titles in shared Photo Streams?

    I have started to use shared Photo Streams, but find that my carefully constructed titles are not transferred to the Photo Stream – each photo appears with its original alphanumerical identifier. Is there a way I can get photos to keep their titles?

  • Problem with doing an average

    I wrote this code tonight, the sum, max and min work but I can't compute the average. Secondly, I using 0 to stop the loop, but I would like to use Q how would i do that? Int x = 1; double total = 0; int max = 0; int min = 0; double sum = ( total/ av

  • ADF Faces: Making a selectOneChoice in java code?

    I need to make a selectOneChoice to reuse in my pages (country selection) but can't seem to find how to do it on the web? here is what i've attempted with the error output... -------------------- the java code: public void contextInitialized(ServletC

  • How To Make an Array from Multiple Choices of a Drop-Down Menu?

    I have a drop-down menu (or a scrollable list). Visitors can make multiple selection from the list. How do I put those selected items into an array?