complete
-
Dear all, Now I'm writing a small program to communicate via RS232 with 3964 protocol, however Idon't understand why I cannot compile this source code. Any body please help me solve this problem.
// 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'm writing a small program to communicate via RS232 with 3964 protocol, however Idon't understand why I cannot compile this source code. Any body please help me solve this problem.
// 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
It would be nice that you tell us at least what the exact error message is and to paste only relevant code. I'm sure if you did that, you would already have an answer (I seriously doubt that anybody wants to go to your complete source and hunt for your problem). Man, the error messages supplied by your compiler ARE usefull.
Cédric Moonen Software developer
Charting control [v1.1]