dbTalk Databases Forums  

PC Com Port data capture....

comp.databases.pick comp.databases.pick


Discuss PC Com Port data capture.... in the comp.databases.pick forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
sf
 
Posts: n/a

Default PC Com Port data capture.... - 10-25-2005 , 07:46 AM






Looking for someone with experience in PICK D3 to take an existing program
that runs on a PICK port, "listening" for data input and writes the received
input to a record in the D3 database that is then used in other
applications. Moving to D3 windows, we need this application to "listen" on
the comm or serial port of a PC and take the same information and write it
to the database record.

I can provide the original program written in basic for someone to convert
to work listening on a PC serial port. This is for a scale application. The
input through the PC has been established using Oracle but the Oracle
project has been canned. Anyone interested in taking a look?

Please respond via email to sficarro (AT) emoyer (DOT) com and with an expected cost if
known.

Thank you




Reply With Quote
  #2  
Old   
Norman Morgan
 
Posts: n/a

Default Re: PC Com Port data capture.... - 10-25-2005 , 08:51 AM






"sf" <junk@junk> wrote in news:11lsa6nqdui3h90 (AT) corp (DOT) supernews.com:

Quote:
Looking for someone with experience in PICK D3 to take an
existing program that runs on a PICK port, "listening" for data
input and writes the received input to a record in the D3
database that is then used in other applications. Moving to D3
windows, we need this application to "listen" on the comm or
serial port of a PC and take the same information and write it
to the database record.

I don't know if this will help you or not, but here is a program I
did to capture call detail information from a serial port on our
PBX.

* Capture CDR Information From Lucent Definity G3V6 PBX
*
* PROGRAM CALL.RECORDER
*
* Monitors serial port to capture call detail records from PBX,
* reformat and write them to a D3 file for subsequent analysis.
* Serial port may be specified on the command line. If the port
* is not specified, the default port #6 is used. The program is
* intended to be run in a phantom process. It may be brought to
* an orderly halt by writing an empty item with an ID of "STOP"
* to the CALL.DETAIL file. It will be acted on after a record
* is written or after 30 seconds with no call recorded.
*
* ** Program Constants
AM = CHAR(254); VM = CHAR(253); CR = CHAR(13)
MPORT = 57
ERRMSG = ""
FOREVER = 0
* Get command line arguments and store in dynamic array
TCLREAD ARG
SAVEARG = ARG
CONVERT ',' TO ' ' IN ARG
ARG = TRIM(ARG)
CONVERT ' ' TO AM IN ARG
PROGNAME = ARG<1>
DEL ARG<1>
NUMARG = DCOUNT(ARG,AM)
IF NUMARG # 0 THEN MPORT = ARG<1>
* ** Open files
ERMSG = ""
OPEN "CALL.DETAIL" TO F.CDR ELSE ERMSG := " CALL.DETAIL"
IF ERMSG # "" THEN
PRINT "Unable to open:":ERMSG
STOP
END
* ** turn off software handshaking on capture port
VERB = "xonoff (":MPORT:"F"
EXECUTE VERB RETURNING MSG CAPTURING DSP
SLEEP 1
* ** turn off carrier detect on capture port
VERB = "dcd-off ":MPORT
EXECUTE VERB RETURNING MSG CAPTURING DSP
SLEEP 1
* ** unlink the capture port from its normal Pick process
VERB = "unlink-pibdev ":MPORT:",":MPORT
EXECUTE VERB RETURNING MSG CAPTURING DSP
SLEEP 1
* ** attach capture port to this process
VERB = "dev-att ":MPORT
EXECUTE VERB RETURNING MSG CAPTURING DSP
SLEEP 1
* ** Main Processing Logic
LOOP UNTIL FOREVER
TEMP = ""
* ** read characters from the port until a carriage return
* ** is seen or until we have been idle for 60 seconds
GET TEMP FROM MPORT UNTIL CR WAITING 60 THEN
* ** format and write the output record
CDR = ""
C.DATE = TEMP[1,2]:"/":TEMP[3,2]:"/":TEMP[5,2]
CDR<1> = ICONV(C.DATE,'d2/'); * date
CDR<2> = ICONV(TEMP[8,4],'mt'); * time
CDR<3> = TRIM(TEMP[13,5],"0","L"); * call duration
CDR<4> = TRIM(TEMP[19,15]); * calling #
CDR<5> = TRIM(TEMP[35,18]); * dialled #
CDR<6> = TRIM(TEMP[54,4]); * trunk
CDR<7> = TRIM(TEMP[59,5]); * vdn
CDR.ID = SYSTEM(21)
WRITE CDR ON F.CDR,CDR.ID
END
* ** check for the STOP flag and shutdown if found
READ JUNK FROM F.CDR,"STOP" THEN
FOREVER = 1
DELETE F.CDR,"STOP"
END
REPEAT
* ** Detach the capture port from this process
VERB = "dev-det ":MPORT
EXECUTE VERB RETURNING MSG CAPTURING DSP
SLEEP 1
* ** relink capture port to its own process
VERB = "link-pibdev ":MPORT:",":MPORT
EXECUTE VERB RETURNING MSG CAPTURING DSP
STOP

Feel free to use any parts that are helpful.

--
================================================== =========
Norman Morgan <> http://www.norm-morgan.com
================================================== =========
Sometimes I wake up grumpy. Other times I let her sleep.
================================================== =========



Reply With Quote
  #3  
Old   
GVP
 
Posts: n/a

Default Re: PC Com Port data capture.... - 10-25-2005 , 10:01 AM



For use with PC or Windows server:
BRIZ as Windows COM server application can do it.
1 Start BRIZ.EXE on client PC
2 Retrieve GP_TERM.Document object in Your program (VB, Delphi, ... any
COM apps)
3 Do any with D3
4 Release GP_TERM.Document

See sample for Excel VBA
http://infotools.ru/products/BRIZ/DO...LE_GP_TERM.zip

Any question: http://groups.google.com/group/BRIZ

BRIZ - free for: developers, any freeware and OpenQM.

Best regards, Grigory


Reply With Quote
  #4  
Old   
Jeffrey Kaufman
 
Posts: n/a

Default Re: PC Com Port data capture.... - 10-25-2005 , 10:07 AM



Note this method burns a user license by running full time on a serial port.
This program assumes your scale sends a single character string with a
carriage return at the end of the string as most do.

write the program:
SOURCE "PORT.LISTEN"
OPEN "FILENAME" TO FNAME ELSE STOP
SEQ=0
*
START:
INPUT STRING
IF STRING#"" THEN
SEQ=SEQ+1
WRITE STRING ON FNAME,SEQ
END
GOTO START
*
END

compile and catalog the program

create a system pointer:
SYSTEM "PORT.LISTEN"
Q
account name


create a users pointer:
USERS "PORT.LISTEN"
..
..
18 TO PORT.LISTEN


log on the serial port to the program:
LOGON port#,PORT.LISTEN


"sf" <junk@junk> wrote

Quote:
Looking for someone with experience in PICK D3 to take an existing program
that runs on a PICK port, "listening" for data input and writes the
received
input to a record in the D3 database that is then used in other
applications. Moving to D3 windows, we need this application to "listen"
on
the comm or serial port of a PC and take the same information and write it
to the database record.

I can provide the original program written in basic for someone to convert
to work listening on a PC serial port. This is for a scale application.
The
input through the PC has been established using Oracle but the Oracle
project has been canned. Anyone interested in taking a look?

Please respond via email to sficarro (AT) emoyer (DOT) com and with an expected cost
if
known.

Thank you






Reply With Quote
  #5  
Old   
Brian Bond
 
Posts: n/a

Default Re: PC Com Port data capture.... - 10-25-2005 , 11:44 AM



The fancy way is to to execute a "DEV-ATT port" and use SEND and GET to
communicate with your program. It can be either a phantom process, or one
running on a dedicated terminal (if you want to watch what is going on.).
This method doesn't use a license seat.

The non-fancy method is to write a program using INPUT statements, and set
up a login that starts the program when the user logs in. Your application
simply accepts data from the other end of the serial line via an INPUT
statement (using either INPUT X,n or a carraige return). Then just remotely
log on the line and wait for data to be received. This method is also very
easy to test; just run the program, type in what you'd expect to receive
from the client and see if it works.


"sf" <junk@junk> wrote

Quote:
Looking for someone with experience in PICK D3 to take an existing program
that runs on a PICK port, "listening" for data input and writes the
received
input to a record in the D3 database that is then used in other
applications. Moving to D3 windows, we need this application to "listen"
on
the comm or serial port of a PC and take the same information and write it
to the database record.

I can provide the original program written in basic for someone to convert
to work listening on a PC serial port. This is for a scale application.
The
input through the PC has been established using Oracle but the Oracle
project has been canned. Anyone interested in taking a look?

Please respond via email to sficarro (AT) emoyer (DOT) com and with an expected cost
if
known.

Thank you






Reply With Quote
  #6  
Old   
Ross Ferris
 
Posts: n/a

Default Re: PC Com Port data capture.... - 10-25-2005 , 06:16 PM



If you are still using D3, we have a solution that may help. Our SIP
product (Serial Internet Protocol) allows you to map serial ports on
your PC to telnet connections, so the D3 programs could run unchanged
(use nailed telnet so tyou always know which serial port goes where)

We use the same product for running WorthData base stations at remote
locations (hey only talk via serial connection to host), running Wyse
terminals off the back of wndows PC's etc

Drop me a line directly if interested

rossf @t stamina.com.AU(stralia)
Stamina Software
Visage > Better by Design


Reply With Quote
Reply




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

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



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.