Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Rs232 Comm ports

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,1947
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Rs232 Comm ports
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1] 2   next >   >>
Login
Message << Older Topic   Newer Topic >>
 Rs232 Comm ports - 2/2/2005 12:16:53 AM   
  VeronicaFrasier

 

Posts: 1
Score: 0
Joined: 2/1/2005
From:
Status: offline
I am fairly new to VBScript but am familiar with VB. I would like to comunicate with a Balance using a Rs232 Comm Port. In VB6 this was easy using a MScomm control.

If someone can point me in right direction to make a start that would be a great help.[?]
 
 
Post #: 1
 
 Re: Rs232 Comm ports - 2/2/2005 1:41:36 AM   
  token

 

Posts: 1917
Score: 0
Joined: 1/14/2005
From:
Status: offline
Stick with VB6 :D

(in reply to VeronicaFrasier)
 
 
Post #: 2
 
 Re: Rs232 Comm ports - 2/2/2005 3:57:46 AM   
  beaker

 

Posts: 78
Score: 0
Joined: 1/27/2005
From: USA
Status: offline
I have a tutorial posted on my website that explains exactly how to use the MSComm control with VBScript. It shows how to respond to events and how to properly grab everything waiting in the buffer. If interested, I'll post a link. (I am an electronics guy and have had a good bit of experience with the MSComm control.)

(in reply to VeronicaFrasier)
 
 
Post #: 3
 
 Re: Rs232 Comm ports - 2/2/2005 11:14:07 AM   
  token

 

Posts: 1917
Score: 0
Joined: 1/14/2005
From:
Status: offline
I'm interested :D

(in reply to VeronicaFrasier)
 
 
Post #: 4
 
 Re: Rs232 Comm ports - 2/2/2005 11:29:11 AM   
  beaker

 

Posts: 78
Score: 0
Joined: 1/27/2005
From: USA
Status: offline
Ok, [url]www.mindspring.com/~redrocker1[/url]. That's the main page. Scroll down to the link to the tutorial. Disclaimer: I am no web page designer! My page is rudimentary. My interest is in providing good tutorials, not fancy presentations. Nothwithstanding, the tutorial should at least get VeronicaF started in the right direction.

(in reply to VeronicaFrasier)
 
 
Post #: 5
 
 Re: Rs232 Comm ports - 2/2/2005 1:58:25 PM   
  token

 

Posts: 1917
Score: 0
Joined: 1/14/2005
From:
Status: offline
Kewl, thanks beaker :)

(in reply to VeronicaFrasier)
 
 
Post #: 6
 
 Re: Rs232 Comm ports - 3/28/2005 4:58:19 PM   
  mccaskey

 

Posts: 6
Score: 0
Joined: 3/28/2005
From:
Status: offline
I'm trying to apply what I learned from beaker's web page, but I'm stuck. He says that you don't need VB installed (I don't have it) to access MSComm. But when I run
CreateObject("MSCommLib.MSComm")
in my VBScript, I get the error
ActiveX can't create object "MSCommLib.MSComm"
The rest of the script runs fine.

If I can really use MSComm without VB, do I need to do something so that VBScript can access it?

Thanks for any leads!

(in reply to VeronicaFrasier)
 
 
Post #: 7
 
 Re: Rs232 Comm ports - 3/29/2005 12:29:56 AM   
  beaker

 

Posts: 78
Score: 0
Joined: 1/27/2005
From: USA
Status: offline
The MSComm ActiveX control lives on my computer because I have Visual C++ 6.0 installed, but I don't really know if I would have it there if not for that fact. It is a redistributable component, meaning developers have license to include it within software distributions, but it may well be that you have never installed a program that installed the component onto your computer. You can of course do a quick check of the registry to see if it is in there, by searching for 'MSCOMMLib.MSComm'. Also, I probably should fix this, but the '.1' in the ProgID 'MSCOMMLib.MSComm.1' is not necessary. That caused a problem for another respondent a few weeks ago. If you don't have the control installed on your computer, I'll go ahead and copy it up to my page, but I'll only bother if you show interest.

(in reply to VeronicaFrasier)
 
 
Post #: 8
 
 Re: Rs232 Comm ports - 3/29/2005 3:31:55 AM   
  mccaskey

 

Posts: 6
Score: 0
Joined: 3/28/2005
From:
Status: offline
Thanks beaker. I can't find MSComm in the registry, so, yes, if you are allowed to, please put the control up on your web page (with info on how to install it, if you will). PHP and Perl have both failed me on my project and I think VBScript (if I can get MSComm) will be my solution.

(in reply to VeronicaFrasier)
 
 
Post #: 9
 
 Re: Rs232 Comm ports - 3/29/2005 4:31:47 AM   
  beaker

 

Posts: 78
Score: 0
Joined: 1/27/2005
From: USA
Status: offline
All right, its up, with instructions. I also fixed that '.1' thing so that does not unnecessarily hang you up. Let us know how it works for you.

(in reply to VeronicaFrasier)
 
 
Post #: 10
 
 Re: Rs232 Comm ports - 3/30/2005 2:31:57 PM   
  mccaskey

 

Posts: 6
Score: 0
Joined: 3/28/2005
From:
Status: offline
I downloaded and tried it and received this error:
Class is not licensed for use.

(in reply to VeronicaFrasier)
 
 
Post #: 11
 
 Re: Rs232 Comm ports - 3/31/2005 1:45:52 AM   
  beaker

 

Posts: 78
Score: 0
Joined: 1/27/2005
From: USA
Status: offline
I was wrong about its redistributable nature. I erroneously believed because it was on the list, it was good to go. Actually, it is a licensed component. Sorry, I did not know that.

You can reference this article which tells you how to license it at runtime:
http://support.microsoft.com/?scid=kb en-us 315501&spid=3042&sid=global

I do not know if the method they show can be adapted to VBScript, so you may be out of luck.

(in reply to VeronicaFrasier)
 
 
Post #: 12
 
 Re: Rs232 Comm ports - 3/31/2005 3:57:10 AM   
  mccaskey

 

Posts: 6
Score: 0
Joined: 3/28/2005
From:
Status: offline
It looks like I'm stuck until I buy VB. Thanks for the help anyway.

(in reply to VeronicaFrasier)
 
 
Post #: 13
 
 Re: Rs232 Comm ports - 3/31/2005 4:31:03 AM   
  beaker

 

Posts: 78
Score: 0
Joined: 1/27/2005
From: USA
Status: offline
Yes, I looked at their example pretty hard, but could not conceive of a way to adapt it to VBS because VBS only has access to the methods exposed by the automation interface, while C++ has access to the functions of the base class from which the control was derived.

I have updated my web page to reflect this new information. Good luck with your project.

(in reply to VeronicaFrasier)
 
 
Post #: 14
 
 Re: Rs232 Comm ports - 4/1/2005 3:30:41 PM   
  mccaskey

 

Posts: 6
Score: 0
Joined: 3/28/2005
From:
Status: offline
I have not tried it yet, but maybe the MScomm look-alike described here (http://ourworld.compuserve.com/homepages/richard_grier/xmcomm.htm) can do the job.

(in reply to VeronicaFrasier)
 
 
Post #: 15
 
 Re: Rs232 Comm ports - 4/2/2005 1:37:38 AM   
  beaker

 

Posts: 78
Score: 0
Joined: 1/27/2005
From: USA
Status: offline
I would say 'go for it' and let us know if it works. Perhaps InstallShield puts the license for the control into the registry. Grier explicitly says his motivation was to make the MSComm control available to non-VB5/VB6 users, so ostensibly that means that it should work for those of you who do not have it already installed. This will be my last post for a week or so as I will be losing internet access for a while while I move, but maybe I'll go the library or something to check on your progress. You are doing a service!

(in reply to VeronicaFrasier)
 
 
Post #: 16
 
 Re: Rs232 Comm ports - 4/2/2005 11:42:28 AM   
  mccaskey

 

Posts: 6
Score: 0
Joined: 3/28/2005
From:
Status: offline
I got it working! If you want to do the same, get and install NETComm.OCX from http://ourworld.compuserve.com/homepages/richard_grier/Downloads.htm, then apply what you learn from beaker's sample and MSDN's MSComm documentation.

(in reply to VeronicaFrasier)
 
 
Post #: 17
 
 Re: Rs232 Comm ports - 4/8/2005 8:50:36 AM   
  beaker

 

Posts: 78
Score: 0
Joined: 1/27/2005
From: USA
Status: offline
Thanks. I have updated my web page to reflect the new information you provided.

(in reply to VeronicaFrasier)
 
 
Post #: 18
 
 RE:Rs232 Comm ports NETComm.ocx - 1/31/2006 2:31:42 AM   
  BPisMe

 

Posts: 5
Score: 0
Joined: 1/30/2006
Status: offline
Hello All,

I am new to this Forum.  What a great find this is!

I searched for a way to use the NETComm.ocx.  I tried Beakers web site and got a "Not Found" error.

I'm wondering if someone could post a code snipit that will load the control and instruct it to send something out of a serial port.

My programming skills depend on examples from other "Better" programmers.

Thanks in advance.

Brad

(in reply to beaker)
 
 
Post #: 19
 
 RE: RE:Rs232 Comm ports NETComm.ocx - 1/31/2006 4:02:57 AM   
  kirrilian


Posts: 628
Score: 3
Joined: 3/15/2005
From:
Status: offline
I have found the google cache of his website and will post it here for you.

link:
http://72.14.203.104/search?q=cache:2I3JohdNHMwJ:www.mindspring.com/~redrocker1/VBScript/VBS.htm+site:www.mindspring.com+redrocker1+mscomm&hl=en&gl=us&ct=clnk&cd=1

site:
quote:


MSComm Control Example
Prerequisites
The MSComm32.ocx ActiveX control is licensed. Therefore, it must be legitimately installed onto the computer on which this script is run. Simply copying the control will not license it and the control will not work. The programmer has two options:
  • Install Visual Basic 6.0 or Visual C++ 6.0. This will install a licensed version of the MSComm32.ocx ActiveX control onto the computer.
  • Install the NETCommOCX ActiveX control from Richard Grier's web site. I have not personally tried it but I do have direct testimonial from another user who did not have the MSComm control installed on his computer and installed this control and used this example successfully. Mr. Grier's control is a wrapper around Microsoft's MSComm control. Grier uses an installation program to install the control on the computer, and this step likely register's the licensed control properly.
Introduction
This example is for those individuals who are interested in using script to do sophisticated serial comms on their computer. It shows four key concepts: receive, transmit, saving received data to a file, and formatting the received data with comma separators. Naturally, as a script, the program has no user interface, but is great for doing background processing, and it does not tie up the CPU. The example is setup to receive six characters and then store them into a file with comma separators between each pair of characters.

      


_____________________________

Have you searched here ?
VBScript Fundamentals
My Site

(in reply to BPisMe)
 
 
Post #: 20
 
 
Page:   [1] 2   next >   >>
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Rs232 Comm ports Page: [1] 2   next >   >>
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts