[ Home ] [ Features ] [ Products ] [ FAQ's ] [ Screens ] [ Support ] [ Downloads ] [ About ] [ Discussion ]


the software that grows with you

 

V32Com_*()

Vouch32 Serial Communication functions are modelled on lines with CA-Clipper Tools III but with more functions and modern enhancements. Tools III documentation can be referenced while using these functions. I will try to point out the differences wherever applicable but for now I will not go into the details of the documentation.

All functions are clubbed under this single page. Whenever I get the time to elaborate, I certainly will do so.  In the meantime refer to MSDN for details how Serial Communication is channelized through WinApi.

Syntax                                                                                                                                             

V32Com_Open( ncPort, nInBuffer, nOutBuffer ) -> lSuccess 

V32Com_Init( ncPort, nBaud, cParity, nDatabits, nStopbit ) -> lSuccess

V32Com_Close( ncPort, [ nComFlush ] ) -> lSuccess

V32Com_Send( ncPort, cString ) -> nBytesNotSent

V32Com_Read( ncPort, nBytesToRead, [ lDelete ] ) -> cStringRead

V32Com_Count( ncPort ) -> nNumberOfBytesInInBuffer

V32Com_SCount( ncPort ) -> nNumberOfBytesInOutBuffer

V32Com_Flush( ncPort ) -> lSuccessIfInBufferIsCleared

V32Com_SFlush( ncPort ) -> lSuccessIfOutBufferIsCleared

V32Com_Break( ncPort, nDuration ) -> lSuccess

V32Com_DCD( ncPort ) -> lFalseAlways    ???  [ Data Carriar Detect State ]

V32Com_CTS( ncPort ) -> lSuccess  [ Checks whether Clear To Send ( CTS ) signal is active ]

V32Com_DSR( ncPort ) -> lSuccess [ Retrievs the status of Data-set-Ready Signal ]

V32Com_Ring( ncPort ) -> lActive [ Retreives whether Ring Indicator Signal is ON ]

V32Com_RLSD( ncPort ) -> lActive [ Receive Line Signal is ON ]

V32Com_DTR( ncPort, lNewStatus ) -> lOldStatus [ Queries or Sets Data Terminal Ready Status ]

V32Com_RTS( ncPort, lNewStatus ) -> lOldStatus [ Queries or Sets Ready-to-Send Status ]

V32Com_Soft( ncPort, lOnOff, ncONChar, ncOFFChar ) -> lOldOnOff [ Sets the Software Handshake ]

V32Com_Hard( ncPort, lNewSetting, lDsr ) -> lOldSetting [ Sets the Hardware Handshake ]

V32Com_SSoft( ncPort ) -> lOldStatus

V32Com_RSoft( ncPort, lNewSetting ) -> lOldStatus

V32Com_Error( ncPort ) -> nCommError

V32Com_Escape( ncPort, nFunction ) -> lSuccess

V32Com_SMask( ncPort, nMask ) -> lSuccess

V32Com_GMask( ncPort ) -> nMask

V32Com_GEvent( ncPort ) -> nCommEvent

V32Com_SRead( ncPort, nTimeOut ) -> cString

V32Com_SSend( ncPort, cString ) ->

V32Com_Transmit( ncPort, ncChar ) -> lSuccess

V32Com_Stat( ncPort ) -> aCommStat

V32Com_TimeOuts( ncPort, aTimeOuts ) ->

V32Com_DCB( ncPort, aDCB ) -> aOldDCB   [ Gets/Sets the Device Control Block Parameters ]

V32Com_Default( cDevice ) -> aDBC [ cDevice := 'Standard Modem over IR link #4' ]

V32Com_Dialog( cDevice ) -> aDCB  [ cDevice := 'Standard Modem over IR link #4' ]

 

 

Arguments

Param Default

Description

ncPort A number representing the communication port OR string in the form as 'COM4'.
nInBuffer 1024bytes
nOutBuffer 1024bytes
 
nBaud    9600
cParity      N
nDatabits       8
nStopBit       1
 
nComFlush        0 xBase++ Compatible argument. If this value is non-zero, comm port in question is not Flushed. ( Needs to be readdressed )
 
nBytesToRead       1024
 
ncOnChar       19
ncOffChar       17
 
lDsr      .F. Toggles between DSR or CTS Flow while Software Handshake is requested. Default is CTS.
 
aTimeOuts  An array of 5 elements, Vouch32 sets the bracketed values as default while initializing the port. Feel free to change these values anywhere in your code.

1    N   ReadIntervalTimeout                     [  15   ]
2    N   ReadTotalTimeoutMultiplier          [     1  ]
3    N   ReadTotalTimeoutConstant           [  250 ]
4    N   WriteTotalTimeoutMultiplier          [     1  ]
5    N   WriteTotalTimeoutConstant           [ 750  ]

 
aCommStat An array with following elements:

1     L   BitFCtsHold
2     L   BitFDsrHold
3     L   BitFRlsdHold
4     L   BitFXoffHold
5     L   BitFXoffSent
6     L   BitFEof
7     L   BitFTxim
8     N  cbInQue
9     N  cbOutQue

 
 
aDCB  An array with following elements. V32Com_DCB() is provided to manipulate the DCB directly. You, however, must be familiar with the

1    N    dcbBaudRate                  
2    L     dcbFBinary
3    L     dcbFParity
4    L     dcbFOutxCtsFlow
5    L     dcbFOutxDsrFlow
6    L     dcbFDtrControl
7    L     dcbFDsrSensitivity
8    L     dcbFTxContinueOnXoff
9    L     dcbFOutX
10  L     dcbFInX
11  L     dcbFErrorChar
12  L     dcbFNull
13  L     dcbFRtsControl
14  L     dcbFAbortOnError
15  N     dcbXonLim
16  N     dcbXoffLim
17  N     dcbByteSize
18  N     dcbParity
19  N     dcbStopBits
20  N     dcbXonChar
21  N     dcbXoffChar
22  N     dcbErrorChar
23  N     dcbEofChar
24  N     dcbEvtChar

 

Returns

NIL

Description

 

Usage

local nPort, nBaud, cParity, nDatabits, nStopbits
local cNumber, nBytes, cRspns
nPort     := 7
nBaud     := 9600
cParity   := 'N'
nDatabits := 8
nStopbits := 1
cNumber   := '+919814030917'

if V32Com_open( nPort )
   if V32com_init( nPort, nBaud, cParity, nDatabits, nStopbits )
      nBytes := V32Com_Send( nPort, 'ATDP' + '0' + chr( 13 ) )
      inkey( 5 )
      cRspns := V32com_read( nPort )
      nBytes := V32com_send( nPort, 'ATDP' + cNumber + chr( 13 ) )
      inkey( 30 )
      cRspns := V32com_read( nPort )
   else
      alert( 'Com port '+str( nPort,1 )+' could not been initialized!' )
   endif
   v32Com_Close( nPort )
else
   alert( 'Com port '+str( nPort,1 )+' could not been opened!' )
endif
return nil

Tips

[ Home ][ Features ] [ Products ][ About Us ][ FAQ's ][ Screen Shots ][ Downloads ][ Support ][ Discussion ]
.

Vouch is a Trademark of Pritpal Bedi
All other Trade Marks are the property of their respective owners.
Copyright 1993-2011 Pritpal Bedi. All rights reserved.
Hit Counter  
You are Visitor # since 14 May 2002