Normal Topic commands for accessing a com port? (Read 8393 times)
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
commands for accessing a com port?
Jan 22nd, 2005 at 5:01am
Print Post Print Post  
Are there any commands I can use to open a com port and send dtmf tones (actually digits the modem will convert to DTMF) to it to create a dialer feature inside of Sesame.

In the past I used a little dialer utility and called it with an @shell type command and past the numbers to dial but with Sesame I have been using Sbasic to do many features that I use to  need third party utilities for.  I now read files in and write back out with commands like FileReadln() and FileWrite() so I figure there must be a method for me to open a port send attention and control commands and send the number to dial.

The advantage of doing this from inside Sesame is it would then be possible using Sbasic to create a call logging, dialing and routing system based on the connection results.


  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re:  commands for accessing a com port?
Reply #1 - Jan 22nd, 2005 at 5:32am
Print Post Print Post  
I believe this would also be useful for opening a cash register drawer when useing sesame as a POS program.

I'll be eagerly watching for any discussion here.

Thanks,
Steve
  
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re:  commands for accessing a com port?
Reply #2 - Jan 22nd, 2005 at 2:59pm
Print Post Print Post  
I have used the File I/O commands to communicate with the parallel port (to send printer commands), it should be very similar to talk to the COM ports. Use FileOpen to open the COM port you want to use - probably something like:
Code
Select All
fd = FileOpen("COM1:")
 


Then use the file I/O commands to send the communication control commands you need (here in Hayes modem format - as an example only!):
Code
Select All
FileWriteLn(fd, "+++") // Send the Attention command
FileWriteLn(fd, "ATDT555-555-1234") // Dial a number

etc ...
 


  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re:  commands for accessing a com port?
Reply #3 - Jan 22nd, 2005 at 3:36pm
Print Post Print Post  
Mark,

Thanks for the Info. I will give this method a try. Smiley

Steve,

Keep us posted on your progress with the point of sale concept. What other things do you have your Sesame application doing presently?

  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re:  commands for accessing a com port?
Reply #4 - Jan 22nd, 2005 at 4:14pm
Print Post Print Post  
Mark,

Thanks for the info.

Bob,

At present, I know very little/nothing about accessing com ports, but I think I'll be reading up on them around summer time. I'll keep tabs on this thread to see how your doing and post what I've learned.

I would also like to see Sesame able to dial into an ISP to check email as well as dial a credit card authorization company to charge credit card orders.

I started to post my progress in Sesame, but I got long-winded and didn't want to water down your post so I created a new post. Please take a look and reply at your convenience.

Steve
  
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re:  commands for accessing a com port?
Reply #5 - Jan 22nd, 2005 at 5:22pm
Print Post Print Post  
In days of DOS, you could use MODE and ECHO with the Hayes AT commands to  work with the COM ports.  Been a long time since I had to do that, but thought I would throw in the old tools for consideration. 

Could be wriitten up in a batch file that could accept parameters passed by Sesame to the batch file.
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re:  commands for accessing a com port?
Reply #6 - Jan 22nd, 2005 at 9:29pm
Print Post Print Post  
Quote:
I would also like to see Sesame able to dial into an ISP to check email as well as dial a credit card authorization company to charge credit card orders.

I would like to add a "protocols package" for Sesame. It may have to wait for 2.0. Instead of dialing, it would (and should) attempt to contact the specified IP address - the OS, would see that you are not connected to the internet (if you are not) and use the appropriate method for your machine to connect to the internet and get to that IP address. If you use SBasic's SendMail command on a machine setup for dialup internet (PPP), you'll see this how this works. At no point does the SendMail command actually dial anything, that is left up to your OS.

If you use FileOpen to dial the phone to contact your ISP, remember that your SBasic program will be responsible for maintaining the "point to point protocol" ("PPP") including the login procedure between your modem and the ISP's.

I can manage POP ("post office protocol" for getting email), and telnet protocol, but special protocols for credit cards or HTTP (hypertext transport protocol), will take a bit more work. Sesame already speaks a subset of SMTP (simple mail transport protocol) for the SendMail command.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re:  commands for accessing a com port?
Reply #7 - Jan 22nd, 2005 at 9:32pm
Print Post Print Post  
Wow Mark, that would be great.  Shocked

We're rooting for you!

Steve
  
Back to top
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re:  commands for accessing a com port?
Reply #8 - Jan 24th, 2005 at 3:10pm
Print Post Print Post  
I am still floundering a bit with the dialer feature however I found a terrific little free utility that will monitor a com port and display and or log the results. This is quite handy to see what is happening at the com port when you execute your sbasic from sesame. It is also helpful to see what happens when working software is doing what you are attempting to do with Sbasic and Sesame. For example I can monitor my port while using Hyperterminal to control the modem and dial the phone and capture the commands it is sending to the port. I can then run my Sbasic from Sesame and compare to see what I am missing in my communications to the port.

I thought this might be a handy tool for others trying to work with devices connected to a com port.

This utility is called Portmon and can be downloaded free at www.sysinternals.com

  

Team – Together Everyone Achieves More
Back to top
 
IP Logged