DIY Software
 
Notifications
Clear all

DIY Software

18 Posts
8 Users
0 Reactions
7,758 Views
carlk
Posts: 34
(@carlk)
Eminent Member
Joined: 17 years ago

I would try sending 3 sync bytes - 7E (126)
an ID byte - 80 (128)
and 8 data bytes - FF (255)
and see if it works.

This should turn on the first 8 renard channels

Carl


Reply
Posts: 393
Topic starter
(@soakes94)
Honorable Member
Joined: 18 years ago

Well I've thrown together a small test program so I can see what happens when I send different commands to the com port. Just to check, does this look right?

SerialPort1.Write("7E (126)")
SerialPort1.Write("80 (128)")
SerialPort1.Write("FF (255)")

I have the port alread chosen in another part of the program but those lines are sent when I press a button. I put each peiece of code in a seperate transmit, is this right or should I transmit it all at once like this

SerialPort1.Write ("7E (126) 80 (128) FF (255)")

I need to get a proto board sorted with some LED's. I've got one set up for DMX but not renard. I will post the outcome here when I find out.

Steve


Reply
LabRat
Posts: 2981
(@labrat)
Famed Member
Joined: 17 years ago

WIKI + Search + keyword "Protocol" :biggrin2:

http://www.doityourselfchristmas.com/wiki/index.php?title=Renard#Protocol

That being said, I doubt that your sample code is going to work. In most languages that I've run across,
the "" characters denote a string. As such I suspect your write of "7E (126)", would actually send 8 characters "7", "E", ,"(","1"... etc.

I would guess that you would want SerialPort1.Write(0x7E);

I'm not a VB expert, nor do I play one on television. I could be completely wrong on this front. That beind said I heartily recommend that you find some "introduction to VB" sites, and get a little bit more familiar with (pardon the pun) the basics of programming.


Reply
Posts: 1076
 Zeph
(@zeph)
Noble Member
Joined: 15 years ago
soakes94 wrote:Well I've thrown together a small test program so I can see what happens when I send different commands to the com port. Just to check, does this look right?

SerialPort1.Write("7E (126)")
SerialPort1.Write("80 (128)")
SerialPort1.Write("FF (255)")

The above values were given in "hexadecimal" as well as the normal decimal equivalent for communicating with you as human; communicating with Visual Basic is different.
That is, 7E hexadecimal = 126 decimal.
You want to send one or the other as a number (not as text, often called a "string")

SerialPort1.Write(126)
or
SerialPort1.Write(&h7E)

The &h tells visual basic that you are using hexadecimal.

This is all pretty basic programming stuff, tho - if the above is not already familiar to you, there will probably be lots of other small gotchas, likely too many for the folks here to help with every one of them. I agree with LabRat - find some tutorials or a good book on Visual Basic (or specifically VB.net). Then the folks here may be able to help with the more specific quirks of Renard protocol etc. It's great that you are learning this tho and it can be a lot of fun!


Reply
Posts: 393
Topic starter
(@soakes94)
Honorable Member
Joined: 18 years ago

I copied the program source code from an online tutorial so I'm guessing it will work, well so far it seems to. So when it comes to sending data I want to say

SerialPort1.Write(&h7E)
SerialPort1.Write(0x80)
SerialPort1.Write(255-FF)

I have experience with programming this is just my first time at sending data to a com port. This might sound like a stupid question but when I send data to the Renard PIC I'm assuming it has to be a certain peice of data. I read the wiki and I'm still slightly confused. I copied the data I'm sending from the wiki. Im not sure if it makes sense though or if I'm just being completely stupid here.

Steve


Reply
Page 3 / 4
Share: