RS232 HANDSHAKING

I have built a system that uses a Xilinx Spartan II to decode and route signals from a collection of motion control and feedback devices. LabVIEW communicates with the FPGA over RS232 at 115200baud, with no parity, 8 data and 2 stop bits. I have tried to implement a basic handshaking arrangement in which data is not sent from the FPGA until the RTS line is toggled.
I have written a sub-Vi that uses the core of the Advance Serial Communications example VI. I have been experiencing timeout problems if I run this VI continuously. My best guess is that I have a race condition between the port actually becoming ready to receive data and the start of data transmission. The framework of this sub-VI is as follows:
1. configure port
2. toggle RTS line
3. set input buffer size
4. read port
5. close port
The delay within the FPGA is negligible and the port register should be empty and ready to receive data before I signal the start of transmission. When does the port become ready to do so?

Daniel,
If you are using a Whileloop structure in your code, you do not need to use the "Run Continuously" option in LabVIEW. You do not want to open and close your serial port all the time but instead only do the write and read continuously.
Try run the example vi and verify your system setups are correct. You can also use NI-SPY to capture the execution of your code and see where exactly the timeout occured. If you are worriing about the data not being ready when the VISA read happens, you can use a longer timeout value or have a delay before the read starts.

Similar Messages

  • I am trying to use the RS232 to control a circuit board. It would have to simultaneously output SerialClock, DataIn, and Chip Select signals, while also receiving DataOut signals; therefore 4 signals total. Does anyone know if it this is possible?

    I am trying to splice 4 wires out of the RS232 serial cable (the 9-pin type) and wire them to a circuit board. The 4 wires would control 4 signals: DataIn, DataOut, SerialClock, and ChipSelect. The serial clock would synchronize the DataIn and the ChipSelect is asynchronous. DataOut must coincide with SerialClock also; therefore there are 3 signals that must be able to switch concurrently. All the handshaking enabled by RS232 is thus unnecessary in my opinion. Does anyone know of how this can be done?

    I am trying to splice 4 wires out of the RS232 serial cable (the 9-pin type) and wire them to a circuit board. The 4 wires would control 4 signals: DataIn, DataOut, SerialClock, and ChipSelect. The serial clock would synchronize the DataIn and the ChipSelect is asynchronous. DataOut must coincide with SerialClock also; therefore there are 3 signals that must be able to switch concurrently. All the handshaking enabled by RS232 is thus unnecessary in my opinion. Does anyone know of how this can be done?

  • How to get status of an rs232 connection

    Hi,
    I am trying to read out the status of on RS232 connection.
    How can I do this?
    Moreover would it be great to make the handshake visible! Is there a way that I can do that?
    I would like to make a program something like where I can push a button "connect", get the status that i am connected and then make it possible to send some data....
    I would really thank you if you can help me.
    Sincerely Tim

    The more fundamental problem is that except for an indication of whether or not it has been initialized and perhaps the number of bytes in the port buffer, a serial port doesn't have any sort of real status. RS232 communications simply isn't that sophisticated. For what it's worth, unless the device you are working with is very old, monitoring the handshake lines probibly won't tell you anything because most modern serial device don't use any handshaking.
    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

  • DMP-4400, rs232 commands not being sent to device

    Recently we had deployed 16 DMP-4400 attached to televisions in our environment. All of them are configured identically, and have the same model of TVs attached to them. Four of them refuse to pass rs232 commands to the attached TVs, and are much slower to load the content to be displayed, a significant difference in loading time.  Disabling the rs232 allows the content to load at a normal speed.
    I have replaced the rs232 cables, wiped out the configuration and reconfigured.
    The rs232 is being enabled with the following command:
    init.startService_rs232=yes&rs232.device=/dev/ttyS1&mib.save=1&mng.reboot=1
    Firmware version 5.2.3
    The rs232 parameters from the DMP:
    rs232.device          T_STRING          /dev/ttyS0
    rs232.speed          T_STRING          9600
    rs232.parity          T_STRING          none
    rs232.data_size          T_STRING          8
    rs232.stop_bits          T_STRING          1
    rs232.flow_ctrl          T_STRING          none
    rs232.tx_hex          T_STRING
    rs232.tx_str          T_STRING
    rs232.rx_buf          T_STRING
    rs232.rx_overflow_flag          T_STRING          false
    rs232.tx_cnt          T_STRING          0
    rs232.rx_cnt          T_STRING          0
    When sending a command the rs232.tx_hex string should populate, and the rs232.tx_cnt should increase in value, these values never change. The commands are being sent from DMM version 5.3 and work on the 12 other DMPs that are in place.  Connecting a rs232 sniffer also shows that nothing was sent from the DMP.
    Anyone have any ideas?

    It seems impossible to purchase RS232 cables with the correct pinout, everyone sales the cable with "RS232 null modem with full handshaking".  For this you need the "Simple RS232 null modem without handshaking", which only uses the 3 pins, 2, 3, and 5.
    I ended up making my own cables, using RJ-45 to DB9 Adapters, and pinning them myself. Flipping TX and RX on one end, after this everything worked as expected.

  • Data acquisition using rs232

    Hi Everyone!
    I need help with the communication of RS232. The hardware which I have sends data continuously to the RS232 cable (The data is digitised). I need to plot these data with the help of LabVIEW coninuously. The VI file I have as of now, doesn't even receive data. I would be glad if someone could guide me as to where I am going wrong. I am attaching the VI files for the reference.
    Regards,
    Akriti
    Attachments:
    Configure Serial Port.zip ‏49 KB

    (Almost) every serial communication device is different -- it may use a different port, have a different Baud rate, use different handshaking, have its own command structure (what you send it to get it to send back to you), and have its own data structure (does the data come back as Binary, Ascii, etc.).
    One way to just check that the communication is working is to fire up MAX, choose the COM port to which you think your device is connected, and open a Test Panel.  You can there set various communication parameters, baud rate, parity, and so forth.  You can also send and receive characters, with or without terminators (\r, \n), and ensure that you can get (some) two-way traffic.
    Once you have this, I recommend duplicating the simplest aspects of this in a test LabVIEW program.  For example, configure the selected COM port using the parameters that you determined seem to work.  Send (using the same method you used in MAX, with or without terminators) a simple command, such as the "Identify yourself" command.  Try to do a Read (either a fixed number of bytes, or a "lot" of bytes, depending on how you have things configured) and see whether or not you get anything (including an Error on the Error line) back.
    If the simple code works, compare it with your more sophisticated code that you attached, and see where they differ.  If it fails, post what MAX taught you about your device (including what you were able to send and what you were able to receive), and post your simplified (no loops, just straight sequential VISA functions to open, configure, write, read, status, and close the port) code, including telling us what happened.
    Bob Schor

  • SR830 Converted to RS232

    Hi all,
    I am new to Labview. As all of us know, there is only GPIB driver for SR830 lock-in amplifier. And I try to convert it to serial. I looked through the forum and I followed some intructions online. I replaced the GPIB functions with Visa functions and have a look at the 34401 to learn how to configure a RS232 driver. But when I run the program, the error happens at the Query ID part which I did not change.
    Does anyone know how to make it work?
    Also I have a problem with the connection. I use a serial to usb adaptor to connect lock-in to my computer. I am wondering whether I need to modify something in the program to let it know I am using a serial to usb adaptor.
    When I directly plug in my serial cable to the computer, there is no response of computer. How can I solve this problem?
    So my question is about the program and the connection.
    Thank you!!

    Most USB to serial converters work as they should. But they need a driver installed in order to work. You must also find out which alias the system use for that port. And it will change as you change USB port for the converter. Do you have the SR830 manual? If not find it using Google
    From the manual we have
    COMMUNICATING WITH RS232
    The SR830 is configured as a DCE ( transmit on
    pin 3, receive on pin 2) device and supports CTS/
    DTR hardware handshaking. The CTS signal (pin
    5) is an output indicating that the SR830 is ready,
    while the DTR signal (pin 20) is an input that is
    used to control the SR830's data transmission. If
    desired, the handshake pins may be ignored and a
    simple 3 wire interface (pins 2,3 and 7) may be
    used. The RS232 interface baud rate and parity
    must be set. These are set with the [Setup] key.
    The RS232 word length is always 8 bits.
     And then
    A command to the
    SR830 consists of a four character command
    mnemonic, arguments if necessary, and a command
    terminator. The terminator must be a linefeed
    <lf> or carriage return <cr> on RS232
     If you have not done it start simple. Go to help in toolbar. Then select Find Examples and search for serial. Locate the example "Basic Serial Write and Read.vi" Then use this as your workhorse to test coomands. It could be that you need to modify it somewhat
    Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
    (Sorry no Labview "brag list" so far)

  • Comunicacion rs232

    hola 
    estoy realizando la comunicacion del puerto serial con un multimetro mastech  mas-345 y ala hora de conectarlo con la tarjeta (usb to RS232 de national instrument)
    no me manda ningun byte 
    Attachments:
    puerto1.vi ‏15 KB

    From Google:
    I am doing serial communication port with a multimeter mastech mas-ala 345 and time to connect with the card (usb to RS232 national instrument)
    do not send me any byte
    See if this thread helps.  It talks about needing to power the serial lines by setting some of the handshaking lines.
    http://forums.ni.com/t5/LabVIEW/DMM-MAS345-via-RS232-serial-comunication/td-p/898987

  • Serial data transmission through RS232

    Sir,
    Can I interface RS232 of PC with PIC16f877A using Labview.? If Yes
    Please help me out
    Yours Sincerely,
    Solved!
    Go to Solution.

    Can you use the microcontroller to perform the RS-232 communications?  LabVIEW can easily communicate over the RS-232 port of a computer.  If you go to "Help->Find Examples..." in LabVIEW and search for "serial read write", you should be able to find a few examples.
    Do you know your communication settings?  Baud Rate?  Start Bits?  Stop Bits?  Handshaking?
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • RS232 optical isolation ... and compliance with IEC 601

    Hi.
    We are installing a system for performing RS232 data acquisition between PCs and a certain medical instrument (an Agilent CMS).
    We would like to comply with the IEC 601-1/2 standards which require optical isolation for up to around 4000V.
    We have found various optical isolator products but only ONE that is IEC 601 compliant:
    http://www.telebyteusa.com/catalog/products/269.htm
    But, this product only provides isolation on 3 of the serial lines (TD, RD and ground). Our instrument uses other lines for handshaking purposes.
    Do you all know of any other RS232 isolation hardware that will provide IEC 601 compliance on ALL the serial lines?
    I have found some isolators that provide for all seria
    l lines, but only for up to around 2500V.. and none of them mention IEC601.
    In fact, ANY advice on optical isolation or IEC601 would be appreciated.
    -John Osborne
    John Paul Osborne
    CARDIAC
    Vipeveien 51
    3917 Porsgrunn, NORWAY
    tel: +47 35 93 06 20
    fax: +47 35 93 06 66
    [email protected]
    http://www.cardiac.no

    I'm a bit confused about NI's serial cards, though.
    In the catalog, all the serial cards that have isolation also say that their "Signal Compatibility" only covers the 5 lines: RXD, TXD, GND, RTS and CTS.
    We need isolation on all 9 serial lines. We use the other lines for handshaking purposes.
    Do these NI cards provide isolation on only those 5 lines? If so, do they even allow communication on the other 4? The catalog doesn't actually explain what "signal compatibility" specifically means (and I'm a layman).

  • Question about slow rs232 equipment

    I tried the examples for rs232 communication, it works fine.
    but my equipment is slow and needs delay between each character.
    i didnt find any input to Visa write or other control which enables me
    to do this.
    can someone tell me how to do this?
    again: to make a delay (inter digit pause) between each character send.
    thanks in advance

    A PIC for instance does not have a FIFO for its standard serial port module. You get a byte in a register and if you are not fast enough before the next byte is ready things might go wrong. Of course writing the PIC formware in such a way that it can always deal with the maximum input rate (for instance 9600 baud => ~1ms per byte) is the real art here.
    Also you can consider handshaking too, although the PIC module does not have this automatically.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Cts/rts handshake

    Hi,
    For a PI motion controller I need according to the manual the rs232 cts/rts handshake. As I have seen this can be selected from the 'open serial port.vi'. However, the instrument driver provided by the manufacturer doesn't switch the handshaking on in the open serial port.vi .
    If i switch the handshaking off i can see a signal at pin3 of my serial port. I also see something when I switch on either RTS or CTS. When I switch on both I don't see anything (that's what I might expect). But -and here is my question- I never see anything on the RTS pin of my serial port, nomather which handshake settings in the 'serial port open.vi' .Could anybody give me suggestions about the RTS/CTS handshaking for LAbview ? I'm not using the VISA package since the
    instrument driver from the manufacturer didn't use it. I'm working with Labview 6.1 and SUSE linux OS.
    Thank you very much

    The native serial vi for opening a serial port in LabVIEW is Serial Port Init.vi. Open serial port.vi is not a native function. You may want to check on the origins of this vi. You also mentioned switching on RTS and CTS. The CTS line is an input, what do you mean by setting it? To set RTS, are you using serial line ctrl.vi? When you just open the port with RTS/CTS handshaking you should be reading a positive voltage on the RTS line, pin 7.

  • RS232 - Timeout / RTS-CTS

    Is it possible to define a Timeout when using the "ComRdByte" Function,
    so that CVI will not break down, when no byte was send.
    I´ve also problems with the RTS/CTS-Signal. If i use them , it is not
    possible to read from the port ! There is nothing happening on these
    lines.... can you help me ?

    You can either set a timeout for read/write operations with the SetComTime function or set up a callback function to be called whenever there is a certain number of bytes at the port with the InstallComCallback function. I am a fan of using the InstallComCallback method and if you want to know exactly how to use it look at the example in the C:\MeasurementStudio\cvi\samples\rs232 directory.
    Only use the handshaking modes that are supported by the device you are connecting to. Meaning either use hardware only, software only, hardware and software, or none. All are very common. In your case it doesn't appear that hardware is working for you, so to turn it off use the SetCTSMode function to turn hardware handshaking off.
    Jason Foster
    Applications Engineer
    National Instrume
    nts
    www.ni.com/ask

  • SSL handshake failure

    Hi,
    I have to establish the connection from SAP WebAS to an Apache server via HTTPS.  The Apache authentication is based on client certificates. But I'm still unable to establish a connection. Everything runs fine via HTTPS if client certificate authentication is disabled on Apache (anonymous access). But as soon as client authentication is enabled, the icm log displays the following failure:
    [Thr 1800] *** ERROR during SecudeSSL_Read() from SSL_read()==SSL_ERROR_SSL                                                    
    [Thr 1800]    session uses PSE file "/usr/sap/E3T/DVEBMGS00/sec/SAPSSLC.pse";;                                                   
    [Thr 1800] SecudeSSL_Read: SSL_read() failed --                                                                               
    secude_error 536872195 (0x20000503) = "handshake failure"                                                                    
    [Thr 1800] >> ---------- Begin of Secude-SSL Errorstack ---------- >>                                                          
    [Thr 1800] ERROR in ssl3_read_bytes: (536872195/0x20000503) handshake failure                                                  
    WARNING in ssl3_read_bytes: (536875072/0x20001040) received a fatal SSLv3 handshake failure alert message from the peer        
    [Thr 1800] << ---------- End of Secude-SSL Errorstack ----------                                                               
    [Thr 1800] <<- ERROR: SapSSLRead(sssl_hdl=0x115f8a310)==SSSLERR_SSL_READ                                                       
    [Thr 1800] ->> SapSSLErrorName(rc=-58)                                                                               
    [Thr 1800] <<- SapSSLErrorName()==SSSLERR_SSL_READ                                                                             
    [Thr 1800] *** ERROR => IcmReadFromConn(id=3/1967): SapSSLRead returned (-58): SSSLERR_SSL_READ [icxxthrio_mt 2539]            
    [Thr 1800] *** ERROR => IcmReadFromConn(id=3/1967): read failed (rc = -1) [icxxthrio_mt 2611]                                  
    [Thr 1800] *** ERROR => IcmHandleNetRead(id=3/1967): IcmReadFromConn failed (rc = -1) [icxxthrio_mt 1304]  
    In the Apache logs, it seems that SAP is not sending a client certificate. So Apache closes the connection. Do you have an idea how I can make SAP WebAS send the certificate ?
    Thanks in advance
    Christan

    Hi,
    >Because the third line in your log says that no PSE could be found?
    I'm not sure of that.
    Here is an extract of the log of an ICM starting without a client certificate in STRUST
    [Thr 4392] =  secudessl_Create_SSL_CTX():  PSE "D:\usr\sap\PPI\DVEBMGS74\sec\SAPSSLC.pse" not found,
    [Thr 4392] =      using PSE "D:\usr\sap\PPI\DVEBMGS74\sec\SAPSSLS.pse" as fallback
    [Thr 4392] ******** Warning ********
    [Thr 4392] *** No SSL-client PSE "SAPSSLC.pse" available
    [Thr 4392] ***    this will probably limit SSL-client side connectivity
    [Thr 4392] ********
    [Thr 4392] = Success    SapCryptoLib SSL ready!
    Here is an extract of the log of an ICM starting with a client certificate in STRUST.
    [Thr 9208] =================================================
    [Thr 9208] = SSL Initialization  on  PC with Windows NT
    [Thr 9208] =   (700_REL,Mar 19 2007,mt,ascii,SAP_UC/size_t/void* = 16/64/64)
    [Thr 9208]   SapISSLComposeFilename(): profile param "ssl/ssl_lib" = "I:\usr\sap\DXI\DVEBMGS68\exe\sapcrypto.dll"
               resulting Filename = "I:\usr\sap\DXI\DVEBMGS68\exe\sapcrypto.dll"
    [Thr 9208] =   found SAPCRYPTOLIB  5.5.5C pl17  (Aug 18 2005) MT-safe
    [Thr 9208] =   current UserID: BT0D0000\SAPServiceDXI
    [Thr 9208] =   found SECUDIR environment variable
    [Thr 9208] =   using SECUDIR=I:\usr\sap\DXI\DVEBMGS68\sec
    [Thr 9208] = Success    SapCryptoLib SSL ready!
    Christian,
    Could you restart the ICM and check the trace file to find out if you get the message about a missing SAPSSLC.pse ?
    Regards,
    Olivier
    [Thr 9208] =================================================

  • How to do Handshake with tired party(bank) HTTPS URL from SAP PI server

    Dear Expert,
    I have developed bunch of scenarios, all are synchronous ABAP proxy to HTTP_AAE with bank on PI 7.4(dual stack). Bank web server is HTTPS enabled server. Our ABAP developments are still in progress also we have few issue in connection from ECC to PI.but that is not the focus of discussion here.
    we want to do the handshake to check the connectivity with bank on their HTTPS URL from PI. Bank has provided the privet key for SSL from their server and corresponding public key they have maintained on their server. I have imported the private key under NWA -> Certificates -> Key Storage -> TrustedCA->Import Entry->Entry Type->PKCS#12->select the SSL.p12 file->import , also I have selected the option to "Use SSL" in HTTP_AAE receiver communication channel and selected the corresponding entryin  "keystore view" and "keystore entry". All these I have done in our DEV system, and we are trying to connect our PI dev to bank Dev server.
    Questions
    Is there any specific steps to do the handshake with third party HTTPS(bank in my case) server? if not, how can we just test the HTTPS connectivity by using the SSL private installed on our PI server, without running the complete scenarios. Our PI has been installed on UNIX, and "telnet https url 443" is working, as network team has opened the HTTPS port.
    We have not enabled the SSL technically on our PI server, and we have not installed any generated certificate from our PI server. Moreover, we have not made our PI url as "https:hostname:port" as we just need to communicate with bank by using their private key. Do you guys think we should enable the SSL? if yes, please explain why.
    What is the best practice to test the connection with third party having HTTPS URL? how can I just assure HTTPS communication is working fine, before testing my actual scenarios.
    Thanks for helping always.
    Regards,
    Farhan

    Hi Farhan,
    Some part of the blog is applicable for sending HTTPS request to partners/third party (Receiver SOAP Adapter).
    If banks certificates are already in trustedCA, then,  can you check if it also imported under user PIISuser under Identity management in NWA. If above 2 steps are done then i think your are good to go. But be careful when you install certificate, it should be in proper order.
    As you already mentioned, connectivity is already established and you are able to PIng/telnet from pi server, connectivity looks ok.
    While sending request, if you are getting 401 unauthorized, below might be the reason -
    1. Certificate not installed correctly or some missing steps
    2. Partner or TP is not ready to receive it, some certificate issue in there side.
    other than 401 means you are ok (As per certificate and Connectivity) - 403 and 500 errors are next stops.
    403 - error because of encoding method.
    500 - data issue.
    Regards
    Aashish Sinha

  • I am receiving the data through the rs232 in labview and i have to store the data in to the word file only if there is a change in the data and we have to scan the data continuasly how can i do that.

    i am receiving the data through the rs232 in labview and i have to store the data in to the word or text file only if there is a change in the data. I have to scan the data continuasly. how can i do that. I was able to store the data into the text or word file but could not be able to do it.  I am gettting the data from rs232 interms of 0 or 1.  and i have to print it only if thereis a change in data from 0 to 1. if i use if-loop , each as much time there is 0 or 1 is there that much time the data gets printed. i dont know how to do this program please help me if anybody knows the answer

    I have attatched the vi.  Here in this it receives the data from rs232 as string and converted into binery. and indicated in led also normally if the data 1 comes then the led's will be off.  suppose if 0 comes the corresponding data status is wrtten into the text file.  But here the problem is the same data will be printed many number of times.  so i have to make it like if there is a transition from 1 to o then only print it once.  how to do it.  I am doing this from few weeks please reply if you know the answer immediatly
    thanking you 
    Attachments:
    MOTORTESTJIG.vi ‏729 KB

Maybe you are looking for

  • On starting mini I get a blue screen

    Bu pressing the start button the mini goes into pause and I can get the normal screen by awaking the computer. However clicking on any icon does not work for several minutes. I would appreciate suggestions on how to approch solving this anomoly. Virg

  • My itunes u is not working on my ipad 2 with ios7

    It is blanc and the update for the bibliotheek is working. But i see nothing.  I removed the application and downloaded it. But still nothing

  • How to avoid dual maintainence of BP in R/3 and CRM

    Hello Everyone, As you are all aware we cannot maintain financial information (like company code data) in the CRM system and at the same time we cannot maintain marketing attributes in SAP R/3. What is the preferred approached used by Clients to over

  • External drive works with TC intermittently

    Hi there, I bought a 1TB TC about 4 months ago after my last backup drive failed (at a fairly inopportune time I might add). I have decided to take some extra steps to ensure I don't lose my data again. I have bought a USB hub to which I have attache

  • I have a question about the data type static

    for any of you that read my last post for my assignment this is still the same thing but i have broke it down more, but i am getting an error and i am not for sure i understand why that is. I think i am confused on why i should, or could use a static