Click here to Skip to main content
15,895,084 members
Home / Discussions / C#
   

C#

 
JokeRe: to close connection to database after i use or not ? Pin
Ganesh Kumar Kaki13-Apr-11 2:32
Ganesh Kumar Kaki13-Apr-11 2:32 
AnswerRe: to close connection to database after i use or not ? Pin
#realJSOP28-Mar-11 9:55
mve#realJSOP28-Mar-11 9:55 
AnswerRe: to close connection to database after i use or not ? Pin
Wendelius28-Mar-11 10:48
mentorWendelius28-Mar-11 10:48 
AnswerRe: to close connection to database after i use or not ? Pin
PIEBALDconsult28-Mar-11 14:25
mvePIEBALDconsult28-Mar-11 14:25 
QuestionHow to communicate to a device via serial port Pin
_awatts28-Mar-11 6:21
_awatts28-Mar-11 6:21 
GeneralRe: How to communicate to a device via serial port Pin
_awatts28-Mar-11 9:09
_awatts28-Mar-11 9:09 
GeneralRe: How to communicate to a device via serial port Pin
Luc Pattyn28-Mar-11 9:21
sitebuilderLuc Pattyn28-Mar-11 9:21 
GeneralRe: How to communicate to a device via serial port Pin
_awatts28-Mar-11 9:57
_awatts28-Mar-11 9:57 
Thanks for the reply, simply confirming 5516 represents 16bit makes this document alot clearer.

If my packet structure is as follows

Preamble
SYNC - Word - A55A16
Packet header
TYPE - Word - 010116
SIZE - Byte - (data size)
DSUM - Byte - Data checksum using 5516 seed
HSUM - Byte - Header checksum using 5516 seed
Packet Data
Start - Byte - data[0]
Data - Data[...]

Am I therefore looking to create an array of bytes, the first 7 bytes for the Preamble and Packet header. Therefore the first two representing SYNC [A5,5A], the next two representing TYPE [01,01], the following byte holding the value for SIZE (number of bytes taken up by data), then the byte holding the value for DSUM, then the byte holding the value for HSUM. The 8th byte will hold a 0 (start of data), any bytes from here on holding the data?

If so, how do I calculate DSUM and HSUM?

Regards,

Andrew
Andy

AnswerRe: How to communicate to a device via serial port Pin
Luc Pattyn28-Mar-11 10:15
sitebuilderLuc Pattyn28-Mar-11 10:15 
GeneralRe: How to communicate to a device via serial port Pin
_awatts28-Mar-11 10:45
_awatts28-Mar-11 10:45 
AnswerRe: How to communicate to a device via serial port Pin
Luc Pattyn28-Mar-11 11:00
sitebuilderLuc Pattyn28-Mar-11 11:00 
GeneralRe: How to communicate to a device via serial port Pin
_awatts28-Mar-11 11:38
_awatts28-Mar-11 11:38 
AnswerRe: How to communicate to a device via serial port Pin
Luc Pattyn28-Mar-11 11:55
sitebuilderLuc Pattyn28-Mar-11 11:55 
AnswerRe: How to communicate to a device via serial port Pin
Pritesh Aryan28-Mar-11 20:55
Pritesh Aryan28-Mar-11 20:55 
AnswerRe: How to communicate to a device via serial port Pin
Ganesh Kumar Kaki13-Apr-11 2:35
Ganesh Kumar Kaki13-Apr-11 2:35 
QuestionDebugging a C# GUI app started via commandline Pin
wizardzz28-Mar-11 5:48
wizardzz28-Mar-11 5:48 
AnswerRe: Debugging a C# GUI app started via commandline Pin
Ian Shlasko28-Mar-11 5:58
Ian Shlasko28-Mar-11 5:58 
GeneralRe: Debugging a C# GUI app started via commandline Pin
wizardzz28-Mar-11 6:15
wizardzz28-Mar-11 6:15 
GeneralRe: Debugging a C# GUI app started via commandline Pin
Ian Shlasko28-Mar-11 6:45
Ian Shlasko28-Mar-11 6:45 
QuestionRead XML Into Class Hierarchy Pin
Kevin Marois28-Mar-11 5:10
professionalKevin Marois28-Mar-11 5:10 
AnswerRe: Read XML Into Class Hierarchy Pin
Ian Shlasko28-Mar-11 5:22
Ian Shlasko28-Mar-11 5:22 
GeneralRe: Read XML Into Class Hierarchy Pin
Kevin Marois28-Mar-11 5:33
professionalKevin Marois28-Mar-11 5:33 
GeneralRe: Read XML Into Class Hierarchy Pin
Ian Shlasko28-Mar-11 5:56
Ian Shlasko28-Mar-11 5:56 
GeneralRe: Read XML Into Class Hierarchy Pin
Not Active28-Mar-11 5:59
mentorNot Active28-Mar-11 5:59 
GeneralRe: Read XML Into Class Hierarchy Pin
SledgeHammer0128-Mar-11 6:10
SledgeHammer0128-Mar-11 6:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.