Communicating To Basic Stamp with RS232

I am new to programming in Labview.
I recently have a requirement to use LabView to control a Test Setup rigged with a Basic Stamp 2p Mircocontroller.
All I need to do is to get Labview to send some coded commands to the stamp so that it can retrieve execute the commands and then return some data that it collected from the sensors that it is monitoring.
Below is how I try to manage the communication:
1. Labview send out "0" then read from COM1, timeout in 5secs. It will repeat this until it get a reply from the Stamp wihtin 5secs.
2. Basic Stamp will not reply if it is doing something else. It will reply "0" if it is ready to receive instructions. And "1" if it is ready to send data.
3. When Labview get a "0" reply, it will send out the two coded instructions. If the reply is "1" Labview will read from COM1.
Here's the problem.
I start my experiment by sending the first set of instructions to the Stamp. Which it has no problem executing.
But when I try to send a 2nd instructions, i.e. when Labview try to send out "0" and wait for a "0" reply. It reads the value of the last instruction it sent out. Depending how many bytes I set it to read, LabView will cycle until the last byte of the previous instruction is done then it will read in the "0".
I do not believe the problem is with my Stamp program or the hardware as I tried to manually sent instructions using Hyperterminal(with echo off) and I do not see the instructions returning.
The way Labview behave seems like ECHO ON in hyperterminal. Just that the data I sent out seems to be sitting in the read buffer.
I manage to bypass this by doing something really stupid. Each time I need to read from the COM port, I close the VISA connection and Open it again. This seems to help clear the buffer. But this put in substantial amount of wait time in both my Stamp and Labview program as I have to ensure each side is ready to communicate and they wait for each other to get ready.
Does anyone know how I can stop the data I sent out to appear when I read from COM port?
The only configuration that is not default on the VISA connection is that I stepped the Baud rate down to 4800 to ensure that the Stamp do not loose data.
Thank you.

I tried using the Send/Read Example. But since my Stamp is programmed to communicate in 4800 baud rate, I have to add the VISA Config in the Labview example to get it talking properly. Well the results are the same. I see what I send out in the read message box and my stamp is not program to echo message. The only thing I can think of that could cause this is the serial cable. I have to rig an adapter to diasble the stamp from resetting I rigged the cable so that pin 2, 3 & 5 on the DB9 cable is connected to the stamp. Pin 1, 4 & 6 are tie together. Pin 7 & 8 are tied together. (As suggested in the basic stamp manual, Pg 399). Would this cause the data to be routed back to the read buffer?
Thank you.
Attachments:
Manual.jpg ‏64 KB

Similar Messages

  • Working with basic stamp rs-232

    hi there,
    i'm currently using basic stamp together with labview 8.5. communication between the hardware (4 ultrasound sensors) and software is using the RS-232 serial communication.
    however, the sampling rate is very slow ( as low as 10 samples per second). may i know how to increase the sampling rate?
    it is due to the serial communication?

    Who wrote the embedded code for the microcontroller?  That's probably where the sampling rate is set (or allows to be set).  Is there documentation that came with the firmware?  Also, what are you sampling?  Depending on what you are sampling, sampling rates can vary greatly. 
    For instance, you would sample temperature at a vely low rate as compared with wind velocity. 
    Does your circuit allow for buffering?  There are many details about your environment that you need to share before we can offer any suggestions on how to increase sampling rate...  Or to determine if it is possible to do so...
    R

  • Communicat​ing between LabVIEW and Basic Stamp 2.0

    Hello,
    We are trying to control the movement of a Parallax Boe-Bot (robot with
    Board of Education) via LabView programming.  The BOE operates on
    Basic Stamp programming to control the pulse width sent to two servo
    motors.
    Is there a way to establish communication between LabVIEW and Basic
    Stamp 2.0?   We need to send commands from LabVIEW to the
    Basic Stamp to control the pulse width and therefore the rotation of
    the two servo motors.  We also need to send a signal from an
    accelerometer based on the robot to the LabVIEW ADC. 
    The ultimate goal is to do this with wireless communication, but for
    right now we are simply trying to figure out any way to send the data
    between LabVIEW and the Basic Stamp.
    Any ideas?
    Thank you,
    Adam

    Hi Adam,
    You can communicate with a BASIC Stamp microcontroller over GPIB using VISA.  To see some LabVIEW example code, just search for GPIB in the NI Example Finder (Help>>Find Examples). This will show you the basics of GPIB communication in LabVIEW.  I also found this link by searching the NI discussion forums for "basic stamp"
    http://www.parallax.com/html_pages/downloads/softw​are/software_basic_stamp.asp
    Here you can download an example using LabVIEW 7.0 or higher to communicate with a BASIC Stamp 2.
    I hope this is helpful!  Let us know if you have further questions.
    Megan B.
    National Instruments

  • LabVIEW Output, BASIC STAMP II

    How can I output the LabVIEW program that does the following (see
    below) to interface with Basic Stamp II.
    From a graph, I could retrieve X-Values (X1 and X2) and Y-Values (Y1
    and Y2).
    Target (X1, Y1)
    Laser (X2, Y2)
    Change in X (X2 - X1)
    Change in Y (Y2 - Y1)
    If ChangeX >= 5 If ChangeY >=5;
    Move ChangeX==Right; Move ChangeY==Down;
    else if ChangeX <= -5 else if ChangeY <= -5
    Move ChangeX ==Left; Move ChangeY==Up;
    else Move ChangeX==0 else Move ChangeY==0
    | increasing Y
    |
    |
    |
    V ----------- > increasing X
    If the change in X is positive (greater than zero), move change in X
    to th
    e right. If it was negative (less than zero), move change in X to
    left. If the change in Y is positive (greater than zero), move change
    in Y down. If it was negative (less than zero), move change in Y up. I
    used 5 instead of 0 to give room for error.
    Please e-mail me at if you can help, have
    information or any question.
    Thanks,
    Paul

    The example code that was provided with parallax is attached.  As far as the driver for the serial to USB, I downloaded that and I can see the BS2 in my Device Manager (COM5).  When I ran both the example code from Parallax and an example code through LabVIEW for a basic serial write and read, I was unable to get communication between my laptop and the BS2.  If you have code that you developed before, it would be really helpful if I could test that out with my microcontroller. Thanks for all your help guys!
    Attachments:
    StampSerial.llb ‏63 KB

  • Basic Stamp 2 MicroController

    I am currently working on a project that involves using a Basic Stamp 2 microcontroller that was purchased through Parallax.com.  We currently have the uController connected with our laptops using a USB to Serial converter and are able to achieve proper communication with the example LabVIEW code provided through parallax.com.  We loaded the Basic Stamp Editor code that I attached below  and ran the LabVIEW program (also attached).  The problem that we are running into is that we need to have the ability to read and write to each pin.  We need to set a specific pin HIGH depending on the user input. (Ex. User selects Pin 3 to set HIGH or LOW)  The program that was loaded from the basic stamp editor just echos the user input.  We are beginners with the software so we are not sure what part has to be changed in order to get it working.
    If there is any more information that is needed please let us know! We are nearly 4 weeks until our due date =/
    Attachments:
    StampSerial.llb ‏63 KB
    LabVIEWIO Notepad.txt ‏3 KB

    Hi,
    Looking at your stamp code, it is only programmed to drive one output pin and one input pin.  Your serial protocol needs to be expanded to allow you to set pin and state, currently you only send state.  You could just copy the code down and change the DO command to O1, O2 etc.
    Also, the labview code you have is not too good.  There is no while loop.  Are you just running the code once or using the run continuous button?  Run continuous is very bad as you are continuously opening and closing the com port.  You should move the serial port open and close functions outside of the loop.  This will require you to move the open and close code out of the subvi.  If the code is user interface driven then you should use an event structure within your main loop.  If you are not using an event structure you must put a small wait inside the loop or your code could use 100% CPU and lock up your PC.
    Search the labview examples for ways to code your application.
    Good luck,
    Michael

  • Basic questions with respect to ABAP WebDynpro Application

    Hi All,
    I have two basic questions with respect to an ABAP WebDynpro application :
    a) If an ABAP WebDynpro application has been developed, how could it be made available to the end user?
    b) Can an ABAP WebDynpro application be developed in ECC or is it only applicable for version 4.6c?
    Thanks & Regards,
    Sushanth Hulkod

    Sushanth Hulkod wrote:
    > a) If an ABAP WebDynpro application has been developed, how could it be made available to the end user?
    >
    > b) Can an ABAP WebDynpro application be developed in ECC or is it only applicable for version 4.6c?
    a) If an ABAP WebDynpro application has been developed, how could it be made available to the end user?
    Answer - By providing direct link of the WD application created in SE80, creating iView for webdynpro abap application in the portal environment and  NWBC environment
    b) Can an ABAP WebDynpro application be developed in ECC or is it only applicable for version 4.6c?
    Answer - Yes it can be developed in ECC. Webdynpro ABAP is introduced in NW 2004s (SAP NetWeaver 7.0 or ECC 6.0)
    Thanks,
    Chandra

  • Dynamic stamps with Acrobat Pro X

    Help needed!
    How to create own dynamic stamps with Acrobat Pro X, without any knowledge of programming.
    It was very easy with the program used before (Nuance); unfortunally it's not possible to export from Nuance to Acrobat.
    Thanks in advance
    vtosi

    It can't be done without using a script, and not a very simple one, either.
    There are detailed tutorials about how to do it, for example here:
    http://acrobatusers.com/tutorials
    If you're interested in someone to create the stamp (and all the required
    scripts) for you, feel free to contact me by PM or at [email protected] .

  • Entire JDBC communication stopped if problem with one single JDBC interface

    Hello,
    Will the entire JDBC communication stopped if problem with one single JDBC interface?
    Thanks,
    Soorya.

    hi surya,
    this will happend if u use maintain order at runtime at interface determination.
    just uncheck this option if u dont neet EOIO.
    if you are getting the problem if u r going for EO then the problem might be using same JDBC channel for all interfaces.
    if each interface is expected with a high load then it better to go for dedicated channels for interfaces.
    like INTERFACE A should use JDBC A channel and INTERFACE B should use JDBC B channel.
    Thanks & Regards,
    Rama krishna

  • JDBC communication stopped if problem with one single JDBC interface

    Hello,
    Can you please explain this phrase
    "JDBC communication stopped if problem with one single JDBC interface"
    THanks,
    Soorya

    If you are having a problem with a JDBC interface (lets consider this to be a communication channel) then the communication is stopped (via that channel) (only in the case of EOIO).
    Hope this clarifies.
    Cheers,
    Sarath
    Award if helpful.

  • How do I get a time stamp with EACH text message?

    How do I get a time stamp with EACH text message?

    Wow finally! It's nice to see Apple finally provided something as simple as a time stamp.
    Now if they would only put in an Auto Retry for text messaging I would be all set
    Does anyone use the current Android OS? Does it have an auto retry function?

  • A basic query with respect to using Message Selectors in JMS

    Hi
    When i am going MEssage Selectors topic in web , it seems very confusing for me .
    I have written a simple JMS Application based on Weblogic as my Queue .
    I have two Java Files one for Message Producer and another file acting as Message Consumer using MDB
    I have a basic TextMessage with some header properties in my Producer file .
    Please tell me in what file should i put MessageSelector ??.
    Thanks for reading .
    Please clarify my query on this .

    Thank you very much .
    I found the code of a MDB making useage of a Selector .
    *<message-driven>*
    *     <message-selector>shirtType = 'polo'</message-selector>*
    *     </message-driven>*
    Assume that i written a MDB that listens to particular type of Messages (Polo in this case ) .
    Please tell me what happens to other messages in the Queue that were never listened by the MDB .
    Thank you .

  • Create Basic Timeline with Numbers

    I haven't found any timeline software that I'm impressed with so far, so I've made it my goal to create a basic timeline with Numbers. My dates are years, not specific days. (It's for an Old Testament class so some examples of my dates are the Edict of Cyrus in 539 BC, Completion of the second temple in 515 BC, Death of King Uziah in 740 BC, etc.)
    I'm using negative numbers for the year. I've plotted the events on a line graph, however I want to have each event labeled accordingly. Does anyone have an idea of how to do this? Thanks!
    ~Rick

    Well, here's what I might do to create such a chart:
    In my table I would have a column (B) that has the years of each event I would want to plot. Next to it, in column C, would be all zeros. I'd put the event names in column D, though this is only for reference, they won't be plotted. I would create a scatter chart from columns B and C.
    In the chart inspector I would set the Y axis Min to be zero, the Max to be 1, no grid lines, not show the Y axis, no title or legend, etc. I would use the default + sign for the data points but I would perhaps make them larger in the Chart Inspector. I would make the data point lines wider in the Graphic Inspector so they show up better.
    For the text, I would create a text box. In the Graphic Inspector I would turn it 90 degrees (vertical). I would copy this box and paste it repeatedly so there are a bunch of them to work with. I'd put event names in each one. Then I'd put them all on the graph above the correct years. You may have to hold down the command key while dragging the text boxes to be able to align each one exactly over a data point.
    That's the basics. You might want to fancy it up a bit more. One thought would be to create a custom format for the X axis so the years display as "500BC" vs "-500". Do this in the table inspector in the Axis tab. Choose Custom and the custom format pane will open. Click on the plus sign and add the condition "if less than zero". Type BC at then end of the #,###. Right click on the #,### and click to remove the separator (the comma). You can change the "positive" dates in a similar fashion so they will have an AD (if you have any positive dates).
    Message was edited by: Badunit

  • Hi, can someone help me how can i connected my multimeter to my pc with rs232, because my computer can´t recognize the device, i mean the multimeter, is a multimeter keithley serie 2400, and i already downloaded all the drivers for labview even the VISA

    hi, can someone help me how can i connected my multimeter to my pc with rs232, because my computer can´t recognize the device, i mean the multimeter, is a multimeter keithley serie 2400, and i already downloaded all the drivers for labview even the VISA

    Marco,
    Here are some suggestions:
    1) Check the manual the Keithley manual to see how to configure the RS-232.   
        On some models you need set Factory defaults to USER and turn on the RS-232.   
        Also there may be a setting for SCPI which you want on (probably on by default).
    2) On your PC - open Device Manager. See if a COM port exists and is functional.
         You must get this working before continuing.
          You can set the COM port parameters by right clicking and selecting Properties.  
         (On some PCs the onboard ports can be disabled in the BIOS)
    3) If step two was OK, open MAX (Measurement and Automation eXplorer).      
        On the left side, click on Devices and Hardware.   
        Click on Serial and Parallel.   
        Go to the COM port you found in Device Manager.   
        Open a VISA Test Panel.
        Now I don't have one I can look at right now, so this is general idea:
       Configure the COM port to match the Keithley settings (should be OK if step 2 worked)  
       Go to the (I think) Input Output tab (you want to send a command)   
       The command string input should already have a *IDN? entered, if not, type it in.   
       Click on the Query button to send the command and check the response.  
       If you get an ID string back (Company name, Model, FW Version ...) then it works.   
       (Disregard an error saying it did not get enough charcters back.) 
    I hope this helps,
    steve
    Help the forum when you get help. Click the "Solution?" icon on the reply that answers your
    question. Give "Kudos" to replies that help.

  • Accessing Newport ESP 300 Controller with RS232 Interface

    I am trying to access Newport ESP 300 Controller with RS232 interface. My goal is to read Newports collected data with LabView using RS232 Interface. Are there Vi's ore any support available? thank you.

    Hi
    we have built some routines for this machine
    LabVIEW 6.1
    are you interested?
    greetings from the Netherlands

  • IDoc_02_Error passing data to port-Communication error when  sending with HTTP

    Hello All,
    We are receiving the error "02_Error passing data to port-Communication error when  sending with HTTP", when sending the idoc to PI from ECC system.
    Observation:
    1. Some idocs are failing and immediately after sometime the same type of  idocs with different idoc numbers are getting successful.
    Eg: Orders. One purchase order is failing at one point of time. later another purchase order is getting successful after some time to the same partner.
    2. If i perform the reset of idoc, then it is getting delivered during next scheduled job run.
    please help me in resolving the issue.
    Regards,
    Ch. Venkat.

    status 02 is     Error passing data to port ...it simply means your port setting has some problem. do configure your port setting and also in partner profile
    Thanx and Regards
    Arpan Maheshwari

Maybe you are looking for

  • How to play iTunes and music from external hard drive?

    I recently back up all my music from my old computer on to an external hard drive. I have a new computer but don't want to store all the music on the computer's hard drive. I would rather play iTunes and all the music straight off of the hard drive.

  • Home Button not working properly after latest update

    After installing the latest update on my Iphone 4S, the home button immediately started to give me problems. It works sporadically.  Sometimes it allows me to close apps when I tap it twice, sometimes it won't do anything, sometimes it will go to the

  • Vendor master updation

    Hi , whether there is a transactions to update the vendor master file. One for the mass change of the payment terms (LFB1-ZTERM, LFM1-ZTERM) and the other to mass change the blocking indicators. (LFA1-SPERR and LFA1-SPERM) ? Thanks in Advance Prashan

  • System Copy BI

    Hi, I'm currently making a copy of BI dual Stack (ABAP/JAVA add-in) with the backup/restore method, The System is a Solaris 10, we had 16Go RAM (using zoning properties of Solaris, project shm memory) At the 24/27 Step : install java engine, I have t

  • Failure - Unable to start App in Fiori apps

    Hi Experts, When i am going to access time sheet app in fiori apps, we got below error can you please guide, Can you please guide for this issue. its urgent requirements. Thanks in advance. Thanks J Jana Tags edited by: Michael Appleby