vishalkbhatt
Member
- Joined
- Oct 7, 2010
- Messages
- 12
- Programming Experience
- Beginner
Hi friends, I m new to this forum and also to VB.net programming. In an application Modbus protocol is used and I have generate LRC checksum for that. But I am stuck at conversion of a Long type data to Byte type. The long type data is for example : 4294967197. I tried all the following functions:
1.b = Byte.Parse(4294967197)
2.b = CByte(4294967197)
3.b = Convert.ToByte(4294967197)
But all give me Overflow errors. the same conversion happens in C# by the statement : byte b = (byte) 4294967197; The answer for this is 9D.
So anyone who knows a function to achieve this conversion or any other way to to this then pls reply, Thanks in advance...
1.b = Byte.Parse(4294967197)
2.b = CByte(4294967197)
3.b = Convert.ToByte(4294967197)
But all give me Overflow errors. the same conversion happens in C# by the statement : byte b = (byte) 4294967197; The answer for this is 9D.
So anyone who knows a function to achieve this conversion or any other way to to this then pls reply, Thanks in advance...