How to read a serial port?

Hello

I am a complete newbie to Labview and hoped that one of the benefits could point me in the direction of a tutorial on how to acquire data from a serial port. I downloaded some programs here, but I really have no idea of what is happening in their. I also tried looking for the tutorial and through the forums, but all I've found is too specific and would really like to know how to go about reading data.

Thank you!

Search for series in the Finder for example of NOR (help > find examples) then choose the basis series write and Read.vi.

Tags: NI Software

Similar Questions

  • Parity errors & read on Serial Port framing

    Hello, I am writing a program that reads the serial port IR thermometer. Intermittently I get parity so many framing errors and can't explain why or find a way to remedy. All the parameters of the series were double checked and controlled. I don't get any errors when you use HyperTerminal yet, when I do test bed in MAX, I see these mistakes from time to time. I tried the suggestions of the knowledge base for these as presenting a delay between the Visa set up and read the Visa or flushing buffer issue before reading, but none worked. Any idea or ideas would be appreciated.

    In addition, while searching through discussions on parity and framing errors, I saw a when a user recommends the following: "use wait event triggered by the stop character and when the error occurs, I just deleted the error, empty the buffer (wait the next stop character) and reread." If that sounds like a good solution, how would I go about its implementation?

    I've attached a screenshot of my reading series loop so you can see what I'm doing. I do about the error code control timeout is.

    Given that you have activated the stop character, you should not use the bytes to the serial port. You shouldn't have to delay or any function buffer flush.

    PS, You also have to change the way your loop exits.

  • Sometimes the lost bytes, reading the serial port

    Hello!

    I'm reading the serial port data (flow rate 57600 baud rate) that works very reliable so that I do not open any other window

    or minimize/restore my window of the application during the program is running. Then a byte of incoming data will be lost.

    I get a string of 30 bytes each 50 m in most of the cases the first byte is lost, sometimes one in the middle.

    This occurs not only on a PC.

    Is this a problem of LabVIEW or Windows?

    Are there settings that can solve the problem?

    Best regards

    JK78

    I solved the problem.  

    There was a bug in my program who become visible only if a window has been reduced or restored.

    When there are two or more messages in the buffer VISA, the separation of the messages was incorrect.

    Array index corresponded to false so that the first byte of the second message was at the end of the first

    and so the second message in the buffer seemed incomplete.

    In normal operation, the playback loop runs so fast, never both messages are in the buffer.

    Thanks for all replies.

    JK78

    Either way, I work with LabVIEW 2009 and serial interface hardware motherboard. With XON/XOFF flow control

    is not possible in my application because all the hex values from 00 h to FFh may appear in a message.

  • How to read the Serial Arduino data using labview VISA?

    Hi =). Im a beginner work reading data series from an arduino but im facing... Lets do it step by step

    I built a voltage divider circuit which gives from output
    from 0 to 5V. The output of this circuit is sent to a 0 analog input pin
    of a Committee of Arduino Duemilanove.

    (1) Firstly, I connected the cable to connect to my laptop USB the Arduino.

    (2) I went to start-> control
    Control Panel-> system-> hardware-> Device Manager. Check the Ports (COM
    & LPT). In my laptop I can see USB Serial Port (COM4). Now I know only in
    LabVIEW that I must read the data series COM 4.

    (3) to the side of the arduino, here's the code to read changes in voltage
    entered to analog pin 0. The last line of 'delay' determines the sampling
    Rate of how we want to taste the output of the voltage divider:

    int potPin = 0;    Select the input pin for the output of the voltage divider
    int val = 0;       variable to store the value from the probe

    void setup()
    {
    Serial.begin(9600) (9600);    Opens the serial port, establishes the rate of 9600 bps data
    }

    void loop() {}
    Val = analogRead (potPin); read the value of the voltage divider
    Serial.println (Val);
    Delay (10);
    }

    I slightly modified the basis series reading writing VI... I have
    attached the block schema used with comments. Basically, I tried to read
    data series, divide by 1023 and multiply by 5 to graphic voltage
    variations of the voltage divider circuit.  But Im not getting
    the correct voltage output values. The value of the tension just keeps go
    0 and coming again, as shown in the photo.

    Could you guys please guide me on what went wrong?

    Thank you!

    -you read the data, even if there is no data on the port. If 0 bytes are read => «»

    -in the case of false, you resources VISA wired for the output of channel tunnel?

    -There is no close VISA at the end of the VI resources

    -you're not a loop this VI reading bytes

    I added an addaption of your VI that you should give a try maybe

  • Can not read the serial port VISA without MAX

    Hello

    I'm trying to build an application that will interface with a Black Cat Systems GM-10 radiation detector.

    The app works fine on my computer (with the full development system OR) but when I install it on another computer, without LabView, the application cannot see the serial port!

    I checked that the driver is installed correctl and Windows can see the device, but when I run my program, he can't seem to access the serial ports.

    I then tried to install MAX on the second computer, how the application worked well, but as I install this app in other places, I don't really have the ability to install MAX everywhere (software must be autonomous).

    Any help would be appreciated!

    Z

    I would have joined the project file, but the forums seem to not want to allow me to download that big of a file.

    What version of LabVIEW are you using? With 8.x, the installer is very able to install the runtime of NI-VISA and MAX. If you are using an older version of LabVIEW, there is an option to include the series VISA support. Install just MAX will do nothing to make the available ports. This is the VISA that does this.

  • read the serial port PIN +.

    Hello!
    Ive got a question on the serial port. I don't want to make any communication on the port. I want to directly connect an instrument (later), the pin of the connector series #2. On the PIN, I need to read impulses. I am able to read the port pin series, who is active? I know, I can do it on the parallel port. With the port. VI, I give the address of the port, check the D0 PIN for example and the result I can indicate on a led indicator. I want to do the same thing on serial port, because later the target pc will be ve no parallel port. Is this possible? Can you give a statement of departure?
    Thank you very much for your help!
    Mr. Gabor

    You can read the down state from some other lines, DTR, RTS, etc.. There is an example that comes with LabVIEW. Open example Finder (help-> find examples) and search for "Troubleshooting Serial Line Monitor" example (just search "series").

    This can be considered an e/s digital interface a poor man, depending on what you are doing, you can be better with a 'real' digital i/o interface.

  • Read the Serial Port in case of break in series

    Hello world

    I want to create a VI who will write a series, write interruption, then wait for an interrupt series to be received and if it is received, read what's on the serial port.  However I can't the VI to detect that an interruption of the series took place.  I looked at and followed what was done in the "Detect the Event.vi Break" example in examples of Labview.  The microphone that speaks to the VI sends a break of 13 bits (approximately length 57us), as expected, proved by the use of an oscilloscope but Labview is not contagious. I have attached the VI in question.  It is used as a subvi in a larger program.  I'm missing something or doing something wrong?

    I do not know.  230 400 is a very fast pace.  The UART in the PC isn't really in the game, but the EasySync USB/serial box is what is the factor.  USB is part of the communication may be adding a few complications.  You may browse the EasySync detailed technical data to see if they talk about it.

    I would certainly try a very long break first.  If it works, then start working backwards to small jumps.  If a long pause does not work, then you know that perhaps the problem is elsewhere.

  • read the serial port management using the SRM Protocol

    Hello

    I have a gas analyzer that communicates with the PC via the serial port.

    This is the "Industrial VarioPlus SRM".

    I have attached a PDF file that describes the communication protocol.

    I'm trying to decode the data that are sent from the parser, but I can't do it.

    I have attached the vi in which I made some effort.

    Any help is appreciated, at least for a single value in the data stream.

    Thank you.


  • Smartphones blackBerry how to connect the serial port (SSP) to a PC?

    I try to connect my BB (8310) to my pc using the port profile series bluetooth with my old phone (sony ericsson w300i) would just pair the phone with the pc and then the pc would discover services on my phone and I woluld double clicking the port icon series, but when I explore the services BB I only have handsfree and dial-up networking , I know the phone supports the serial port because I checked in the bluetooth options, and it supports the connection to the serial port.

    Thank you.

    http://www.BlackBerry.com/BTSC/search.do?cmd=displayKC&docType=kc&externalId=KB04132&sliceId=1&docTy...

    proceed as if you want to sync via bluetooth

    If you just want to transfer files, stop after completing step 5

  • Read the Serial Port with termination Char?

    Hi, I have a particular piece of hardware that I'm communicating which sends a stop character 0xAh at the end of the data written to the port. I have trouble reading the data from the port where I only get half of the data due to synchronization problems. I know that it's related to be looking at the bytes to the port property node and read the bytes that probably replacing end setting tank. I have the correctly defined termination char, so, how did a survey for serial data to the port without using the bytes to the port method because I don't think that it works when you use the termination char port method. Anyone know this issue?

    Simple VI that explains what my main VI by defining the term tank and using the bytes to the method of port that is not working properly and causes problems of loss of data from mark is attached.

    Thank you.


  • [begineer] reboot a 'while' loop reading the serial port

    Hello! I read some data from a COM port. I want to read my like this "%d S. the unit will send data continuously and depending on when I push the button run in labview, it can start to read data from the middle (%d is a four-digit number). as: 23 S 15'

    "whenever the first character of my data is not of", I need to restart playback. I read the data in a while loop. so I need to stop the while loop. From what I found on the internet, I used a case, another while loop and shift registers.

    but in some way I'm stuck inside the while loop. My VI is attached. Thanks in advance and sorry if my code is a mess!

    PS: what should I do if the bytes I get to the port is variable? use bytes to the port?

    The device sends a character at the end of the line at the end of each message?  You are currently Setup to do this by activating the stop character (currently set to end of line/10/0xA).  If this is true, then simply set the bytes to be read on the VISA to read something rediculously high.  It will stop playback when it finds this termination character.  From there, you just have to check for the correct format.  If this isn't the right format, ignore him.  Otherwise make your recording.

    I managed to clean up your code a bit on this basis.

  • How can I open serial port VISA, automated?

    Hello.

    I have Labview 8.5.

    I have a program that works very well, on an interface series, on a well-known port (COM7). I have a converter USB to serial on my laptop.

    Is there a way to make my programm (.vi) to discover the port where my transformer is plugged? I want to open automated say.

    Thank you.

    Take a look at the discussions in this thread.  They discuss something similar.

    http://forums.NI.com/NI/board/message?board.ID=170&view=by_date_ascending&message.ID=322692#M322692

    R

  • How to get connected serial port information

    Hi all

    My mobile phone is connected with two activate the bluetooth device.

    Can anyone know how to get the port for each instrument (means which device is connected to which port)? While I can open this port directly.

    Hi all

    My problem is solved. I am able to do this in Torch 9800, but it does not work on the Curve 8520. So I close my thread.

    If anyone needs any kind of help with Bluetooth. Please let me know.

  • reading photoplethysmograph waveform with serial port on PC using Labview

    Hello world

    I'm gaining time real Photoplethysmography waveform of serial port using Labview.I have managed to acquire data from serial port by using the following features:

    -Baud rate: 38400

    -data bits: 8

    -stopbit: 1

     

    -No parity bit

    -Time delay before reading the serial port: 10 ms (according to what was written in the manual that every 10 ms there is a frame in serial port)

    After the reading string will be converted to byte array to be able to extract the bytes associated with waveform (1 & 2 bytes in a frame) even for SOP2 (6 & 7)

    (what is read in serial port is in decimal and must be converted to hexadecimal based on what made the software of prodeuct for some result.that in the waveform properties, I chose the hexadecimal representation)

    Then, as mentioned in the manual, I associate these two values to draw the waveform.

    Although I used the filter band digital waveform of pulse but not significant pass that was seen (cutofffrequeny:10 high low cut-off frequency: 0.5).

    I have attached my program and result in front of Panel and manual for the sensor. The result is still far from what is supposed to be. I was wondering if you could help me and let me know your opinion on the program and the protocol used. I have to get the result as soon as possible. Please let me know if you need more information.

    Kind regards


  • serial port cRIO

    Hello

    Can someone tell me how to access the serial port of the crio 9024. I pass the data to the serial port of the controller. This transmission must be by crio serial port and not by module CSeries.

    Thank you

    Hello mimran,.

    cRIO controllers run LabVIEW Real-time.  Therefore, you perform series read/write through the range of NI-VISA in LabVIEW.  All data collected from the port, or sent to the port will have to be given "String".

    There are examples for reading installed with LabVIEW series.  These are only a few small changes to work as in real time.

    Follow these steps for an example:

    1. Launch LabVIEW.
    2. In the main menu, go to the 'Help'-> 'find examples '.
    3. In the upper left corner, click on the tab "search".
    4. Search for the term "series".
    5. Open the example called "basic series write and Read.vi.

    Kind regards

Maybe you are looking for

  • A4 DVI/Replicator

    Can I use Tecra A4 PTA40E with III advanced port replicator? I have an LCD monitor with DVI input, can I connect the DVI output Replicator to the screen and display using the A4 on the dock?

  • Parental controls does not-webaccess all refused

    I set up parental controls in windows for my administrator accounts. They worked well and were all in custom mode. Recently, yesterday they block all access to any website. I have treid to reset them and still have the same problem. other than the op

  • Problems with my mouse, and have not been able to find a solution to the research on various forums.

    Original title: mouse problems I have problems with my mouse and have not been able to find a solution to the research on various forums. Here are the symptoms: 1. you must click several times to get the menus to open. Sometimes they are not just and

  • BBM SDK Apps appearing does not in the sim card

    Hello everyone. 1. I have install MDS, installed the sim card 2 Ran 2 simulators using sim1 and sim2.bat. 3 added sim2 and sim1 BBM contact,. 4. in Eclipse went to debug, dug configurations, Blackberry Simulator, advanced Added to this that my custom

  • PC is executed only USB 1.1 when one USB 2.0

    Hi guys,. I use an old HP/Compac DC 7100 SFF computer I've had for a few years. I run Windows XP pro (SP3) on this subject with the 2.8 ghz and 2 GB RAM chip. According to the list of specifications, this particular version of the beast should have m