Programing serial port (USB) with xcode?

Hallo,
I am newbie in mac, and I want to program robot and accessing with serial port, I will use xcode and I'm a beginner on XCode.
I'd like to build my own application now. Does anyone could send me any sample code?
I'm using XCode 4.3.2 

Here's a project I did a couple years ago for an iRobot Create.  It should still work with your setup.

Similar Messages

  • Error 37 with serial port / no with hyperterminal

    I have added to my Pc a card with two serial port, I can access to them by hyperteminal or by labview but only at port 0 and 1 at the same time or 2 and 3, if not I have an error 37. What can I do?

    Error 37 means that LabVIEW cannot find the appropriate serial device. This indicates that one of the following conditions exists:
    LabVIEW cannot open the specified serial port;
    LabVIEW cannot find the file serpdrv.
    Make sure that the serial driver was installed before the board, and that the com ports appear normally in the control panel. If you cannot get it working, contact NI through either phone or email support. Since there are several potential causes, this is difficult to diagnose without more information. You can contact NI using the following webpage.
    http://sine.ni.com/apps/we/niae_asc.main
    Kim L.
    Applications Engineer
    National Instruments

  • Get Serial port description With out Visa Intrument

    Hi All
    How can i get the description of a serial port ? eg. Communications Port (COM14)
    I currently use the VISA Instrument but there is a big over head for the release, 65mb over head.
    I would like to list all the available port for the user to select.
    Thanks
    Shakeel
    Help share your knowlegde
    Solved!
    Go to Solution.

    You may find useful resources in this code published by Martin some time ago. Original code returns only the port number, but running it step-by-step you can find the point in which the text description of the device is found and use it.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • Direct Serial Port Comunication With comm API 2.0

    I am running the samples codes like SimpleRead under Windows XP.
    When it executes "portList = CommPortIdentifier.getPortIdentifiers()", the enumerator portList keeps in Null. So no ports are detected.
    I know that there are some dificults because Windows Xp, NT and 200 dont allow direct access to ports.
    I dont know wich standar can i follow to solve this problem..
    Thanks...
    Andres

    I followed your sugestions...
    I installed the dll and the properties file in the respective directories.But I still having the problem.
    I am testing on Jbuilder8 and installed the jdk 1.4 under this directory.
    In the project i put the path for the lib and bin directories...
    Maybe the problem is the large of the path ? c:\program files\jbuilder8\jdk1.4\lib\
    The version are compatible ?
    I think you speak spanish, but i think that we can talk in english only in that forum....
    Thanks...

  • Hp laptops with serial ports

    are there any laptops by hp that have a serial port along with usb?? I really need a true serial port.

    Hi 241R ,
    Here is a link to probook 6470b which has a serial port -http://www8.hp.com/h20195/v2/getpdf.aspx/c04296097​.pdf?ver=4
    Hope it helps
    Regards,
    PraTH_KR
    Although I am an HP employee, I am speaking for myself and not for HP.
    **Click on “Kudos” Star if you think this reply helped** Or Mark it as "Solved" if issue got fixed.

  • Windows Kernel Debbuging: Debug over virtual serial port with WDK 8.1

    I'm currently having some issues doing kernel debugging of a Windows 7 x64 target from my Windows 8.1 x64 host machine. I'm running Visual Studio 2013 with WDK 8.1 on my host and have provisioned my target machine running in VMWare.
    Here are my configurations for the target machine. It was configured by reading mostly from here - http://www.codeproject.com/Tips/545835/Kernel-Mode-Debugging-in-a-VM-using-Visual-Studio :
        Windows 7 x64
        Serial port COM2 with VMWare with name \\.\pipe\com2. All proper options in VMWare are checked
        Debug flag for OS enabled through msconfig. Debug port is COM2 running at 115200 baud.
        I ran the test target client "WDK Test Target Setup x64-x64_en-us.exe" on the machine before provisioning the computer
    I was able to provision the computer properly -- it created the WDK Remove User account. However, I'm running into some issues actually debugging. Below are the steps
        Launch the Windows 7 x64 target image in VMWare and wait on the boot menu
        In Visual Studio (host machine), go to Debug -> Attach to process -> Select my computer -> Select process "Kernel" -> Attach
        In VMWare, press enter to boot Windows
        It takes a while, but on my host machine, Visual Studio eventually connects. I can choose to "Break All" and actually use the debugger.
    However, I can't seem to connect to the debugger if I don't do it before booting the kernel. And I can only attach once. For example, I can't let Windows initialize to the desktop and then build my driver and begin debugging. The debugger will always hang on
    "Waiting to reconnect...". The same goes for if I begin debugging on kernel initialization, decide to stop debugging, then try to reconnect or reattach; it will hang on "Waiting to reconnect..." indefinitely as well.

    Follow the directions here: https://msdn.microsoft.com/en-us/library/windows/hardware/jj200334%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396
    You are using user mode debug setup menus, that won't work.
    Mark Roddy Windows Driver and OS consultant www.hollistech.com

  • Fastest Thinkpad with serial port

    Hello!
     what is the fastest thinkpad with dock station or port replication that still have the serial port that has been produced?
    Is it the X60 ?
    I have my faithful T30 but it is a little slow now...
    Ciao

    Welcome to the forum!
    Although the integrated serial port died with T30 and A31p, it's still available on dock for most newer ThinkPads:
    http://www-307.ibm.com/pc/support/site.wss/MIGR-61297.html
    Good luck.
    Cheers,
    George
    In daily use: R60F, R500F, T61, T410
    Collecting dust: T60
    Enjoying retirement: A31p, T42p,
    Non-ThinkPads: Panasonic CF-31 & CF-52, HP 8760W
    Starting Thursday, 08/14/2014 I'll be away from the forums until further notice. Please do NOT send private messages since I won't be able to read them. Thank you.

  • Any idea on what is causing my serial ports to lock up?

    I recently purchased the NI serial-usb 4 serial port interface box because I was having a problem of my serial ports locking up, and I thought the problem might be with my serial port card. Well, after a few days with the NI boxes 2 of my serial ports locked up. This is a big problem that I need to get resolved. If anyone has any ideas on what might be causing this please let me know.
    I am running Lookout 5.0 (build 7) and Logos 4.4.0.17 on a Dell Windows XP machine with 1GB RAM and a 2 GHz processor. I have already tried recompiling my Lookout file and clearing out my database but the problem still occurs. If I restart the file then the ports start working fine again, but I need to know what is causing this since this
    wasn't a problem until about 2 months ago.
    Any responses would be greatly appreciated.
    Thanks
    Jason
    Jason Phillips

    Thanks for the response, Ben.
    I have Laplink running on the computer all the time, and we do have 2 SCADA packs in the field at this time, but I don't run the Telepace program on this computer. This computer does not have a modem. As far as the serial port card, I was using a "Byterunner" 4 serial port card but I purchased the NI 4 serial port -usb interface because I thought the byterunner card might be the problem.
    Do you think Laplink could be causing the problem?
    Jason
    Jason Phillips

  • 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

  • X2200 M2 requires addition serial port

    I have some new X2200 M2 opteron servers that require addition serial ports, the server comes with 1, 9 pin serial port and with our other V40z servers we were able to use the DIGI serial port expanders PCI cards.
    the X2200 m2 server has
    Standard: Riser card assembly with two internal 64-bit, 8-lane, low-profile, half length PCI-Express slots
    Optional: Riser card assembly with one internal 64-bit, 16-lane, low-profile, half length PCI-Express slot
    1x 16 PCI-E riser supports
    DIGI will only support PCI - X so if If the new 2200 Opteron server has PCI-X slots, then the AccelePort Xr920 will work fine. was the response from DIGI
    any suggestions on how to get additional serial port on these servers.
    Thanks
    Earl

    Had this NET MGT port ever worked in past ? If not then I'd advise you to open a support case with Sun to get this checked. It might be that your NET MGT port is failed.
    -Mehul

  • Reading a char array from Serial port

    Need help!
    Hi, I've got the following problem - I wanna read a input stream from serial port and I use at the moment the following method (reading bytewise):
    public String receiveText (){
          byte ch;
          fStrBuf.delete(0,fStrBuf.length()); //clearing the buffer
    try{
              do {
              ch = (byte) fPortInStream.read();
              fStrBuf.append( (char) ch);
            while ( (byte) ch != 0x03); //The end of frame byte
             }catch(IOException ioe) {};
          return fStrBuf.toString();It works pretty well, but disadvantage is that it's too slow to use it in the thread (at least I think so)
    How can I change it to read all available data from the port (or simply faste). I don't need event listeners, because it's a request-responde communication.
    I tried smth. like this
    byte[] readBuffer = new byte[20];
                try {
                    while (fPortInStream.available() > 0) {
                        int numBytes = inputStream.read(readBuffer);
                        fStrBuf.append(readBuffer);
                } catch (IOException e) {}
          return fStrBuf.toString();But it doesn't seem to work :-(

    May I suggest that you use StringBuilder rather than StringBuffer. It has less overhead because it is not threadsafe. I do synchronous serial port stuff with Opto 22, and i have no listeners enabled.
    Appending to the String(Builder/Buffer) directly from the byte buffer mangles it. So I use a string (ugh). With the Opto22 brain boards, i am looking for a carriage return as a term char. It either finds it or times out.
    This is the best i have come up with so far:
    StringBuilder response = new StringBuilder();
    String data = new String();
    long msTimeOut = 2000;
    public void getResponse () throws IOException {
            byte[] readBuff = {0};
            int charAvail;
            response.delete(0,response.length());
            long ts = Calendar.getInstance().getTimeInMillis();
            try {
                while ( readBuff[readBuff.length-1] != '\r' ) {
                    charAvail = inputStream.available();
                    if ( charAvail > 0 ) {
                        readBuff = new byte[charAvail];
                        inputStream.read(readBuff);
                        response.append(new String(readBuff));
                    if ( Calendar.getInstance().getTimeInMillis() > (ts + msTimeOut) ) {
                        response.delete(0,response.length());
                        response.append("TIMEOUT");
                        break;
            } catch (IOException e) { e.printStackTrace(); throw e; }        
            data = response.substring(0);
        } I just starting writing Java about 4 days ago, so caveat emptor.

  • Using USB Printer on Beige G3 with Localtalk/Serial Port - How?

    I have an Epson Stylus 740 which has both DIN 8/Serial port and USB connections, but the serial quit showing-up, so I want to connect via the USB connector. Is this possible?
    Is there an adapter from DIN 8 Serial/Localtalk connector on Beige G3 to USB for Printer?
    Or do I need to buy a PCI to USB card?
    Other solution?
    thanks

    Russo:
    If you tried to connect an adaptor to the serial port that had a USB connector on the end, it probably won't work since the serial port isn't currently working. You'd need a USB PCI card to connect to the USB.
    I have this same printer, originally used the serial port and then switched to USB when I got the PCI card. This has worked great.
    You should see if something got turned off. Look at these:
    Under the Apple Menu>Control Panel > AppleTalk - make sure the printer port is selected
    Under Apple Menu>Control Panel > Remote Access > Modem (from the drop down menu) - make sure that the printer port isn't selected
    Under Apple Menu > Control Panel > USB Printer sharing - make sure that is turned OFF.
    You might also have to install drivers for the Epson from the disk that came with it. If you insert the CD and choose "custom install" you'll get another screen that allows you to choose the serial driver package.
    Post back if you get it working (or don't).
    HTH.
    A

  • Is it possible to communicate with two different devices using two seperate serial ports in the same labview program?

    The two bits of the program will talk to each instrument successfully if the other part of the program is not running. i do not need them to communicte with both serial ports at the exact same time, just within the same program, one after the other. i am using labview 6. any ideas of what i could be doing wrong?

    Hello,
    If you are using the Legacy serial VIs, you should really switch to the VISA VIs. Also make sure you are opening a session to each of the com ports at the beginning of the program and closing each at the end of the program. Problems can arise if your try to open a session to a port that already has a session open. Also you should update LabVIEW to 6.0.2
    If you are still having problems post the error code and error message you are getting.
    Ray K
    NI Applications Engineer

  • Start a program with a signal from serial port

    Hi, my program need to continue when it's gets a signal from the
    serial port, I've understand that i need to use Java Communications 3.0 API.
    couldn't install it.
    when i import, in my program, javax.comm.* it can't be resolve.
    thank for eny help..:-)

    Glad you got it to work. I would only say 2 very important things:
    1) Do not use an IDE as long as you can't code using notepad and command console and don't understand the concept "classpath". Now you've to learn both the IDE and the Java language basics. This is going to take a longer time than when you learn it one by one.
    2) You should NEVER place any 3rd party libraries in JRE/lib or JDK/bin. This is receipt for major future troubles. You should define the classpath yourself. You shouldn't misuse the default classpath.

  • How can I read a serial port using XCode?

    Hello,
    I'm using an iMac 2009 with Mac OS X 10.6.7. I have a USB to Serial cable and I want to connect a hardware I made using a microprocessor Microchip PIC to my mac. I'd like to read values from the serial port and also write values to it. I'm already able to do this using the Terminal with the following command:
    screen /dev/tty.usbserial 9600
    I'd like to build my own application now. Does anyone could send me any sample code?
    I'm using XCode 3.2.5 and I'm a beginner on XCode.

    I looked at Dev Center for sample code, and I found this link:
    http://developer.apple.com/library/mac/#samplecode/SerialPortSample/Introduction /Intro.html%23//apple_ref/doc/uid/DTS10000454-Intro-DontLinkElementID_2
    I downloaded the sample Xcode project and, when I click on "Build and Run" button, it generates an error with the following message:
    "GCC 4.2 is not compatible with the Mac OS X 10.4 SDK (file SerialPortSample.c)"
    Maybe, it occurs because the code is too old (2005). I didn't find any newer sample.
    Could you help me?
    Thank you.

Maybe you are looking for

  • Problems editing adobe 9 pro PDF in adobe X pro

    Using Outlook 2007, I created a PDF of all items that were in a folder I created.  The version I was using at the time was Adobe Acrobat pro 9.  In version 9, I had a field that I could populate called "Jurisdiction", which was available as a column

  • Exchange 2010: Sender address rejected: Access denied

    hi friends i have been recently experiencing an issue with one of my customer which i send email i get bounce message while i can receive their emails with no issue. i have exchange 2010 installed and im using Anti spam device too. my domain is ok.co

  • Tables for GL Balances

    Dear All, I want to develop a report which will pick up the "<u><b>GL Balances</b></u>" for a particular period. For this I need the names of tables where GL Balances are stored. I tried using BSEG and BSIS tables but they store only line items. So p

  • Infotype 5 to 2006 conversion - Handling retro updates to absence record

    Greetings, My query is related to IT 5 to IT 2006 conversion and the required configuration to correctly update the quota balance for past dated changes to absence hours. The scenario: Infotype 5 is converted to 2006 effective 01.01.2009 and the rema

  • Because this message "can that certain files are missing or incorrectly server"

    for me this message "may lack certain files on the server or incorrectly adobe muse" apart get the message MuseJSAssert: Error calling selector function: TypeError: "undefined" is not a function No puedo ver mi proyecto web en sistema IOS, el error e