-
Sending hexadecimal data to serial port MScomm
Hi
I wish to send data to serial port. I use the following code under normal circumstances.
dim bytearray () as byte
redim bytearray(0)
bytearray(0)= &HFF
MSCOMM1.output = bytearray(0) ' 8 bit data
Now I have a requirement that I wish to send 32 bit data to serial port. Which means sending 8 bit data in four steps.
32 bit hex data is in a string as
dim hexstring as string
hexstring = "ff0d01fe"
I use a for loop to send the data
for i = 0 to (hexastring.length/2)-1
bytearray(0) = "&H" hexastring(2*I) & hexastring((2*I)+1)
MSCOMM1.output = bytearray(0) ' 8 bit data
next
But , the following line doesn't make sense. It just uses string concatenation
bytearray(0) = "&H" hexastring(2*I) & hexastring((2*I)+1) [/B]
But the left hand side variable bytearray(0) is byte data type
Any help would be appreciated
Regards
Faisal
Similar Threads
-
By dannycool in forum .NET
Replies: 2
Last Post: 04-16-2010, 12:21 PM
-
By aak2008 in forum VB Classic
Replies: 3
Last Post: 10-19-2008, 05:20 PM
-
By dbrother in forum VB Classic
Replies: 0
Last Post: 02-12-2008, 09:04 AM
-
By Joar Vatnaland in forum XML
Replies: 0
Last Post: 05-18-2001, 04:37 AM
-
By Joar Vatnaland in forum XML
Replies: 0
Last Post: 05-17-2001, 12:06 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks