To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 15719
15718  |  15720
Subject: 
sending messages with VB
Newsgroups: 
lugnet.robotics
Date: 
Sat, 7 Jul 2001 13:05:05 GMT
Original-From: 
Falco Kleinschmidt <kuddelbard@web.[SayNoToSpam]de>
Viewed: 
2113 times
  
hi!

although i wonder if there are any listeners on this mailing-list i want to
tell you how i reached my goal to send a message bye VB to the RCX.

you only have to insert the "Microsoft Comm Control" in your form to get
access to the COM-Port. setup for the port is 2400,O,8,1 .

i use a simple function to send the byte-codes which are necessary for the
command for a message.

i found good information on
http://baserv.uci.kun.nl/~smientki/Lego_Knex/Lego_electronica/IR_tower/IR_tower.htm


if you want to send for example a message "3" the bytes to send would be
55 FF 00 F7 08 03 FC FA 05

the code is:
--------------------------
Dim msg(9) As Byte

Rem Header
    msg(0) = &H55
    msg(1) = &HFF
    msg(2) = &H0
Rem Opcode for Message
    msg(3) = &HF7
    msg(4) = &H8
Rem Message Byte
    msg(5) = 3       <--------  here the message data-byte
    msg(6) = Not msg(5)
Rem Checksum
    msg(7) = (&HF7 + msg(5)) And 255
    msg(8) = Not msg(7)

Rem send to RCX
    main.MSComm1.Output = msg()

MsgBox Hex(msg(0)) & " " & Hex(msg(1)) & " " & Hex(msg(2)) & " " &
Hex(msg(3)) & " " & Hex(msg(4)) & " " & Hex(msg(5)) & " " & Hex(msg(6)) & " "
& Hex(msg(7)) & " " & Hex(msg(8))
----------------------------

i hope i could or will help somebody with this information :-)

bye
kuddel



1 Message in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR