Shop OBEX P1 Docs P2 Docs Learn Events
Serial Communication using Labview — Parallax Forums

Serial Communication using Labview

stepupstepup Posts: 6
edited 2007-11-15 17:15 in BASIC Stamp
Hi,
Can any one help me solve a serial communication problem using labview.
the problem is that, when I start my labview program, which is supposed to do a simple send and reveive operation using visa instance, the basic stamp (BS2) is reset continiously
I tried using a hyper Terminal for testing. it turned out that the basic stamp does not reset, but i had to send my character twise before a SERIN with wait detects it.
here is a listing of the basic stamp code below. I also Attached my labview program
thank you for your help

YB

' {$STAMP BS2}
' {$PBASIC 2.5}

#SELECT $STAMP
  #CASE BS2, BS2E, BS2PE
    T2400       CON     396
    T9600       CON     84
    T19K2       CON     32
  #CASE BS2SX, BS2P
    T2400       CON     1021
    T9600       CON     240
    T19K2       CON     110
#ENDSELECT


BaudR         CON       T9600
SerData       VAR       Byte

LOOP1:
LOW 10
SERIN 16, BaudR, [noparse][[/noparse]WAIT("CMD"),DEC SerData]
DEBUG CR, "you entered CMD: ", DEC SerData,CR
GOTO LOOP1

Comments

  • steve_bsteve_b Posts: 1,563
    edited 2007-11-14 20:56
    Did you custom build the cable from your PC to the stamp?

    You need more than just tx/rx/gnd. There's another line (which name escapes me..ATN I think) that stops the stamp from shutting down.
    Check the helpfile.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <FONT>Steve



    What's the best thing to do in a lightning storm? "take a one iron out the bag and hold it straight up above your head, even God cant hit a one iron!"
    Lee Travino after the second time being hit by lightning!
  • stepupstepup Posts: 6
    edited 2007-11-14 21:01
    Well,
    I'm using a usb version of the stamp education board. and I'm not aware if the usb device uses the attention line or not.
  • steve_bsteve_b Posts: 1,563
    edited 2007-11-15 02:56
    Ah....I haven't played with the USB gear yet.
    will have pass to someone else!

    good luck!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <FONT>Steve



    What's the best thing to do in a lightning storm? "take a one iron out the bag and hold it straight up above your head, even God cant hit a one iron!"
    Lee Travino after the second time being hit by lightning!
  • stepupstepup Posts: 6
    edited 2007-11-15 13:28
    I tried the same thing with regular RS232 connection, but still I have similar behavior
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-11-15 17:15
    Setting DTR on the PC will cause the BASIC Stamp to reset. Some customers have had this issue using HyperTerminal. It may be that when the port is opened the BASIC Stamp is being reset and not receiving your first communication for that reason. It may be missing 1 or more characters. Try delaying the data you’re sending after opening the port. Also bear in mind that any data sent to the BASIC Stamp from the PC through the programming port will be echoed back to the PC. This may or may not cause undesirable results on your PC side application if it is expecting a response.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
Sign In or Register to comment.