I can recieve data ok but I can't export it out. <br>
This is the source I am using.<br>
#include <stdio.h><br>
#include <bios.h><br>
<br>
<br>
unsigned comminset;<br>
unsigned commoutset;<br>
unsigned datain;<br>
unsigned dataout;<br>
<br>
int portin;<br>
int portout;<br>
unsigned int comstatus;<br>
int count;<br>
unsigned char out;<br>
unsigned char in;<br>
<br>
<br>
void main(void)<br>
{<br>
printf("%s\n","Enter Input Port");<br>
scanf("%i",&portin);<br>
printf("%s\n","Enter Output Port");<br>
scanf("%i",&portout);<br>
<br>
/* initialise input serial port settings 9600,E,1,7*/<br>
comminset = _COM_CHR7+_COM_STOP1+_COM_EVENPARITY+_COM_9600;<br>
comstatus = _bios_serialcom(_COM_INIT,portin-1,comminset);<br>
printf("%s %i %s\n","Comm Port",portin,"Initialised For Input");<br>
<br>
/* initialise output serial port settings 9600,E,1,7*/<br>
commoutset = _COM_CHR7+_COM_STOP1+_COM_EVENPARITY+_COM_9600;<br>
comstatus = _bios_serialcom(_COM_INIT,portout-1,commoutset);<br>
printf("%s %i %s\n","Comm Port",portout,"Initialised For Output");<br>
count=0; <br>
for (; <br>
{<br>
/*read character from input port*/<br>
comstatus = _bios_serialcom(_COM_RECEIVE,portin-1,comminset);<br>
in=comstatus;<br>
out=in;<br>
printf("%hu ",comstatus);<br>
if (in<127)<br>
{<br>
if (in=='\45') <br>
{<br>
count++;<br>
if (count >= 180)<br>
{<br>
count=0;<br>
out='\04';/*send EOT character to output port*/<br>
}<br>
else<br>
{<br>
out=in;<br>
}<br>
}<br>
}<br>
printf("%c %c %3d\r",in,out,count);<br>
commoutset=out;<br>
_bios_serialcom(_COM_SEND,portout-1,commoutset);<br>
}<br>
}
This is the source I am using.<br>
#include <stdio.h><br>
#include <bios.h><br>
<br>
<br>
unsigned comminset;<br>
unsigned commoutset;<br>
unsigned datain;<br>
unsigned dataout;<br>
<br>
int portin;<br>
int portout;<br>
unsigned int comstatus;<br>
int count;<br>
unsigned char out;<br>
unsigned char in;<br>
<br>
<br>
void main(void)<br>
{<br>
printf("%s\n","Enter Input Port");<br>
scanf("%i",&portin);<br>
printf("%s\n","Enter Output Port");<br>
scanf("%i",&portout);<br>
<br>
/* initialise input serial port settings 9600,E,1,7*/<br>
comminset = _COM_CHR7+_COM_STOP1+_COM_EVENPARITY+_COM_9600;<br>
comstatus = _bios_serialcom(_COM_INIT,portin-1,comminset);<br>
printf("%s %i %s\n","Comm Port",portin,"Initialised For Input");<br>
<br>
/* initialise output serial port settings 9600,E,1,7*/<br>
commoutset = _COM_CHR7+_COM_STOP1+_COM_EVENPARITY+_COM_9600;<br>
comstatus = _bios_serialcom(_COM_INIT,portout-1,commoutset);<br>
printf("%s %i %s\n","Comm Port",portout,"Initialised For Output");<br>
count=0; <br>
for (; <br>
{<br>
/*read character from input port*/<br>
comstatus = _bios_serialcom(_COM_RECEIVE,portin-1,comminset);<br>
in=comstatus;<br>
out=in;<br>
printf("%hu ",comstatus);<br>
if (in<127)<br>
{<br>
if (in=='\45') <br>
{<br>
count++;<br>
if (count >= 180)<br>
{<br>
count=0;<br>
out='\04';/*send EOT character to output port*/<br>
}<br>
else<br>
{<br>
out=in;<br>
}<br>
}<br>
}<br>
printf("%c %c %3d\r",in,out,count);<br>
commoutset=out;<br>
_bios_serialcom(_COM_SEND,portout-1,commoutset);<br>
}<br>
}