complete
-
Dear all, Now I have a problem with a small program Win32 console application for communication via RS232 with 3964 protocol, so anybody please help me compile this source code or show me what is wrong: // 3964PROTOCOL.cpp : Defines the entry point for the console application. // #include #include #include #include #include #include #include #include "perce.h" #define ESC 27 void interrupt(*oldvect_ser)(); extern void interrupt int_sio(); extern void restore_8250 (void); extern void init_8250 (void); extern void send_tele (char *, short); extern WORD state, receive_counter, protocol_error; extern BYTE receive_buffer[]; BYTE choice,sio_eoi; BOOL receive, autosend; WORD Com_basis,len; BYTE send_buffer[BUFFER_MAX]; BYTE tmp_buffer[BUFFER_MAX]; BYTE *mode,*port; /*=========================================================*/ void warte (void) { long i; /* warte ein wenig */ for (i=0;i<500000;i++) i = i; } /*----------------------------------------------------------------------- * MENUE *-----------------------------------------------------------------------*/ void menue (void) { clrscr(); printf ("\n\n"); printf ("Final Version of KUKAVISION.EXE \n"); printf ("Serial device with 3964R protocol mod. P.S. 08.08.03\n\n"); printf ("[1] send teststring [4] COM 1 \n"); printf ("[2] getNum [5] COM 2 \n"); printf ("[3] getDat [6] reset protocol\n"); printf (" [ESC] quit\n"); printf ("Aktueller Port: %s\n",port); printf ("Mode : %s\n", mode); printf ("Number of elements: %d\n",numEl); printf ("Element index: %d\n",elementIndex); printf ("Element Data: %s\n---------\n", &send_buffer[0]); } /****************************** SEND_TELEGRAM *******************************/ void send_telegram (BYTE *buffer) { if ((len = strlen (buffer)) > 0) { send_tele (buffer, len); warte (); warte (); warte (); if (state == E1) { state = RUHE; protocol_error=2; } else protocol_error=6; } /********************* MONITORING **********************/ void monitoring (void) { short i; printf("-> : "); for (i=0;i
-
Dear all, Now I have a problem with a small program Win32 console application for communication via RS232 with 3964 protocol, so anybody please help me compile this source code or show me what is wrong: // 3964PROTOCOL.cpp : Defines the entry point for the console application. // #include #include #include #include #include #include #include #include "perce.h" #define ESC 27 void interrupt(*oldvect_ser)(); extern void interrupt int_sio(); extern void restore_8250 (void); extern void init_8250 (void); extern void send_tele (char *, short); extern WORD state, receive_counter, protocol_error; extern BYTE receive_buffer[]; BYTE choice,sio_eoi; BOOL receive, autosend; WORD Com_basis,len; BYTE send_buffer[BUFFER_MAX]; BYTE tmp_buffer[BUFFER_MAX]; BYTE *mode,*port; /*=========================================================*/ void warte (void) { long i; /* warte ein wenig */ for (i=0;i<500000;i++) i = i; } /*----------------------------------------------------------------------- * MENUE *-----------------------------------------------------------------------*/ void menue (void) { clrscr(); printf ("\n\n"); printf ("Final Version of KUKAVISION.EXE \n"); printf ("Serial device with 3964R protocol mod. P.S. 08.08.03\n\n"); printf ("[1] send teststring [4] COM 1 \n"); printf ("[2] getNum [5] COM 2 \n"); printf ("[3] getDat [6] reset protocol\n"); printf (" [ESC] quit\n"); printf ("Aktueller Port: %s\n",port); printf ("Mode : %s\n", mode); printf ("Number of elements: %d\n",numEl); printf ("Element index: %d\n",elementIndex); printf ("Element Data: %s\n---------\n", &send_buffer[0]); } /****************************** SEND_TELEGRAM *******************************/ void send_telegram (BYTE *buffer) { if ((len = strlen (buffer)) > 0) { send_tele (buffer, len); warte (); warte (); warte (); if (state == E1) { state = RUHE; protocol_error=2; } else protocol_error=6; } /********************* MONITORING **********************/ void monitoring (void) { short i; printf("-> : "); for (i=0;i