How to detect disconnection for serial communication?

/dev/cua/[a/b] are used for asynchronous communication. We attempt to detect if one end closes/drops the connection. termio(7I) states that it can be done thru turning on HUPCL, turning off CLOCAL, and catching SIGHUP. We tried different ways and we had never caught SIGHUP. Any advise would be appreciated.

hello, i think i have implemented what i wanted ... however, 1 last issue... i am observing that labview is reading the data twice of the serial port... for example..
the actual data is :
0x120x280x04; however, labview is reading 0x12 0x12 0x28 0x28 0x04 0x04.... i think that labviw clock is way faster than my uC clock, and before uC is sendin new data, labview is reading watever is in its internal buffer.. no matter if it is updated by uC or not... 
Now on LabVIEW 10.0 on Win7

Similar Messages

  • How to detect disconnect tone in spa112

    In spa-3102 is very easy: http://ubuntu4us.corp.eng.br/artigos/voip/asterisk-pbx-and-linksys-spa-3102
    How to detect disconnect tone in spa112 ????

    SPA112 has no FXO line at all. It have FXS lines only.
    Analog phone devices connected to FXS port could just hang-up if they are wishing to terminate the call. No busy tone detection is necessary nor implemented for FXS port.

  • I w'd like to know if LabVIEW 6.0 Application Builder includes the daqdrv (for data acquisition) and serpdrv (for serial communication) support files by default.

    Building an application to communicate to a device by serial port

    Hi velou
    The LabVIEW 6i Application Builder no longer requires daqdrv. Regardless of your Application Builder and LabVIEW version, you must always install the appropriate driver files on the target machine. For example, if your application communicates with a DAQ board and a GPIB board, then you must install NI-DAQ and NI-488.2 on your target machine. If you are using the VISA VI's for serial communication, than you have to install NI-VISA . If you are using the "old" serial VI's, than you have to include serpdrv separately.
    Luca P.
    Regards,
    Luca

  • How to detect AIR for Android closing app event? AIR analog to Activity.onDestroy()

    How to detect AIR for Android closing app event (remove app from dock "Recent Apps")?
    In AndroidActivityWrapper.StateChangeCallback exist method onActivityStateChanged. But he have only DESTROYED state, which it seems received where app finish exiting. Activity.onDestroy() called if app start exiting.

    DPI aside, you can just set your resolution on the project to the target devices resolution to preview how it will look. While vectors will render much smoother on the device (higher DPI), it's a very easy way to target various resolutions for testing.
    If you have the full CC suite you might want to consider using Flash Builder 4.7 which has many different device presets and allows you to create your own presets to mimic tablets and phones. It really depends how complex your project is to move over to FB.

  • HT201343 how to detect appletv for mirroring?

    how to detect appletv for mirroring?

    Be on same network, apple id with homesharing on for ATV and Mac or iOS.  Always try a reboot of router and ATV with all cables out for 30 Seconds too.  Mirror icon should appear near clock IF you have a mid 2011 mac or newer (early 2011 for MBP) AND are running OSX 10.8 Mountain Lion or newer.
    Oler mac or OS can 'mirror' with a third party app called airparrot.

  • How to send data using serial Communication

    I want to make serial communication using RXTXcomm.jar file.I was written the code.From this I got the list of serial ports avilable on pc but then after when I was tring to send command to machine which is attached to port it didn't gave any reply.
    Tell me that how to send command to port?

    This is how I do it:// open port, get ownership
    SerialPort serialPort= (SerialPort)portId.open(APPLICATIONNAME, timeout);
    // no framing and no threshold
    serialPort.disableReceiveFraming();
    serialPort.disableReceiveThreshold();
    // communication speed, parity, stopbits and databits
    serialPort.setSerialPortParams(BAUDRATE, SerialPort.DATABITS_8,
         SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);
    // no handshaking or other flow control
    serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE);
    // timer on any read of the serial port
    serialPort.enableReceiveTimeout(TIMEOUT);
    // open streams for reading and writing
    InputStream is= serialPort.getInputStream();
    OutputStream os= serialPort.getOutputStream();... then you use the 'os' stream for writing and the 'is' stream for reading.
    kind regards,
    Jos

  • How to detect  collssion for random or Duplicated movie clips

    Hey guys .. i am back with set of query..till now .. key
    press movement a rocket (mc) is moving left right up down in a
    defined stage area. and i am able to generate some fire balls
    randomize falling from top. this is just i am duplicating the movie
    clip(fireball_mc) .... now i want incase or when the rocket (mc)
    touch the fire ball programm shold detect the collsion and generate
    a score board. well for this i have tried a script for two movie
    clips ... wchich is working but ..i don know or i m not gettng the
    logic how to detect the collission for duplicated movie clips...
    well i m just giving the script for oinly 2 movie clips
    coliding...can any one tell me how to do it with randmize or
    duplkicated mcs??
    for 2 movie clip ...
    _root.mc1.onEnterFrame = function() {
    if(this.hitTest(_root.egg)) {
    _root.result="Oh no..... we are dead";
    } else {
    _root.result="we are going fine";
    (this is happening ..but let me know how can i get the same
    result for ranndom mcs)
    hope someone can help me out ...
    i appriciate ur valuable time to read this..
    thanking you

    Hey thx for ur suggestion...but as i said m very much new to
    actionscript (more designer) so i don have much idea... most of the
    things i m doing for this game i m going through lots of references
    then i tried to understand te codes m implmenting them to my
    need..can u explain me little more about arrays u haves asked for
    loops u asked me to use the hittest function..please /.. i will be
    greatfull to u... thx

  • How to code this with serial communication?

    Here's What I Want To Do.
    There are two computers A and B. I send some variational data, 1.2,3.4 for example, from A to B once per second. If B has received the right data, he will send "Yes" to A, otherwise he will say "No". If received "Yes", A will get ready for the next data-sending. If "No", A will send the data again.
    The examples with LabVIEW for VISA communication are all like that one computer is listening and the other one is writing all the time. So can you help me with two simple VIs for computer A and B?
    Regards.

    You need to connect the two computers' serial ports with a Null Modem Cable (Tx/Rx, CTS/RTS, DTR/DCD reversed). The put the attached vi on computer A. It will send a command from an array, and wait for a response from computer B. If the response is Yes, then the next command will be sent. If not Yes then A will send the same command again and wait for a response. There is an Abort button if you want to abort, but it will only abort the current command. You can modify it to abort the whole thing by using a while loop to replace the for loop, and using the abort button to exit the while loop. I'll leave the coding up to you. You will have to write a vi to reside on B. I'll describe it but you can code it, good practice. Computer B should start off initializing the com port, like in the attached vi. Then loop at Bytes at Port until some bytes come in, then read the bytes. Use a comparison (equal) to check if the data is good. Use a case structure to define what to send back to computer A (Yes or No). Then write it back using Visa Write. Loop around the entire thing except for the com port init. Close the Visa after the main loop.
    - tbob
    Inventor of the WORM Global
    Attachments:
    COM_AtoB.vi ‏50 KB

  • How to develope LabVIEW for GPIB Communication check?

    I would like to check for GPIB communication using Labview.How to check it?

    Hi,
       You can use the GPIB vis located at Functions>>Instrument I/O>>GPIB palette.
    See attachment.
    Attachments:
    GPIB-vis.Jpg ‏411 KB

  • Using TestStand How I pass an array of data into a DLL (IPC3.dll) for serial communication

    I am ussing a DLL created by another party. I have the list of the C declaretions. I have been able to write a seq that can turn the comport ON/OFF or select a different port but I have not been able to send or recieved any data. I have created an array of bytes(unsigned 8-bit integers)to send and recieved data but nothing goes out or in.

    Hi Toro,
    There is an example in your \Examples\AccessingArrays\PassingArrayParametersToDLL directory that illustrates exactly how to pass TestStand arrays as arguments to dll functions. The source files for the .dll are located in the same directory.
    For more information on passing arrays as parameters to modules you should read the "DLL Flexible Prototype Adapter" section of Chatper 13 in the TestStand User Manual, and pay special attention to the subsection entitled "Array Parameters". You can access the User Manual from the TestStand Start Menu group, the TestStand Sequence Editor's Help menu, the \Doc directory, or online at the following link:
    http://digital.ni.com/manuals.nsf/websearch/50B69DA356B8D38C86256A0000660E6B?OpenDocumen
    t&node=132100_US
    Jason F.
    Applications Engineer
    National Instruments
    www.ni.com/ask

  • Best efficient general practice for serial communication

    hello,
    when talking to a serial instrument, do you have to insert millisecond waits in the while loop or will the reading and writing from the instrument generally control the loop speed of the loop?  On the basic read write example they feed in the Bytes at Port into the VISA Read.... is this making the VISA not read until those bytes are avilable? I'm wondering if this was in a while loop if the loop would only iterated once the VISA has executed the read... which in turn depends on whether the bytes are avilable at the port?
    I'm trying to figure out a general best practice way of setting up a serial device in an effecient manner, for something where you send a write then read.... in the basic serial read write example there is a delay in-between the write and read... is this an arbitrary number? does it need to be there if you're not reading until a specified number of bytes are at the port anyway?
    much thanks!

    As far as I use the serial VI's for communication I do not use Loops, I do use loops when I need to send a bunch of query commands. Bytes at port just gives a count that how many bytes are there at the port, even if you don't use it and wire byte count in read VI you must get the response, but you will not be sure whether you have recieved exact data. Time delay between write command read response also depends on how the protocol is setup.
    I would always prefer VISA configure -> Bytes at port -> Read (this will empty any previous buffer)-> Visa write -> Bytes at port -> Visa read -> Visa Close.

  • How to detect signals from serial or parallel ports?

    Hi everybody!
    I'm developping a p.o.s. app, and I need to detect the printer status (serial or parallel), but I couldn't find the way to do it (I'm using Text_IO). I know about using a C program, but I want to find a simpler way.
    Is there any command or trigger in Forms 6?
    Thank you for your help

    Hi
    In your setup you have a ADAM 4250 RS232/485 repeater talking with 7 instruments in a network. Each instrument have a unique address, and you can only address 1 instrument at a time. If you need more speed you have to insert more ADAM 4250 units in your system and more RS232 ports on the PC. Identical ADAM instruments may receive commands over the same communication line, but transmit data on a unique communication line. You can not use the parallel port in your setup at all. This is not a Labview problem but a hardware problem. If speed is critical maybe the Ethernet I/O Modules: ADAM-6000 series are better for your setup 
    Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
    (Sorry no Labview "brag list" so far)

  • How to upgrade system from serial communication to parallel communication

    Hi,
    I am working on Lab VIEW 8.5.In my project I am using ADAM cards(7) for analog/digital inputs/outputs. Communication is done via RS 232 serial cable. Right now my system is working fine, but if i want to make it more fast i will need to use parallel communication right? Because Simultaneous inputs and outputs are processed. How much my communication file will change? Which card i should use?
    How to upgrade system? On which factors it depends or it affects? I need guide lines.
    Thank you
    Gaurav k
    CLD Certified !!!!!
    Do not forget to Mark solution and to give Kudo if problem is solved.

    Hi
    In your setup you have a ADAM 4250 RS232/485 repeater talking with 7 instruments in a network. Each instrument have a unique address, and you can only address 1 instrument at a time. If you need more speed you have to insert more ADAM 4250 units in your system and more RS232 ports on the PC. Identical ADAM instruments may receive commands over the same communication line, but transmit data on a unique communication line. You can not use the parallel port in your setup at all. This is not a Labview problem but a hardware problem. If speed is critical maybe the Ethernet I/O Modules: ADAM-6000 series are better for your setup 
    Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
    (Sorry no Labview "brag list" so far)

  • Advanced queueing: How to detect disconnect/database down if using callback

    In my last thread here, I was able to create a callback mechanism for fetching messages posted to the AQ-queue. This means I can get rid of the loop that polls for messages, that we had earlier.
    In the loop I could detect network problems, because the Dequeue function would throw an exception. When I have a callback, no exception is thrown, since I do not try to dequeue before I know there is a message there.
    How can I handle detection of network problems/database problems when using callback? If not handled, the program thinks no mesages is sent, while actually the network might be down...
    I'm not to keen on looping and polling to check for network status, as the whole point of callback was to avoid this :)
    Regards,
    Sverre

    update: I've tried to use both the OCI and OCCI failover callback, but it is not called when e.g. the network cable is disconnected.
    Is there any way to get occi to notify me when there is something wrong with the connection? Right now my callback is never called again, if the network is disconnected and reconnected...
    Anyone?

  • How to do settings for serial numbers during  sub contracting

    Hi,
    i want to serial numbers to be populated when i do GR for a subcontracting PO. then it will be used in house  for another higher assembly where it  assigns another set of serial numbers  and that higher assembly is sold to the customer. then can i have a trach of all these serial numbers which have been used in different assembly levels.
    how the case happens when you reject a sub contracing item which  has been Competed with GR. Please tell me what are the settings to be done for it.
    rgs
    madan

    if  proper serial no. profile assigned to material in storage data1/2 data, u can assign serial no to material at GR as well as at production & at delivery..
    u can track this material by serial no.
    If u received material from subcontractor, u can return same by cancelling material doc. or return 122 O.
    but while receiving next time u have to enter another sr. no
    You can check the SAP Note 74017

Maybe you are looking for