Sunday, August 16, 2015

Piped output to RS232 COM port

Want output of exe file to pipe to COM 16 where Arduino is. So made a simple char out file below:



This above file gets piped into a serial out file that reads the keyboard (normally std in) and outputs char it gets.

I used the command below:


S8erialHaptic.exe waits for std in and sends chars it gets out COM 16.

Here's the file that does the receiving from a1scout and the sending to com16.

'Now going to get input from keybd that outputs on serial . Worked.
'Worked, in that it sent A and got back a char from arduino A0SCREAD. Now going to cut out all the 'commented rubbish.
Dim As Integer ms 'millisecs
ms = 200
Dim As String sadresult 
open com "com16:9600,n,8,1,cs0,cd0,ds0,rs" as #1
if err <> 0 then
    print "Error opening COM16:"
    sleep
    end
end if
sadresult = Input$ (1,#1) 'clear out crap in in buff
do
print ">";
'print #1, "A";
sadresult = Input$ (1)
print #1, sadresult;
'print "a";
print sadresult 'display result
'sleep ms,0 'reading evering 3 seconds

'print "B"; 
'sleep ms,0 'reading evering 2 seconds
'print"C";
'sleep ms,0 'reading evering 2 seconds

nn

No comments:

Post a Comment