by Otto » Thu Dec 27, 2007 10:31 pm
This is code I use for the display.
func f_KUNDENDISPLAY
#ifdef KUNDENDISPLAY
LOCAL lReady
LOCAL nDelTime := 1
*--------------------------------------------
if aSetup[4]="J" //GetPvProfString( "SETUPDATEN","DSO800", "N", ".\INI\TOUCH.INI" )
WriteComm( DSP_COM, Chr(4) + Chr(1) + Chr(67) + Chr(49) + Chr(88) )
WriteComm( DSP_COM, Chr(23) )
WriteComm( DSP_COM, Chr(4) + Chr(1) + Chr(80) + "1" )
WriteComm( DSP_COM, Chr(23) )
WriteComm( DSP_COM, DISPLINE1 )
WriteComm( DSP_COM, Chr(4) + Chr(1) + Chr(80) + CHR(70) )
WriteComm( DSP_COM, Chr(23) )
WriteComm( DSP_COM, DISPLINE2 )
ELSE
lReady := SetCommState( cDcb )
WriteComm( DSP_COM, Chr(27) + Chr(64) )
WriteComm( DSP_COM, Chr(12) )
WriteComm( DSP_COM, Chr(11) )
WriteComm( DSP_COM, DISPLINE1 )
WriteComm( DSP_COM, Chr(31) + Chr(36) + chr(1) + chr(2) )
WriteComm( DSP_COM, DISPLINE2 )
ENDIF
#ENDIF
RETURN nil
func f_EIN_KUNDENDISPLAY()
#ifdef KUNDENDISPLAY
LOCAL lReady
LOCAL nDelTime := 1
*--------------------------------------------
DSP_COM := OpenCOMM( GetPvProfString( "SETUPDATEN","DISPLAY" ,"COM2" , ".\INI\TOUCH.INI" ), 1024, 128 )
if ! BuildCommDcb( GetPvProfString( "SETUPDATEN","DISPLAY" ,"COM2" , ".\INI\TOUCH.INI" )+":9600,n,8,1", @cDcb )
nError = GetCommError( DSP_COM )
MsgInfo( "BuildCommDcb Error: " + Str( nError ) )
ENDIF
lReady := SetCommState( cDcb )
WriteComm( DSP_COM, Chr(27) + Chr(64) )
IF GetPvProfString( "SETUPDATEN","DSO800", "N", ".\INI\TOUCH.INI" )="J"
WriteComm( DSP_COM, Chr(4) + Chr(1) + Chr(67) + Chr(49) + Chr(88) )
WriteComm( DSP_COM, Chr(23) )
WriteComm( DSP_COM, Chr(4) + Chr(1) + "P" + "1" )
WriteComm( DSP_COM, Chr(23) )
WriteComm( DSP_COM, Chr(4) + Chr(1) + "P" + chr(75) )
WriteComm( DSP_COM, Chr(23) )
else
WriteComm( DSP_COM, Chr(12) )
WriteComm( DSP_COM, Chr(11) )
ENDIF
#ENDIF
RETURN nil
func f_AUS_KUNDENDISPLAY()
#ifdef KUNDENDISPLAY
LOCAL lReady
LOCAL nDelTime := 1
*--------------------------------------------
DelPrnt(nDelTime)
CloseComm(DSP_COM)
#ENDIF
RETURN nil
static function DelPrnt(nDelTime)
LOCAL oTimer,lWaitIng := .F.,oDlg
nDelTime := nDelTime * 1
DEFINE DIALOG oDlg RESOURCE "TELEFON"
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT(oTimer := TTimer():New( nDelTime,{||oTimer:Deactivate(),lWaiting := .T.,oDlg:End()},oDlg ),oTimer:Activate()) valid(lWaiting)
RETURN(nil)
#ifdef KUNDENDISPLAY
f_EIN_KUNDENDISPLAY()
DISPLINE1:= rg_umsetz(20,left(GetPvProfString( "DISPLAY", "Display11","" ,".\INI\TOUCH.INI" ),20))
DISPLINE2:= rg_umsetz(20,left(GetPvProfString( "DISPLAY", "Display12","" ,".\INI\TOUCH.INI" ),20))
f_KUNDENDISPLAY(DISPLINE1,DISPLINE2)
f_AUS_KUNDENDISPLAY()
#ENDIF
func rg_umsetz(nBezLaenge,wort)
wort := ansitooem(left(wort,nBezLaenge))
RETURN (wort)