Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Communications > Sending ASCII in HEX RS-485 commands


Reply
 
Thread Tools Display Modes
  #1  
Old 11-05-2003, 04:36 PM
tzachib tzachib is offline
Newcomer
 
Join Date: Sep 2003
Posts: 24
Default Sending ASCII in HEX RS-485 commands


Hi,

I need to send commands from Host to Instrumnets and back
ASCII in HEX format (RS-485).
I know what the commands are but I don't know how to write it in the
VB code.

Commands exapmles:

Typical WRITE command (Host write to Instrument):

<stx> L <addr> <----------Data--------------> <cksm> <etx>
02 4C 33 32 30 32 30 30 30 30 31 35 46 46 37 39 03

Insrument reply:

<stx> L <addr> <-Data-> <cksm> <ack>
02 4C 33 32 30 30 31 31 06

**If someone can show me how to implement this protocol in VB code
I'll be more then glad.

Thanks, Tzachi
Reply With Quote
  #2  
Old 11-05-2003, 09:36 PM
BillSoo's Avatar
BillSoo BillSoo is offline
Code Meister

Retired Moderator
* Guru *
 
Join Date: Aug 2000
Location: Vancouver, BC, Canada
Posts: 10,441
Default

The people who made your rs-485 card should have included a driver or at least instructions. Often, you will need to write to a port address in which case you will need something like inpout32.dll which you can find at www.lvr.com
__________________
"I have a plan so cunning you could put a tail on it and call it a weasel!" - Edmund Blackadder
Reply With Quote
  #3  
Old 11-05-2003, 11:35 PM
tzachib tzachib is offline
Newcomer
 
Join Date: Sep 2003
Posts: 24
Unhappy

Hi again,

The example I wrote in my first qustion was from the vendor instruction book, but my problem is that I don't know how to send this string of data
in VB format and there isn't any document for that.

you wrote that often you need to use the dll file in order to send data to specific port but if I send the address inside the string isn't just enough?

Thanks again,
Tzachi
Reply With Quote
  #4  
Old 11-05-2003, 11:39 PM
tzachib tzachib is offline
Newcomer
 
Join Date: Sep 2003
Posts: 24
Default

Quote:
Originally Posted by BillSoo
The people who made your rs-485 card should have included a driver or at least instructions. Often, you will need to write to a port address in which case you will need something like inpout32.dll which you can find at www.lvr.com






Hi again,

The example I wrote in my first qustion was from the vendor instruction book, but my problem is that I don't know how to send this string of data
in VB format and there isn't any document for that.

you wrote that often you need to use the dll file in order to send data to specific port but if I send the address inside the string isn't just enough?

Thanks again,
Tzachi
Reply With Quote
  #5  
Old 11-06-2003, 12:41 AM
BillSoo's Avatar
BillSoo BillSoo is offline
Code Meister

Retired Moderator
* Guru *
 
Join Date: Aug 2000
Location: Vancouver, BC, Canada
Posts: 10,441
Default

No, if I understand your example correctly, the address in your code is the address of the device on the RS-485 network.

The port address I refer to is on your system itself and is a gateway where the commands you send get onto the network. For instance, the port address of the serial port COM1 on your system is (by default) &H03F8. Now it may be that this method won't be necessary. If you are lucky, the manufacturer will have included some driver kit that will allow you to communicate with your port. For instance, I've seen drivers that are ActiveX DLLs or EXEs. This would be easiest for you since all you would need to do is set a reference to the driver.
__________________
"I have a plan so cunning you could put a tail on it and call it a weasel!" - Edmund Blackadder
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sending Native commands to the CPU Benzakhar Miscellaneous Languages 1 09-15-2003 10:43 PM
Hex to ASCII PrOpHeT General 24 10-25-2002 03:27 PM
Text formattting watkins General 16 04-23-2002 01:01 PM
ASCII to HEX Conversion DDuck General 1 07-06-2001 02:07 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->