Communication through RS232c serial interface using labview

i am trying to communicate with a device through RS232c serial interface using labview 6.1....i have tried to run the example "Serial communication.vi" provided in 6.1 and it doesnt work....do i need any special hardware or do i need to configure my hardware to communicate through RS232c...
thanks in advance
shri

Seems like I placed a small (maybe 30ms) delay at the end of the serialcommunications.vi structure.. for some reason my PC didn't like running as fast as it tried to go. Also look into the actual serial communication.vi and open the vi's inside it - check that the port setting (0 or 1) are ok, the baud rate (probably 9600) are ok. I'm running with only three wires in my application, TX, RX and Common. The PC may need to be rebooted to enable the com port - or use device manager and see if it says the com ports 0 and 1 are both OK..
Try buildinga loopback plug with TX to RX, RX to TX, and Common to Common and see if hyperterminal (or other serial communications program works - there is also Loopback.VI in the NI library somewhere that can be used. Good Luck!! Dave

Similar Messages

  • How to transfer file from PC to PC via serial port using labview

    I need to transfer files(.txt, .doc, .xls) from PC to PC via serial port using LabVIEW. Is it possible to transfer files, if so how to transfer?
    Solved!
    Go to Solution.

    Yes, it is possible to transfer files with the serial port using LabVIEW.  Files are just collections of bytes and the serial port is pretty good at shipping bytes from one PC to another.  You need to connect the serial ports together with a null modem cable.
    First, take a look at the example for serial communication.   In LabVIEW, go to the Help menu and select "Find Examples...".  From there you can search for "serial" or navigate to Hardware Input and Output >> Serial.  Select the "Basic Serial Write and Read.vi".  Experiment with that example to gain confidence on the serial communication methods.
    Next, it's time to learn about how to read and write files.  For that, the examples could be somewhat confusing since they all deal with files that are presumed to have data of a specific type in them.  I would recommend just getting familiar with the functions on the File I/O palette.  Specifically, get to know the following functions.
    Open/Create/Replace File - On your destination side, you'll need to create the copy of the file that you are trying to transfer
    Close File - When you are finished reading from or writing to a file, you should close it.  It cleans up the memory being used and finalizes any write operations that are still floating in the write buffer.
    Read From Binary File - The best way to read from a file when you do not really care what type of file it is.  In your case, you just want to get those bytes read and sent out so they can be written down at the destination.
    Write to Binary File - At the destination side, this is what will store those bytes to the file you created with number 1.
    Get File Size (under the Advanced File Functions sub-palette) - You need to know how big the file is so you know when you are finished.
    OK, so once you are able to create files, write bytes to them, and read bytes from existing files you can move on to transferring.
    The basic method I would suggest is to have the user specify a source file on the source PC and a destination folder on the destination PC.  Then, find out the size of the source file using number 5.  Divide that size number by the number of bytes you feel like transferring at once.  The serial buffers are usually around 32k (if I remember correctly) so do not exceed that.  Now begin sending data by reading some number of bytes and wiring that string output to the VISA Write function.  On the destination side, you'll want to be monitoring the serial port for bytes and reading them when they arrive.  Wire that string to the Write to Binary File function to add them to your destination file.
    That is the basic outline of how to do it.  You have to be careful not to overload the write and read buffers on the serial ports.  Initially you can use delays on the sending side to make sure the reading side has enough time to digest.  To get things moving faster, you can bring in some flow control.
    If all that sounds a bit intimidating, there are Alliance Member companies out there (such as PrimeTest Automation) who can write such code for you and even provide a turnkey solution for you.
    Happy wiring,
    Dan Press
    Certified LabVIEW Architect
    PrimeTest Automation

  • Serial IO using LabVIEW CLFN

    BACKGROUND
    I have written LabVIEW wrappers for a DLL device driver. One function of the DLL responds to hardware interrupts and one input to this function is a pointer to a user function (to be called when an interrupt occurrs). Since a LabVIEW CLFN can not accept a pointer to a function I wrote a wrapper DLL which accepts a Dynamic User Event Reference and internally calls PostLVUserEvent(userRec2, &testData);
    so far so good.
    The PROBLEM:
    Another input to the function accepts TYPE which defines the communication protocol. Options are ARINC 429 (an aviation standard), serial 232, serial 485. I tested this originally using ARINC429 and everything runs great. When 232 is selected, immediately upon an interrupt LabVIEW locks up requiring Task Manager to quit LabVIEW, or in somecases powering down the PC. In C code the sample runs fine. The problem (in LV) appears to be in handling the interrupt only when serial is selected. My wrapper DLL includes three header files: #include "extcode.h" #include "hosttype.h" & #include "std429.h"  I have confirmed with the client that their header "std429.h" includes serial IO and serial prototypes (I was hoping that was the issue). Would there be any other #includes necessary (or any other "known quirks") with using LabVIEW to access Serial IO through a DLL?
    thanx
    lmd2
    Lawrence M. David Jr.
    Certified LabVIEW Architect
    cell: 516.819.9711
    http://www.aleconsultants.com
    [email protected]

    Okay, more information: the code seems to be working to a point. The action that we are using to trigger the interrupt is keyboard input from a hyperterminal configured to 9600 baud. The VI runs fine until I type a single letter. At this point the processor gets pegged (Task Manager is open and minimized). Within the event structure I have just an increment (for the time being). Hitting a single letter should trigger a single interrupt and I should see my probbe go from 0 -> 1. Because everything is bogged down (processor pegged) the probe doesn't update for a while but when it does it says over 7K. As I am typing this I just saw another update (I have NOT typed more than 1 letter) the probe now reads 27084
    So what should have been a single one time event seems to have latched somehow ON and is continuously firing and using 100% of my processor.
    This make sense to anybody?
    thanx
    lmd2
    Lawrence M. David Jr.
    Certified LabVIEW Architect
    cell: 516.819.9711
    http://www.aleconsultants.com
    [email protected]

  • Zedboard Xilinx Zync 7000 interface using labview

    Hello,
    I am doing my thesis in Zedboard for developing an DDR3 memory test and verification. For that I need to implement an LabVIEW dedicated Graphical User Interface base on NI Measurement Studio.
    Topic is : Szudy of Algorithmic test setup for DDR3 SDRAM with a Xilinx Zynq SoC.
    Here i have done my algorithm in Xilinx SDK. But I need to make a GUI using labview. Which helps to execute these programs. Please let me know how I can do this.
    1. Or is it possible to directly access the Zynq SoC using Labview. If yes how?
    2. Or if I need to do the coding in Xilinx SDK and How I can run this code using Labview?
    Please give me an detailed reply. Since I am new to labview. I m not understanding how to start with. If you have any example design please share with me.
    Thanks & Regards,
    Nithin Ponnarasseri
    Solved!
    Go to Solution.

    No you can't develop directly in LabVIEW and deploy that program to the Zync board. NI has their own Zync based hardware platform (cRIO and myRIO) but the tools to target those boards are specific to the NI hardware implementation and won't work with other hardware. Developing an interface for another hardware platform is a lot of work and needs to be adapted for every single flavor of a new hardware platform. And NI does not support this for other hardware.
    So your option will be to develop an application with the Zync SDK for the Zync ARM controller and supply some form of communication interface (serial port, TCP/IP, or similar) in that application over which you can send commands from LabVIEW to your embedded application.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • How do I control serial power using LabView?

    I need to use LabView to alter the voltage coming from the serial port. Is it as easy as writing to the serial port? I know that if you write to the serial port that it'll produce a binary number, does this binary number correspond to a voltage.

    If you want to create a scalable voltage value coming from the serial port you must have a Dig -> Analog conversion circuit.
    If your goal is to vary a voltage from 1 - 10 vdc, then you must create:
    1) a an external circuit that will convert/buffer digital serial interfaced binary values to analog values (ni makes these things)
    2) labview code that transfers info to serial port. (driver/etc)
    hope that helps!
    did that answer your question?
    Chances are if you have seen VI in the forest it hasn't fallen.

  • "how to read serial port using labview 6.0"

    sir i am doing a project and is in a need to extract data from serial port. can anyone help me

    This link, and the links from it, are a great place to start:
    http://zone.ni.com/devzone/conceptd.nsf/webmain/8DECBF3E0B714BF3862568F9006E7851?opendocument
    2006 Ultimate LabVIEW G-eek.

  • Labview communication to Hart equipment using serial interface

    I am trying to communicate with various Fluke / Hart temperature equipment (Chubb E4, 9107 Dry well..) with LabView 8.0 thru the serial interface. I have the list of commands from Hart but they are not the same as the typical serial write / read commands and are not working. I am communicating to other equipment using the serial interface with normal serial command formats (i.e.  001c000000FABD, etc... ) but Hart commands are single letters (i.e.   t<CR> )   for reading the temperature. I'm not sure if the problem is with Hart or LabView VIs that I am using.
    Thanks in advance

    I'm sorry.  I was the one who jumped to the conclusion that it was Hart protocol.
    You are using in USB/RS-232 converter.  I assume you see this as another Com port on your computer.  I've used these devices before without problems, those a few people on the forums have said that certain brands just haven't worked for them.
    As I said before, double check all the baud and parity settings.  Double check that you have the right cable, whether it need to be null modem or a straight through cable.
    The manual  ftp://ftp.hartscientific.com/manuals/9105-07.pdf looks like it should be a null modem cable.
    Check that  you are actually sending out a CR character at the end of your string.  Do you need to send a capital T or a lower case t.  That actually messed me up for a few minutes recently on a device I was trying to communicate with.   t<CR> should look like t\r if the constant you are writing is set to \codes display or 74 0D (lower case t) or 540D (upper case T).
    Is the device set up to return a line feed in its response?  Have you provide enough of a delay between the VISA write and read to give the instrument time to send the response?
    Try things in hyperterminal.  It is a simple place to start to see if you have basic communication there.  If you do, then you can focus on the LabVIEW.  If you don't, then you know the issue is with the wiring, device, or Windows driver or settings.
    Are you using the basic LabVIEW VI's for Serial Read and Write or VI's that from somewhere else?  You said "I'm wondering if LabView's VIs are feeding the newer information in the old format or something like that."  LabVIEW is only going to send out whatever you tell it to send out. 
    Sorry it's a bunch of questions rather than answers, but hopefully it gets you looking in different areas that you may not have thought of.

  • Using LabView to serial interface my microscope how I make a user interface to make the stage move by pressing buttons?

    I have used LabView very little and am trying to write a program to control a microscope. I want to be able to give it commands such as to get the stage to move left, right, forward, back, and return to zero. I'm having trouble implementing the code into my block diagram. I've been reading LabView 8.6 tutorials for a couple of weeks and I'm still learning. What I know that  is that I need a event structure inside a while-loop for the user interface but I've been stuck.
    Thanks for any help! If you need me to try and provide more information please say so.
    Attachments:
    Button.vi ‏21 KB

    Alright so my serial port code should be inside a while loop unfortunately it doesn't work whenever I enter a command to move the stage. It sits there maybe I'm missing something.
    So let me give you an overview to what happens in my code, so the configure serial port is very crucial. The VISA Write writes the bytes to the port. The first VISA Write takes the string to write command. I connected the second VISA write to make it easier whenever I enter a command, the \r will iniate the command as a whole. Example L\r will move the stage to Left once, ending up at VISA Read then closing. All of this found in separate case structures.
    Now the user interface to control the the movement of the microscope is one of my issues, making several attempts to make it work yielded no results. My best work not the best but a attempt is attached, also one of the things with this I'm having trouble with is getting the button to talk to the stage. On previous buttons I worked on I could press the button and light up an LED on the front panel, I thought the same principle would relate to the movement of the stage, no such luck.
    I hope I cleared up some misconceptions on my part, I appreciate your patience.
    Attachments:
    OptiScan.vi ‏14 KB

  • Problems with Serial Communication using Labview 6 and Solaris 8

    I am working on a Driver for a Temperature Controller. But I am stuck at the very basics. I am using Labview 6 and the platform is Solaris 8 on a SUN Ultra 60 Workstation. I can not get the Serial communication to work. When I am running raw (uncompiled) code it works (I can read from and write to ttya and ttyb) but once compiled I get error code 37 (device not found). I have tried the following steps to fix this with no luck.
    1) I made sure that the "serpdrv" file is in the same folder with the executable. I also make sure the serpdrv file is added as a support file when building the app.
    2) I changed from using traditional serial VI's to labview 6's new visa functions. With these "new" VI's when
    I try to initiliaze the visa device and wire a control to the "visa reference" input only 1 serial port shows up (ASRL2, missing ASRL1). I am not sure if this is part of same problem or whole new issue.
    3) I reinstalled both visa and labview 6.0.2 update hoping this would help with no luck
    4) I placed the following entry into the ".labviewrc" file
    labview.serialdevices: "/dev/ttya:/dev/ttyb"
    If anybody has had the same problem I would love to hear about it and if you have any solutions
    Jamie Shea

    Hi Jamie,
    1. Do you have NI-VISA driver installed on the machine on which you are running this executable?? If you are trying to run the executable on the same machine on which the development program has ran fine, then you can ignore this point.
    2. If you have done all the changes that are suggested by other discussions related to this topic, then try changing the Port input to Visa Serial Configure.Vi from a control to a constant and try it. In some case, I have seen this to do the trick. I think this point should solve your problem. If it does do tell me. :-))

  • I use LabVIEW 7.1 but I have some problem when, I use LabVEW to read the data from serial communication

    I use LabVIEW 7.1 but I have some problem when, I use LabVEW to read the data from serial communication.
    I use LabVIEW to read the data from serial communication then, i open the example (.vi) from Serial Communication - Advanced Serial Write and Read  from LabVIEW Example. BUT it have some error message that : Error - 1073807202 occured  at property node in visa configure serial port (instr).vi -> advance serial write and read .vi
    this error code is undefined. no one has provide a description for this code, or you might have wired a number that is not an error code to the error code input.
    I don't know why? please help me. thank you.

    When I copy that code into "Explain Error" I get: "VISA:  (Hex 0xBFFF009E) A code library required by VISA could not be located or loaded."
    You may have a bad install of VISA or the wrong version of VISA loaded. Try re-installing VISA. You can get the latest version from the NI support site: http://digital.ni.com/softlib.nsf/webcategories/85256410006C055586256BBB002C0E91?opendocument&node=1....
    Also ensure that you are not pointing the example towards a serial port that does not exist.
    Please let us know what you find and what gets this working for you.
         Rob

  • Advice on constructing a test engine and formatting a spreadsheet test file to perform command line interface testing on a product through telnet or serial interface

    Advice on constructing a test engine and formatting a spreadsheet test file to perform command line interface testing on a range of products through telnet or serial interface and output pass/fail results.

    If I understand correctly, you want to do the following:
    1. Create one or more tab-delimited files that specify a series of query strings (that LabVIEW will send to your products) and expected reply strings (that LabVIEW will look for in response to each query)
    2. Run your LabVIEW program (the test engine) and have it execute one or more test scripts from file using either TCP/IP or serial communication to your units under test
    3. Track how many of the queries are met with the expected response, and output an indication of whether each step passed or failed
    If this is close to correct, then I've attached a sample test file and LabVIEW VI as an example; I chose the TCP/telnet method because it allowed me to use the ni.com Web site to simulate my tes
    t hardware. If you happen to own the LabVIEW Internet Toolkit, there's a VI called "Telnet Play Script" in the Telnet palette that does something fairly similar using TCP. The same general model would also work for Serial communications.
    Hope it helps,
    John Lum
    Attachments:
    test_engine.zip ‏24 KB

  • Using a PS/2 keyboard on a Sparc workstation through the serial port

    We have recently migrated an application that used to run on a PC, to now run on a Sparc Workstation. This is a SunBlade 1500, running Solaris 8. The application is running in a dedicated console which has a fitted keyboard and trackerball that have PS/2 connectors and cannot be changed.
    We need a way of connecting the PS/2 keyboards to the serial ports of the Sparc workstation. We already have a piece of software that will read ascii values from the serial port so we definately want to go through the serial ports.
    Can someone please suggest what converters will be required to get the output of the keyboard and trackerball as ascii input to the serial port.

    Actually, that's not a bit perverse, at all.
    Jonathan's suggestion is a standard method of connecting to a server.
    (null cable between the computer serial ports)
    ... see the Solaris man pages.
    man tip
    TeraTerm and Hyperterminal are customarily used on a PC running some dialect of Windows.
    The 'tip' command is all that's necessary between Solaris systems.
    PS/2 is not a serial connection, but is a keyboard/mouse interface 'invented' by IBM when they offered their XT-class PS/2 line of desktop systems, back in the 1980's.
    I found this next link by using Google:
    http://members.chello.at/theodor.lauppert/computer/ps2/
    The smaller DIN ports were more compact than the AT-class keyboard ports and the mouse moved from a serial port to a dedicated mouse port.
    Serial communication devices are not keyboards, per se,
    and keyboards are not serial communication devices.
    You need other hardware in between to translate what the human being sends, and another computer is a common method to accomplish that translation.
    Having said all that ...
    Since you cannot change the dedicated console hardware,
    I suggest you go to the manufacturer of that console equipment
    and have them suggest some sort of serial-to-serial interface lash-up.

  • Advice on constructi​ng a test engine and formatting a spreadshee​t test file to perform command line interface testing on a product through telnet or serial interface

    Advice on constructing a test engine and formatting a spreadsheet test file to perform command line interface testing on a range of products through telnet or serial interface and output pass/fail results.

    Hello j. smith,
    TestStand gives you the ability to create "sequence files" which are lists of tests to be run sequentially or in parallel. These tests can be written in any language: LabVIEW VIs, C/C++ DLLs, EXEs, ActiveX objects, .NET Assemblies, etc.
    You can run your TestStand sequence files from a command-line prompt using the following syntax:
    \bin\SeqEdit.exe" /quit -run
    This will launch the TestStand Sequence Editor (and optionally prompt you for TestStand login information if you have this configured), run your sequence file, then exit.
    If you're using the TestStand process model, it can output your results to a report file or database if you configure this. To use a TestStand process mo
    del to execute your sequence file, use the following syntax:
    \bin\SeqEdit.exe" /quit -runEntryPoint
    Here's an example:
    C:\>"C:\Program Files\National Instruments\TestStand 3.0\bin\SeqEdit.exe" /quit -runEntryPoint "Single Pass" "C:\Program Files\National Instruments\TestStand 3.0\Examples\Demo\C\computer.seq"
    Note that multiple sequences and sequence files can be specified on the command line.
    TestStand supports remote sequence execution using DCOM (Distributed COM), which is an east way to remotely execute tests. But as for running tests or commands through a telnet or serial interface, you would have need to check Windows documentation on how to execute command-line remotely like this.
    David Mc.
    NI Applications Engineer

  • Flexiable Communication through TCP/IP or RS-485 using VISA

    I am trying to create a flexiable distributed application that can communicate over RS-485 or TCP/IP visa.  The application has a basic Host / Client(Listener) type of Architecture.  What I would like to be able to do is simply to change my Visa resource name from [Com4] to [TCP::192.168.1.10::3000::socket] and seemlessly change communication protocals.  The problem I am running into is creating a flexiable visa listener.  I tried using the visa events vi's, but I don't know what the syntax of the visa string should be.  Any thoughts or clarifing questions would be apprecaited.

    Hi,
    I am using Compact FieldPoint 2120 with analog I/O to control a robot arm and i am trying to interface a third party device such as a mobile phone (using Java) to program and control the rotation of each joint of the robot arm. I understand this process can be done through TCP/IP or usign DSC software.
    For example:
    Hosting on TCP port (?) and use the syntax
    [newline]::[joint number]::[degree of freedom]::[set to angle in degrees]::
    [arm number] = an ascii value 1 or 2 to determine which arm.
    [joint number] = an ascii number value.
    [degree of freedom] = ascii value x,y or z.
    [set to angle in degrees] = ascii value between 0 and 360.
    The true is that i have no clue how to set up the interface steps and i will appreciate if someone can suggest an easy way of doing the above steps and which software to use. I am currently using LabVIEW 8.20 for building the control model for the robot arm.
    Many thanks
    Bakari

  • LAN Based communication using labview

    I am using sensoray 2601 module via Ethernet communication protocol,i want to interface with LabVIEW,is there any sample program/tips to interface?
    Please Mark the solution as accepted if your problem is solved and donate kudoes

    piZviZ wrote:
    Only data rate working is 9600  between labview and launchpad(arm cortex m4).Where all data rates work between Arduino serial port monitor and launchpad(arm cortex m4).
    Since the only thing that changed is the Launchpad, then that must be the issue.  Are you sure this device can handle more than just the 9600 baud rate?  Are you sure you are even setting the baud rate on this device?

Maybe you are looking for