Simple serial using RS232 communication

Hello

I did some research on how to read and write with the serial RS232 port. The only example I found was a test program that is really involved. All I do is pass 7 bits of information that are going through a digital communication kit then read the same 7 bits of information after the kit Comm. (bits, parity of 7 bit stop bits not included... ect).

So I just need to

-Desired TX 7 bits of information comm kit (in addition to the necessary stop bits)

-Information cross kit comm (short delay)

-PC receives the same bits of return.

Any help would be appreciated!

IM using CVI version 9

The byte field should be the data you want to send the kit of comm.

It's something you need to know.

Status fields give you information on the question of if the function call completed successfully.

Most of the time 0 means success and error average of negative values. But you should read the function for each function to be sure about this.

When you receive an error code you can use the GetRS232ErrorString function to get a verbal description of the error.

number of bytes written, as its name implies, represents the number of bytes transferred to the COM port. You wait for the value to be equal to the number of bytes to send to your application.

Hope this helps,

Tags: NI Software

Similar Questions

  • Real-time using RS232 communication

    Hi all

    I want to read a serial port at all times. Transmission speed is 2400. All the 1 sec 5 data packets are sent by the transmitter (hardware). Data package consists of 4-byte ASCII character as-A, d1, d2, d3. . Where A is used for synchronization of the data set, because d1, d2, and d3 are random and should be isolated for furthur v.f.. Here I am attachng my VI.

    Problem:-instead of get 5 packs in 1 second I'm receiving only 2 packages in a second.

    Questions:-ground for above problem? Y at - it another way to do it in real time. ? improvements to the VI Suggetions.

    Please answer for above post your answers will be a great help for me. Please do not hesitate to ask any necessary clarification.

    Thank you!

    @smercurio: Thnak you for your response. You are correct that globle variables were used to transmit the data received from other loops. As you say I will use local variables instead of globle variable.

    In addition, I would like to indicate more clearly that I forgot to mention that each byte 4 data are transmitted in the interval of 200ms. This 200ms includes the time required to transmit also the 4 bytes.

    Earlier, my second loop has been integrated into the 1st loop itself. But since I was getting only 2 packages instead of 5 in one second, I removed this reflection to loop 1st form it might take time for the loop iteration. But stil problem is not solved.

    Do you not assign data received by globle variable is taken on time?

    Note * I have varified 5 packet rate / sec using Terminal Server.

  • Chroma DC power supply RS232 communication (read problem of over-voltage and current)

    Dear all.

    I chroma programmable DC power. Based on the programming of the Instrument manual I develop using RS232 communication. Based on the program I can set the voltage, current, over-current protection, protection against overvoltages and make IT / OFF out put supply perfectly.

    But I have to read the measured values of the output power as current and voltage. Measured applications are the voltage and current of the output of the power supply. My problem is two of them read at the same time. Currently, the reading is only voaltge or current (if the first request is v? it is voltage read out but no reading for the current) and if the first request is CURR? the reading for the current, but not for VOLT? The status message is OK, even if it is to read values.

    Thanks in advance

    What I see in your program, it's that you do not use the stop for reading character. For your writing, you do the hard with all these concantanate string functions. You can set the stop character for all entries with a node unique propert - "ASRL end Out.

  • How interface bronkhorst RS232 communication flowmeter in DIAdem DAC?

    Hello

    I am Thiyagi.I am working in WABCO INDIA Ltd. I bought Bronkhorst Flowmeter. I use the tiara DAC Professional version. I want the meter to DIAdem.Flowmeter of the interface have a RS232 communication. In my pc, I have a COM1 port. DIAdem DAC which icon I want to use to connect the flow meter.

    Hello hmongz

    You can already succeeded, but still, here's what I used to do:

    I could do this with flowmeters mass Bronkhorst and Brooks, and had a pretty good success using their method of DDE (dynamic data exchange). To do this, download their software from FlowDDE of Bronkhorst.com, start the DDE driver and he can communicate with the MFM. Once it works, insert a DDE lockk in CAD DIAdem, configure it appropriately and it should work.

    Greetings

    Michael

  • I bought CS4 - have the box etc serial # - use an IMac with Snow Leopard - went to use the bridge and a screen came saying Adobe Bridge HOme Service was interrupted to concentrate on other resources... uh, I bought this software and how can we now

    I bought CS4 - have the box etc serial # - use an IMac with Snow Leopard - went to use the bridge and a screen came saying Adobe Bridge HOme Service has been discontinued for focus on other resources... uh, I bought this software and how it can now be 'gone '? Pls help - bridge is very convenient and I paid for it!

    See here:

    Deleted Adobe Bridge Home service

  • Problems with the simple serial communication.

    I followed a tutorial online to start learning basic communication series. The involved tutorial shorting pins 1 and 3 on port 1 Comm and write a simple program (attached). I've edited it a bit, the program to see varied results I get when trying to write and read a simple sentence via a serial port.

    Could someone explain what causes the kind of result shown in "Serial Comm example.png"? I think it has to do with timing. Why would be transmitted only the parts of the sentence?

    Thank you

    Sarah

    sarahzig wrote:

    The involved tutorial shorting pins 1 and 3 on the Comm 1 port

    What should be pins 2 and 3?  On a standard serial port DB-9, pin 2 is the receive and pin 3 is the transmission.

    Now for your code...

    1. move the Serial Port to be before the loop to set it up.  Simply configure the port once.

    2. close the port after the loop.

    3. managing your error after closing.

    4 stop your loop on an error or the stop button has been pressed.  You will need a RC in there.

    5. no need to Flush Buffer function.  Remove it.

    6. using the bytes to the Port is a dangerous thing.  It introduced all kinds of race conditions that are interesting.  Instead, say VISA reading to read the number of bytes that you expect to read.

    6a. Moreover, don't forget to send a character to end of line at the end of your data and all the number of bytes to read something a lot more than you ever expect read.  The VISA read will stop reading when he a) sees the number of bytes, it was said to read, b) sees the stop character (currently enabled and set to a line break, which is part of the end of line), or c) the time-out occurs.  Whichever comes first.

    7. with 6, the wait is no longer necessary.

  • Serial RS232 Communication VISA write does not

    I am trying to send a SPELL of 5003 01 command to my card that I am logged in via Rs232. This command should get my PCB to change play modes.

    I posted about this problem before thinking it was a problem with it not sent in HEXADECIMAL:

    http://forums.NI.com/T5/LabVIEW/RS232-serial-communications-visa-using-hex-values-seem-to-be/m-p/326...

    It wasn't the problem.

    I use the CTS line for flow control. I know that the CTS signal is reaching the computer of my PCB as I tested it and I know that the PCB can send data to the computer I get the answer correct 4 bytes in HEXADECIMAL when I use the reading visa to get my player to PCB data.

    I get a 1073807339 error when I try to write even when the read function is disabled.

    The only thing I can think is that LabView is not to recognize the signal CTS go down and, consequently, time-out.

    I use the good 9600 baud rate, 8 bits of data and no parity, 1 stop bit. I am using RTS/CTS flow control, but the RTS line is not connected. I don't think it should be a problem that RTS is used to indicate the Council when to send data to the PC to my knowledge and is not serious.

    FYI the written string section of the VI is unused. The string to write, that's where I'm seizes my "5003 01" command.

    Thank you

    Kyle

    I just thought of it. I had messed up the wiring of the PSTN line. She received the RTS line, I think. I thought I had it correct since the Tx line was correct. Thank you for your help on the problem of the HEXAGON.

  • RS232 Communication tracking

    Please is there a way to control the traffic of communication RS232 via VI?

    OT sounds like you want to 'see' what the series is then port that another program is using the port as a sniffer port?

    If LabView won't do that as LabView and Ni-VISA must have access to the serial port.

    If another program is using the port NI-VISA and LabView will be locked out.

    If you start a porgram LabView NI-VISA first will lock port so no other program can access it.

    I think you need a program like part of the Sysinternals Suite from MS Technet PortMon .

  • PCMCIA card as a serial port RS232 on Satellite Pro 4200

    I think to use a PCMCIA card as a serial RS232 port. The program that I need to use runs under DOS and needs two serial ports. My question is that I need to run the program and the serial port to be recognized by the system. I have a satellite pro 4200 laptop PC series.

    Thank you

    Why on Earth if you want that?
    Your laptop computer with a serial port doesn't have it?

    Well for the serial ports are standard supported on Windows. In a back box that should be no problem.

    But pure back could be a problem.
    I guess you must also BACK drivers for your PCMCIA card...

  • RS232 Communication with Mastech MS2203

    Hello

    I am viewing a Mastech MS2203 data in LabVIEW using the RS232 serial port.

    I have the initial configuration (baud rate, parity, etc.) settings that I could get using PORTMON, but I'm still not sure what to do next.

    I couldn't find the Protocol series for this camera, but I have their software that does exactly what I'm trying to do.

    I have attached the software display and PORTMON data I had while I was running the program.

    Anyone have any ideas on what I could do next?

    Thank you!

    You will find your answer here: http://www.multimeterwarehouse.com/MS2203Protocol.pdf

  • RIO crashes when you use tcp communication and web server

    Hello

    my controller cRIO crashes after a short time (usually less than a minute), when I use simultaneously to the web server (to interact with a remote control) and make some tcp communication (using STM 2.0 library) for data logging. Is it a problem of overall performance of the controller, or a problem of band network bandwidth (I'm happy to send some values every 100ms), or a programming problem; in the latter case, what should I do to make the system more stable?

    Kind regards

    PS: I use a cRIO 9022 with LV 2009f2 + RT and NOR-RIO 3.3.0

    Hello

    You can try with a simple while loop + delay instead of loop timed for TCP communication loop.

    Concerning

  • Numbers of long to show using RS232

    I am trying to learn LabVIEW. I was able to do serial communication based on the example of database read/write. I can send a single byte. In fact, I read only since the serial port in labview. What I do receives 4 bytes and combine them as a single integer 32-bit. I'll read as 4 buffer. I have essentially 2 problems:

    1 - because the sender and the receiver (labview) does not start the communication at the same time there is a synchronization problem. The incoming bytes are not in order (LSB and MSBs may not be in the right place)

    2. I should interpret the characters that come in the form of numbers and combine 4 of them in one number and in the right order, do it all the time and then store them in a table.

    Can you give me some advice. Is there an easy way to do this?

    Note: I will also send the whole even in the future. Sending a number of 32-bit to the idea of port is also appreciated.

    Thank you.

    Since you have control of the Protocol, you can manage it as you like.  I advise to use a type of command/response communication.  You send a command to the microcontroller and the microcontroller sends data back.  If you require data flow, then have a stream of departure order and a stop of flow control.  This way you can make sure the series stamps are clear and you can read the data correctly.

    Now the serial drivers (I assume that you use VISA) send channels.  So what you want to do, is use the flatten to the chain and chain Unflatten to convert the return data type a suite.

  • Send the command to laser sensor via a serial port RS232

    Hello

    I have a sensor of moving Laser of OPTEX FA Co., LTD. with a Communication Manual.pdf file attached. I modified the sample base series write and Read.vi of LV to send the command to the probe in order to receive a response. However, LV always returns an error on my VISA Write.

    In short, the structure of command for the sensor must have a form like this

    STX-command command-space-1 2 - ETX

    (more can be see the manual on page 3 or 18 of the .pdf file)

    where

    -STX: code showing the head of transmit data (02 H)

    -Command 1, 2: could be refers to table 1, 2 and 3 of the manual.

    -ETX: code illustrating the completion of data transmission (03H)

    For example, if I want to ask the sensor to send the data from A sensor head, the command must be

    STX-ABLE () A - ETX

    (20H) space is shown as ().

    I tried to send a string HEX (02 - 4 d 454153555245-20-41-03) for this command to the entry VISA, but all I get is ERROR.

    I enclose with this thread my vi and a printscreen of the ERROR.

    A lot a lot of appreciation for any help from any of you.

    I have my LV code can run successfully. He can read the COMMAND and return measurement data. The last time does not playback VISA because I used a cable RS232 to opportunity, and someone operated two pins (2 and 3) for another application.

  • serial output unreadable communication

    Hello

    I'm reading the data via the serial port of a microcontroller based device. I use basic_serial_write_and_read.vi from the example section. the output I get is not readable (see photo).

    Any ideas on what could be bad?


  • I built a simple motion using LabVIEW Vision Assistant detector. Could someone suggest improvements to it?

    This is one of my first projects LabVIEW, and it's just a simple motion detector.

    Could someone suggest improvements, please?

    As to improve the clarity of the image, reduce noise, etc.

    I used the truncated FFT and it reduces noise well, but moving objects is reduced to blobs.

    My included VI has 2 main controls:

    (1) multiplier brightness (default: 1)

    (2) gain (default: 10)

    Hello

    You'll find them at the stage of analysis of particles

    .

Maybe you are looking for