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

Similar Messages

  • Data error through rs232 in cRIO 9074

    In the project being developed we have a pair of motor drivers which use ascii codes from the parallel port. The drivers where cobtrolled with a palm that broke down recently.
    So we started programming the software with labview, the program works with visa and a usb to serial and serial to parallel converter. But the motors move extremely slow
    When trying to implement the same software to the crio using the rsr323 port abd the same serial to parallel converter we cant make the drivers to work. They only move in one direction no matter what code sent.
    The codes sent are 20 and 21 for one motor and 40 and 41 for the other.
    Anyone have any idea of what ia happening?

     
     Hi danielfede
    Are you using any of the examples on LabVIEW for serial communication? Did you configured the serial port within the controller?
    Here are some useful resources related to port configuration on RT controllers and an example for serial communication:
    Why Are the VISA Resources on My cRIO System Not Displayed As Execution Targets in LabVIEW?
    http://digital.ni.com/public.nsf/allkb/CBD27C15C3357295862572420068E6B1?OpenDocument
    What is the Maximum Baud Rate for the Serial Port on the CompactRIO Controllers?
    http://digital.ni.com/public.nsf/allkb/06304FEBA0DEFDE98625710600787CA6?OpenDocument
    Compact RIO Operating instructions and Specification (Page 13-14)
    http://www.ni.com/pdf/manuals/374639e.pdf
    Serial data transfer between CRIO and Host
    https://decibel.ni.com/content/docs/DOC-3816
    Please post your code if possible. Maybe you are using code that is not permitted in LabVIEW RT.
     

  • Wifi is not available where I come from. I have broadband connection where data transmission is through cell sites then to USB modem connected to a computer. The modem draws power from the computer. Will this setup work with the ipad?

    Wifi is not available where I come from. I have broadband connection where data transmission is through cell sites then to USB modem connected to a computer. The modem draws power from the computer. Will this setup work with the ipad?

    iPad requires Wifi (or 3G /LTE) to connect to the Internet. You cannot connect a USB modem to the iPad.
    You can create your own WiFi hotspot through your computer for your iPad to connect to, if your computer supports this functionality. All Wifi Macs and many Wifi PCs do. Check your computer manual for how to do it.

  • How can form communicate through RS232 (serial) link?

    How can form communicate through RS232 (serial) link?
    What I have to use/install/setup/copy?
    Thanks

    You can also create a dll library and use the procedures in this library with the Forms ORA_FFI package. See the Forms online help.

  • Reading and analyzing serial data

    Hello,
    My question is about interpreting periodic serial data.
    I'm trying to read a serial rs232 port, through which I'm receiving periodic data which is made up of 4 repeating messages.
    Each message consists of several parameters of various length and fomates (for example, the first parameter could be an unisgned byte while the second parameter could be a word-long float). Each message begins and terminates with known character sequences.
    I need to read this periodic data and display it to the user, so that each of the parameters (of which the messages are made) is displayed
    by a different indicator.
    Right now, I've used the basic read/write rs232 LabView tutorial but now I'm pretty much stuck...
    I've built a similar program using Visual Basic and I've started using LabView in order to build better user interfaces but so far I'm stuck...
    Any suggestions?

    First, I think you really could have come up with a better user name then falling asleep on your "N" key.
    Data that comes in through the serial port is a string.  So your problem really comes down to how to parse the string into its respective parts.  Look at the functions on the string pallete.  Functions such as Match String, Search/Split String, or Scan String for Tokens, should do what you need.  Once you have the parts broken up, the String to Number conversion functions would convert the strings into their appropriate datatypes.

  • 16 bit serial data transfer

    Hello, i am working on a project in which i want to transfer 16 bits serially through RS232 to the computer. I tried many techniques but didnt got the result. Anyone here can send the solution or the Code of it.
    Thanks

    Intelligent wrote:
    I want to plot these data on waveform chart. Basically these will be representing a signal, which to be plotted in the chart.
    I am sending them from microcontroller 8052.
    thnaks
    Since you are Intelligent I do not want to take the joy of programming from you. But take a look at this palette. You will find many useful functions here. If you transfer the MSB and LSB in correct order you may use the cast function and cast the string directly to an array of I16 (or U16).
    Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
    (Sorry no Labview "brag list" so far)

  • Unexpected values at the moment to receive serial data

    Hi,
    I've been a time trying to fix this and looking for forums but unfortunately I can't figure out how to solve it. I hope you can help me a bit.
    I am working in a project which I have to send some information via ZigBee technology throught the serial port to my computer where there is another ZigBee module connected by serial port to LabView.
    The point is that I am able to receive all the data well if I take some long delays and I really need to decrease my delays.
    With low delays I receive zero values or even some values really out of range even when in some test I am just sending some fix values to debug it.
    I think that it's a problem of synchronization but I don't know how to fix it.
    PS: The reason cause I put a switch case even when the programm has to go out of the while when the Bytes at Port are zero, is cause i realise it doesn't. Just a way to be redundant in my goal.
    I attached you the .vi file and a picture where it can be seen my problem (it's suppose to receive always some value around -1).
    Thanks a lot for advance.
    Attachments:
    Untitled 2.vi ‏25 KB
    chart.png ‏11 KB

    Can you provide an example of expected data.
    How to you determine the start or end of a data transmission?
    It appears as though you are expecting to receive floating point numbers as a strings but you have no way of sychronizing to the start or end of a value.
    Troy
    CLDEach snowflake in an avalanche pleads not guilty. - Stanislaw J. Lec
    I haven't failed, I've found 10,000 ways that don't work - Thomas Edison
    Beware of the man who won't be bothered with details. - William Feather
    The greatest of faults is to be conscious of none. - Thomas Carlyle

  • Searching Incoming Serial Data

    Greetings!
    I was trying to get visual studio to filter through the incoming serial data it is receiving from an Arduino. The program shows the incoming data, so I know the serial port is working, but I'm not sure how to get it to look through that data ( I was thinking
    I could use StreamReader to do this). My goal is this: When certain data is received, change the background color of a textbox. I am very new at this and any direction would be appreciated! I feel like i'm throwing spaghetti at a wall... 
    Here is my current code:
    Imports System
    Imports System.Threading
    Imports System.IO.Ports
    Imports System.ComponentModel
    Imports System.IO
    Public Class Form1
    Dim myPort As Array
    Delegate Sub SetTextCallBack(ByVal [TEXT] As String)
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    myPort = IO.Ports.SerialPort.GetPortNames()
    portCmbo.Items.AddRange(myPort)
    End Sub
    Private Sub startBtn_Click(sender As Object, e As EventArgs) Handles startBtn.Click
    SerialPort1.PortName = portCmbo.Text
    SerialPort1.BaudRate = baudCmbo.Text
    SerialPort1.Open()
    startBtn.Enabled = False
    closeBtn.Enabled = True
    End Sub
    Private Sub closeBtn_Click(sender As Object, e As EventArgs) Handles closeBtn.Click
    SerialPort1.Close()
    startBtn.Enabled = True
    closeBtn.Enabled = False
    End Sub
    Private Sub SerialPort1_DataReceived(sender As Object, e As SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived
    ReceivedText(SerialPort1.ReadExisting())
    End Sub
    Private Sub ReceivedText(ByVal [text] As String)
    If Me.inputTxtBox.InvokeRequired Then
    Dim x As New SetTextCallBack(AddressOf ReceivedText)
    Me.Invoke(x, New Object() {(text)})
    Else
    Me.inputTxtBox.Text &= [text]
    End If
    End Sub
    Private Sub outputTxtBx_TextChanged(sender As Object, e As EventArgs) Handles outputTxtBx.TextChanged
    Dim myReader As StreamReader = New StreamReader("Me.inputTxtBox")
    Dim line As String = ""
    End Sub
    End Class
    ps: If there is an easier way of doing this, please let me know!

    You should read a good book on "Communications".  When processing received data (from any device) you need to wait until you get the end of message before parsing the data.  The data will be received in chunks that can contain from 1
    to a million bytes.  When you get the word "Hello" you could get "H" then "ello" or "Hel" and then "lo".  You can't start looking through the data until you get the entire word "Hello". 
    So you first have to define a protocol for sending commands to the device and the amount of data that gets returned.  So normally you have to terminate a message using one of the following methods
    1) Ascii : Terminate a message with a fix character like a return or EOM.
    2) Ascii or binary : Includes a bytes count at the beginning of the message.
    3) Ascii or binary : Each type message is a fixed length.
    You can use combination of the 3 methods above.
    jdweng

  • Serial data tab page missing during Goods Receipt for Mvt type 501

    I have created and asigned the Seria data profile in plant data/Storage 2 of the material master record. Now i want to do the Goods receipt of this material with Mvtr type 501 w.r.t any documents for 5 no's and want the serial number to be createdment. I also have made relevant settings for automatic serial number and equipemnt number synchr, but wen i m in MIGO--Goods Receipt OtherMvt type 501 and enter, the serial data tab page is missing..
    How can I activate this tab page....Any steps missing....
    Can some one throw lights on this.....
    Refered relevant threads but not much useful to my query....
    Thanks
    Murad Shaikh

    Try 501 with MB1C, OR
    Check through Path SPRO -> Sales and Distribution -> Basic Functions -> Serial Numbers -> Determine Serial Number Profiles -> Select Profile 'MM' & double click on Serializing procedure at left & maintain obligatory(03) for procedure MMSL i.e. Maintain goods receipt and issue doc. Also press F1 in Serial Number Usage to read the usage.

  • Write serial data directly to file

    I am using DasyLab 9. I am reading a com port for serial data. if i issue the command to output a log of stored data from the RSMASTER when the program is not running I get all the data that is in the log. however, when I run the program and send the received strings to a global variable, a$1\r and log it to a file using a message module when the string changes I dont get all the data, there are one out of 10 lines missing. so I would like to output directly to a file or maybe there is a better way to set up the log so that i dont miss data while I am writing to the file.

    What is the time base of the module that feeds the Action module? That may determine the update rate -- it should be faster than you expect the data to change.
    There's also a question of whether the RS232->string is always catching the string.
    Rather than use String changed, you may want to use a timer function for the input to the Action, and write regularly. 
    Is the string alphanumeric? If so, there aren't many choices for logging to a file. You can log strings via ODBC, but it has the same limitation of the Action module response time. 
    - cj
    Measurement Computing (MCC) has free technical support. Visit www.mccdaq.com and click on the "Support" tab for all support options, including DASYLab.

  • How To Managed Serialized Data Over Multiple Application Versions

    Lately I've been struggling with deciding how to deal with serialized data between application versions. Assume you have some software that has to be able to save data files. As the application evolves, the data format changes. The application needs to be able to load data saved from prior application versions.
    When I first started out I just used a Serializable class. It was quick and easy. However, as newer versions used slightly different data formats, I had to come up with a means to upgrade the data to the latest version. Initially I created a process where the latest data class knows how to upgrade from prior data class versions. Then, when loading data in the application, if the class doesn't match the latest data class version, it checks to see if it matches one of the versions that can be upgraded.
    This sort of works, but still has one glaring problem. The old data classes must be etched in stone; never altered. For ever and ever. You can get away with certain simple updates to older data classes by defining a serialVersionUID and keeping it's value the same. But this doesn't always work. What if my overall package structure changes? I have to ensure that the old data classes remain in the same older package structures. Not ideal.
    So I've started considering other ways to serialize data...a process where the data can be broken down into core Java classes. There are serializers for serializing to XML, but I don't feel that XML is an appropriate storage format for the data. I'm also considering using a custom built serializer that uses introspection in some fashion.
    Before I go any further, however, I'd like to solicit some suggestions. Do you know of any serialization packages that might help me? Do you have any suggestions on what might be a good custom solution? Will Externalizable make this easier? (I've never used Externalizable before...looks like maybe it could help, but even that appears to be vulnerable to refactors that change package structure).
    Thanks for your thoughts.

    I've continued to work on my own custom serialization process as described in my previous post. Here is how it currently works:
    In the example there is a class named ExampleSubClass identified by the String "xsub" of version "1.0". It is saved and then reloaded into a class named RevisedExampleSubClass identified by the String "xsub" of version "1.1". The String "xsub" identifies what the class represents, which allows the class and package to change as needed. Fields can be added, removed, or converted through the optional serialConvert method.
    public class ExampleSubClass extends ExampleSuperClass {
         private static final String serialId = "xsub";
         private static final String serialVersion = "1.0";
         ExampleAggClass exNullAggClass = null;
         String exString;
         ExampleNonXCSerialClass nonXCSerialClass;
         String exNum;
         ExampleAggClass conAggClass;
    public class RevisedExampleSubClass extends ExampleSuperClass {
         private static final String serialId = "xsub";
         private static final String serialVersion = "1.1";
         ExampleAggClass exNullAggClass = null;
         String newStringA;
         String newStringB;
         String exString;
         Integer exNum;
         ExampleNonXCSerialClass nonXCSerialClass;
         String conAggString;
         private void serialConvert(Converter converter, String fromVersion) {
              if (fromVersion.equals("1.0")) {
                   converter.addField("newStringA", String.class, "new string!");
                   // intentionally not adding newStringB to see if warning is thrown
                   converter.convertField("exNum", new ConvertScript<String,Integer>(String.class, Integer.class) {
                        @Override
                        public Integer convert(String fromValue) {
                             return new Integer(fromValue);
                   converter.convertField("conAggClass", "conAggString", new ConvertScript<ExampleAggClass, String>(ExampleAggClass.class, String.class) {
                        @Override
                        public String convert(ExampleAggClass fromValue) {
                             return fromValue.getAggString();
    // and then in some other class...
         ExampleSubClass example = new ExampleSubClass();
         System.out.println("Serializing class...");
         XCObjectOutputStream xcoos = new XCObjectOutputStream(new FileOutputStream(file));
         xcoos.writeObject(example);
         xcoos.close();
         System.out.println("Deserializing class...");
         XCObjectInputStream xcois = new XCObjectInputStream(new FileInputStream(file), RevisedExampleSubClass.class);
         RevisedExampleSubClass resc = (RevisedExampleSubClass) xcois.readObject();There is still a little more work to do to fully support arrays and collections, and I need to develop a rigorous test suite for it. But so far it's looking good.
    Edited by: Skotty on Jul 18, 2010 5:31 PM

  • Serial data manchester

    Hello All,
    I am new to the forums here. I need help converting the following code for use in LabVIEW. The data is coming in using rs232 format in ASCII. The bits are manchester encoded. I have setup the normal vi for reading serial data but when indexing it in an array the data is all over the place and inconsistent. Your help would be greatly appreciated.
                   'SERIAL NUMBER
                    Cells(24, 3) = Chr(ReadValue(0)) & Chr(ReadValue(1)) & Format(Str((CVar(ReadValue(2)) * 65536) + (CVar            (ReadValue(3)) * 256) + (CVar(ReadValue(4)))), "00000")
                    'PART NUMBER
                    PNRval = Format(Str(CVar(ReadValue(5)) * 65536) + (CVar(ReadValue(6)) * 256) + (CVar(ReadValue(7))), "00000")
                    Cells(25, 3) = "X" & Mid(PNRval, 1, 2) & "-" & Mid(PNRval, 3, 3)
                    'STATUS
                    Cells(26, 3) = CVar(ReadValue(8))
                    Cells(row, 24) = Cells(26, 3)
                    'Pressure
                    Cells(27, 3) = ((CVar(ReadValue(9)) * 256) + CVar(ReadValue(10))) / 100
                    Cells(row, 21) = Cells(27, 3)
                    'SensTmp
                    If (ReadValue(11) > 127) Then
                        Cells(28, 3) = (((CVar(ReadValue(11)) * 256) + CVar(ReadValue(12))) / 100) - 655.36
                    Else
                        Cells(28, 3) = ((CVar(ReadValue(11)) * 256) + CVar(ReadValue(12))) / 100
                    End If
                    Cells(row, 22) = Cells(28, 3)
                    'ElecTmp
                    If (ReadValue(13) > 127) Then
                        Cells(29, 3) = (((CVar(ReadValue(13)) * 256) + CVar(ReadValue(14))) / 100) - 655.36
                    Else
                        Cells(29, 3) = ((CVar(ReadValue(13)) * 256) + CVar(ReadValue(14))) / 100
                    End If
                    Cells(row, 23) = Cells(29, 3)
                    Cells(30, 3) = "PASS"
                    Cells(row, 25) = 1
                    'Cells(row, 26) = " "

    Preamble
    1
    Byte to   stablise the DC component signal
    serial number
    5
    Serial   number of the unit:
    - 2 Bytes   for the 2 ASCII characters (AA to ZZ)
      - 3 Bytes for the number (0 to 99999)
    part number
    3
    Part Number   of the unit( The last 5 numbers SSHHh):
      3 Bytes for the number (0 to 99999)
    Status
    1
    Byte   indicating the status
    Sensor   pressure
    2
    Value of   the measured sensor pressure :
    2 Bytes   (unsigned integer) with 16 significant bits, decimal value x100 (0.00 to   655.35 psi)
    Sensor   temp
    2
    Value of   the measured sensor temp :
    2 Bytes   (signed integer) with 1 sign bit and 15 significant bit, decimal value x100   (-327.68 à +327.67°C)
    E.   temperature
    2
    Value of   the measured E. temperature :
    2 Bytes   (signed integer) with 1 sign bit and 15 significant bit, decimal value x100   (-327.68 à +327.67°C)
    Checksum
    2
    Arithmetic sum of Bytes on the message frame   (without preamble and checksum)

  • Corrupted serial data when reading

    Hello Friends
    Im working on a project that read a string through the serial port from a flow meter.
    the string that the flow meter sends has this pattern. its a comma separated string:
    0021,00029504,00032622,0115,0,0,00000000,00000006,​0000,00000000,00000000,0000,0,0,00000000,00000000,​18:14:48,12/04/12,2110,00000000,0
    i already proccesed the data with this VI (please fell free to give me any suggestions ). Please see 1.jpg
    I am having the following issue. when receving data from serial, several strings show up corrupted. please see good.jpg and bad.jpg. i have tried to read the serial data on hyperterminal, and all strings show up ok.
    i will appreciate any suggestions and advises on how to fix this!
    thanks in advance
    Attachments:
    1.JPG ‏71 KB
    good.JPG ‏14 KB
    bad.JPG ‏13 KB

    moreins1 wrote:
    hello
    actually, i have one more question.
    this is the data viewer i have on my vi. it shows each data string that my serial device is sending. this string will change 10 times in a second. this is OK. right now, its showing 1 string at a time:
    0021,00029504,00030816,0110,0,0,00000000,00000009,​0000,00000000,00000000,0000,0,0,00000000,00000000,​18:14:54,12/04/12,2173,00000000,0
    what i want now is to actually append all this data in the viewer so i can copy and pasted it to notepad. i would like it to show like this:
    0021,00029504,00030816,0110,0,0,00000000,00000009,​0000,00000000,00000000,0000,0,0,00000000,00000000,​18:14:54,12/04/12,2173,00000000,0
    0021,00029504,00031123,0107,0,0,00000000,00000009,​0000,00000000,00000000,0000,0,0,00000000,00000000,​18:14:54,12/04/12,2174,00000000,0
    0021,00029504,00030948,0104,0,0,00000000,00000009,​0000,00000000,00000000,0000,0,0,00000000,00000000,​18:14:54,12/04/12,2175,00000000,0
    0021,00029504,00030866,0103,0,0,00000000,00000009,​0000,00000000,00000000,0000,0,0,00000000,00000000,​18:14:55,12/04/12,2176,00000000,0
    0021,00029504,00030903,0105,0,0,00000000,00000009,​0000,00000000,00000000,0000,0,0,00000000,00000000,​18:14:55,12/04/12,2177,00000000,0
    0021,00029504,00030888,0105,0,0,00000000,00000009,​0000,00000000,00000000,0000,0,0,00000000,00000000,​18:14:55,12/04/12,2178,00000000,0
    0021,00029504,00030836,0104,0,0,00000000,00000009,​0000,00000000,00000000,0000,0,0,00000000,00000000,​18:14:55,12/04/12,2179,00000000,0
    0021,00029504,00030545,0095,0,0,00000000,00000009,​0000,00000000,00000000,0000,0,0,00000000,00000000,​18:14:55,12/04/12,2180,00000000,0
    and so on.........
    Can you please advise on how to do this without actually monkeying around with the VISA inicialize?
    thanks!
    You're gonna have to put that string into a shift register to bring it back around.  Then you'll have to concatenate it with the current string (add a return so they end up on different lines) and take the output to your indicator.  Be careful what you wish for... if it's updating 10 times a second, it will eat up memory like crazy.
    [edit]
    Didn't realize you wanted to cut n paste to notepad... why not just take the original output to a file instead of an indicator?  Cross beat me to it.
    Bill
    (Mid-Level minion.)
    My support system ensures that I don't look totally incompetent.
    Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

  • Realtime serial data plotting

    Dear Sir!
    I want to plot my serial data of 8 bits on graph/plotter.The serial data is received from another PC at baudrate 115200.After setting serial port on reception side i start capturing serial data but the problem is that it is not continous it plots my  continous constat data for example decimal number '5' in the form of gilitches which are also random in time space.I am using simple IN port.vi.
    Another problem is that when i capture this data using VISA Read it caputre data correctly for only 7sec and or u can say that it doesnot update my data received from serial.Please help me in this regard as soon as possible through my email address [email protected]
    Thanks

    Well, I can't debug it because I don't have anything to read from but I did make some changes. You might want to go back to a fixed byte count to read if the data sent is some constant.
    Attachments:
    test41.vi ‏78 KB

  • How to secure data transmission from Essbase Excel add-in to Essbase Server

    I have a requirement to secure the data transmission (encrypt) the data transmission from the Essbase excel add in on the client machine to the Essbase server. I have confirmed with Oracle support that the excel add-in and the API only transmit the data in binary from with no encryption.
    I wanted to see if anyone has implemented this before?
    Thanks,
    Mike

    Technical support gave you the correct answer, it is
    not supported. You might check with Tim Tow
    http://www.appliedolap.com to see if either the
    Dodeca or ActiveOlap products support encryption.Glenn is correct in that Oracle doesn't support it. More specifically, the Essbase server itself does not support it.
    The other products mentioned in this thread, Smartview, Spreadsheet Services, Dodeca and ActiveOLAP, all can talk to the middle tier via https and are thus encrypted through that portion of the transaction. However, the communication from the middle tier, Analytic Provider Services in the case of System 9, talks to Essbase via TCP/IP unencrypted. If your middle tier/Essbase server connections are not 'sniffable', then essentially they are secured (albeit not encrypted).
    Tim Tow
    Applied OLAP, Inc.

Maybe you are looking for

  • ITunes still not syncing correctly with iPhoto 9.4.3

    Since upgrading to version 9.4.x, iTunes hasn't been syncing correctly with iPhoto. There were duplicated events/albums, missing photos, photos not appearing in the same order on iOS devices as they do in iPhoto, etc. With each version upgrade since

  • Obiee dimension hierarchy ?

    what is purpose of od dimensional hierarchy in obiee ?

  • NWDS 2.0.13

    Hi All,        I know NWDS 2.0.13 is in service market place.But when i download it it comes at .SAR file.can anybody tell me the steps for uncaring the same.I knw it has to be done with sapcar.exe.But I required detailed steps how it can be executed

  • Actions Not Showing Up After Import

    I imported a bunch of actions into Acrobat 11 (Creative Cloud version) from Acrobat 10 (the Version that came with CS6). They are not showing up in the Action Wizard panel, and the program will not let me reimport them because "The action has the sam

  • Unable to open a document keeps on asking for adobe flashplayer

    I'm logged on to a site where I need to open documents and its asking to download a flashplayer.