EasyManua.ls Logo

CAS BI Series - Data Request Mode Programming Examples; Data Request Mode: BASIC Program Example; Data Request Mode: C-Language Program Example

CAS BI Series
28 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Data request mode
If F-2 is set to 3, the indicator outputs the specified data when
ASCII code corresponding to "D" is sent to it.
*** Simple transmit/receive program(Language: BASIC)
10 OPEN "COM1: 9600, N, 8, 1" AS #1
20 IF LOC(1) = 0 THEN 60
30 A$ = INPUT$(1, 1)
40 PRINT A$; " " ;
50 GOTO 20
60 B$ = INKEY$ : IF B$ = " " THEN 20
70 PRINT B$ ; " ";
80 PRINT #1, B$
90 GOTO 20
*** Simple transmit/receive program( C-Language)
#include <bios.h>
#include <conio.h>
#define COM1 0
#define DATA_READY Ox100
#define TRUE 1
#define FALSE 0
#define SETTING ( 0x00 | 0xE0 | 0x00 | 0x03 )
int main(void)
{
int in, out, status, DONE = FALSE;
bioscom(0, SETTING, COM1);
cprintf(". . . BIOSCOM [ESC] to exit . . .\n);
while(!DONE)
{
status = bioscom(3, 0, COM1);
if (status & DATA_READY)
if (( out = bioscom(2, 0, COM1) & 0x7F) ! = 0)
putch(out);
if ( kbhit())
{
if ((in =getch()) == ' \x1B ')
DONE = TRUE;
bioscom(1, in, COM1);
}
}
return 0;
}
17
All manuals and user guides at all-guides.com
all-guides.com

Related product manuals