ADICON Support Forum Applied Digital, Inc.
Page 1 of 1 1
Topic Options
#21355 - 09/19/09 11:33 AM VB 2009 express problem
tom21 Offline
newbie


Registered: 08/18/07
Posts: 17
I am using VB Express 2008 to create a small program. When using the script below to change variable values it works perfectly.

Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click

Dim changeVariable As String
changeVariable = "+V990088"

SerialPort1.Open()
SerialPort1.Write(changeVariable)
SerialPort1.Close()

End Sub

However I want to beable to recieve information from the leopard so i feel the "Old" ASCII Protocol is limited. I created a new scipt showen below to try to change a timer value but with no sucess

Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click

Dim byteBuffer(8) As Byte
byteBuffer(0) = 200
byteBuffer(1) = 41
byteBuffer(2) = 5
byteBuffer(3) = 1
byteBuffer(4) = 0
byteBuffer(5) = 1
byteBuffer(6) = 0
byteBuffer(7) = 248
SerialPort1.Open()
SerialPort1.Write(byteBuffer, 0, 7)
SerialPort1.Close()

End Sub

I am very new to vb express 2008 so any advice/help would be much apreciated

Tom

Top
#21356 - 09/19/09 11:39 AM Re: VB 2009 express problem [Re: tom21]
Guy Lavoie Administrator Offline
Beyond All Hope
*****

Registered: 12/21/02
Posts: 6548
Loc: Montreal, QC, Canada
Shouldn't the write instruction specify a length of 8?

SerialPort1.Write(byteBuffer, 0, 8)
_________________________
"If you don't know what you're doing, do it neatly..."

Top
#21357 - 09/19/09 12:24 PM Re: VB 2009 express problem [Re: Guy Lavoie]
tom21 Offline
newbie


Registered: 08/18/07
Posts: 17
Thatís exactly what is was.

Thanks, once again, Guy

Top
Page 1 of 1 1


Moderator:  Dan Smith, Monte G, ADI Tech Support, Guy Lavoie 
Hop to:
Who's Online
0 registered and 56 anonymous users online.
Recent Posts
Comms Retry Error
by HDTVPete
09/18/17 04:04 PM
Cmax Message: Failed to set data for a 'delay'
by HDTVPete
09/16/17 04:36 PM
Shout Box

Newest Members
brigiel, vevevie, zhutree, 416, saiqul
3003 Registered Users
Forum Stats
3003 Members
19 Forums
4001 Topics
23433 Posts

Max Online: 132 @ 11/13/16 10:07 AM
September
Su M Tu W Th F Sa
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30