Shop OBEX P1 Docs P2 Docs Learn Events
LabVIEW to BS2px24 Communication USB — Parallax Forums

LabVIEW to BS2px24 Communication USB

Thanh VoThanh Vo Posts: 2
edited 2007-07-13 16:35 in BASIC Stamp
I need to send data from LabVIEW to Basic Stamp by using SRIN command.

How could I setup?

Thank you,

Thanh V0

Comments

  • Thanh VoThanh Vo Posts: 2
    edited 2007-07-13 16:35
    Using HandShake and Data is in HEX

    Example code:
    Delay VAR Byte(4)
    PulseDelay VAR Word
    PulseWidth VAR Word
    PulseWidth = 1500
    Counter VAR Word
    RX VAR Byte
    RX=16
    SerialInput:
    SEROUT RX, 17405, [noparse][[/noparse]"A"]
    SERIN RX, 17405, [noparse][[/noparse]Delay]
    PulseDelay = Delay
    Main:
    IF (IN1=1) THEN
    FOR Counter = 1 TO PulseDelay
    NEXT
    PULSOUT 15, PulseWidth
    DO WHILE (IN1=1)
    LOOP
    ENDIF
    · IF (IN3=1) THEN
    · FOR Counter = 1 TO PulseDelay
    · NEXT
    · PULSOUT 14, PulseWidth
    · DO WHILE (IN3=1)
    · LOOP
    · ENDIF
    SEROUT RX, 17405, [noparse][[/noparse]"A"]
    SERIN RX, 17405, [noparse][[/noparse]Delay]
    PulseDelay = Delay
    GOTO Main
    END
Sign In or Register to comment.