serial port

BlitzMax Forums/BlitzMax Programming/serial port

allos(Posted 2006) [#1]
I need to send a signal trough serial port to a different computer at the time an event occurs (eg pressing a key or showing a spot on the screen); I am not particularly expert with c or assembler and I would like to do it from BlitzMax. Is there any library or module to do this?
Thank you
allos


Winni(Posted 2006) [#2]
If you're on Win32, this might be helpful for you:

http://www.codeproject.com/system/chaiyasit_t.asp

I think the idea is to open COM1: like you'd open a file and then you write to it.


Leiden(Posted 2006) [#3]
Serial ports are on their way out, even some motherboard vendors are dropping em'. USB would be a much better solution -- especially for large amounts of data (USB2). Even with the fastest Serial UART (16550) you've still only got 115,200 baud. Thats roughly 14kb/sec and depending on how much data you're sending and what form the data is your sendin' you could easily max that out.


Winni(Posted 2006) [#4]
Yeah, serial ports definitely are an outdated technology, but I assume when allos wants to use them, he probably has some good reasons for it. ;-)


Nigel Brown(Posted 2006) [#5]
Anyone who acually believes serial ports are redundant, obviously don't work with hardware! If you need a serial port module take a look at my webpage.


allos(Posted 2006) [#6]
thank you for all the answers; and, yes, I have a good reason for use serial ports; I need to send a very simple signal (no more than a few bytes) every time an event occurs inside a software, form a notebook to a workstation recording medical data (electroencephalography); the software on notebook (coded in BlitzMax) is flashing visual stimuli or auditory stimuli to the patient, and the patient must press a key or not, depending on the stimulus presented
signals are collected by a dedicated board on the workstation, allowing both analogical or digital inputs
this will allow precise recording of the time and type of events (e.g. two integers) allowing coupling of biological signals and events for further elaboration. If there is another way to reach this goal please let me know (I think serial communication is the simplest way, and useful for such a small amount of data).
allos


allos(Posted 2006) [#7]
thank you Nigel I'll try out your module and let you know
allos


dynaman(Posted 2006) [#8]
> If there is another way to reach this goal please let me know

TCP/IP communication would be better if you have the hardware. If all you have is the serial connection then that is the deciding factor.


Leiden(Posted 2006) [#9]
thank you for all the answers; and, yes, I have a good reason for use serial ports; I need to send a very simple signal (no more than a few bytes) every time an event occurs inside a software, form a notebook to a workstation recording medical data (electroencephalography); the software on notebook (coded in BlitzMax) is flashing visual stimuli or auditory stimuli to the patient, and the patient must press a key or not, depending on the stimulus presented
signals are collected by a dedicated board on the workstation, allowing both analogical or digital inputs
this will allow precise recording of the time and type of events (e.g. two integers) allowing coupling of biological signals and events for further elaboration. If there is another way to reach this goal please let me know (I think serial communication is the simplest way, and useful for such a small amount of data).
allos 


That sounds scary, but I just finished clocking PREY so its probably not that horrific.


Nigel Brown(Posted 2006) [#10]
Allos, I am not sure of which signals you are trying to monitor but I would guess from your description from the visual cortex? You may also find some more useful information @ :

http://www.nigelibrown.pwp.blueyonder.co.uk/burden/homepage/index.htm

Most of this stuff was written in blitz+ can let you have the entire source if you are interested? I also have some visual stimuli stuff for VEP and VER's

Your main problem with using serial for communication between the two systems is timing. PC's have terrible latency issues.


allos(Posted 2006) [#11]
thank you Nigel
the website is very interesting
I am currently interested in cognitive event-related potentials, recording from the scalp, not from cortex
I'll email details to you
bye
allos


Panno(Posted 2006) [#12]
no blitz+stuff @ http://www.nigelibrown.pwp.blueyonder.co.uk/burden/homepage/index.htm


Nigel Brown(Posted 2008) [#13]
@Panno
Now fixed soory its so very late.