Anne,

Good to hear from you again!

The comport opens like this (there are a few example files in the demo\
directory of the source, which should be available from  the source
tree):

cedrus.pbl:116:     out <- OpenComPort(16,9600)
cedrus.pbl:120:     out <- OpenComPort(13,9600)
rtbox.pbl:94:     box <- OpenComPort(16,9600)
rtbox.pbl:95:#     box <- OpenComPort(16,115200)
rtbox.pbl:103:     box <- OpenComPort(13,9600)

I use the rs232 library for this, and its mode is hardcoded to:


8-bit (7,6, and 5 are also settable by the library but not PEBL)
Parity-N (I think this is None), where the options are:

  case 'n': cpar = 0;
              ipar = IGNPAR;
              break;
    case 'E':
    case 'e': cpar = PARENB;
              ipar = INPCK;
              break;
    case 'O':
    case 'o': cpar = (PARENB | PARODD);
              ipar = INPCK;

and
stop-bits 0 (alternative is CSTOPB)

The main issue is I don't know what any of this is doing, so I'm not
sure how to expose it to the user most directly, other than the 3-
letter code the rs232 library wants.  (default might be 8N1 like
currently hardcoded).





On Sun, 2016-09-18 at 15:16 -0500, Alan Mead wrote:
> This message has a bit of code:  https://sourceforge.net/p/pebl/mailm
> an/message/29208422/
> 
> You probably need Shane's help but even so you may need to do some
> detective work. 
> 
> When I look at the PEBL source code here: https://sourceforge.net/p/p
> ebl/code-0/HEAD/tree/trunk/src/devices/PComPort.cpp
> 
> It looks like on non-Linux platforms (currently line 113) it sets the
> port to portnum+1
> 
> So, you may need to use port 0 to get COM1
> 
> I don't see any way to set the parity. It looks like Shane would have
> to add support for this in PEBL: http://stackoverflow.com/questions/2
> 8965897/porting-c-serial-port-parity-change-code-from-linux-to-
> windows
> 
> The Windows default is none: https://msdn.microsoft.com/en-us/library
> /system.io.ports.serialport.parity(v=vs.110).aspx?cs-save-lang=1&cs-
> lang=cpp#code-snippet-1
> 
> But I would try without setting parity and see if your EEG software
> will work without a parity bit.
> 
> -Alan
> 
> 
> On 9/17/2016 5:24 PM, Anne Gilman wrote:
> > Could I ask to see some sample code for the COM port commands?  
> > 
> > I've searched the past few years help digests, and your guidance
> > for Dr. Rusciano (quoted below) is what I could find... I'd like to
> > follow up.
> > 
> > The EMOTIV+ EEG software we have can listen to COM1 or COM2, and
> > can take in one code...  Thus far it only works (sending from
> > another program, SuperLab) when I set parity to odd.  
> > 
> > The OpenCOMPort() command has parameters for number (do I just say
> > "1" for COM1?) and baud rate, but not sfaict for parity or
> > handshaking.
> > 
> > I would really like to be able to present our stimuli using PEBL
> > instead, but clearly I could use some help with the serial port
> > part. 
> > 
> > Thanks for any help you can offer,
> > 
> > Anne G.
> > 
> > ...
> > > For EEG, this really depends on how your system works, and what
> > > you are
> > > planning on doing..  You will typically want event markers
> > > (start-of-trial, etc.) that are synched to your eeg log.  I've
> > > used
> > > parallel and serial ports (and the ftdi emulator) to do this sort
> > > of thing
> > > before, and it is pretty straightforward, but you would need to
> > > implement
> > > it yourself and add the signalling to the PEBL script.  If you
> > > are
> > > interested in only a spatial map, it might be good enough to
> > > synchronize
> > > the data sequences at the beginning so you know when the trials
> > > were
> > > happening, and can do proper subtractive methods.
> > > [...] 
> > > End of Pebl-list Digest, Vol 91, Issue 1
> > > ****************************************
> > > 
> > 
> > 
> > -----------------------------------------------------------------
> > -------------
> > 
> > 
> > _______________________________________________
> > Pebl-list mailing list
> > Pebl-list@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/pebl-list
>  
> -- 
> 
> Alan D. Mead, Ph.D.
> President, Talent Algorithms Inc.
> 
> science + technology = better workers
> 
> +815.588.3846 (Office)
> +267.334.4143 (Mobile)
> 
> http://www.alanmead.org
> 
> I've... seen things you people wouldn't believe...
> functions on fire in a copy of Orion.
> I watched C-Sharp glitter in the dark near a programmable gate.
> All those moments will be lost in time, like Ruby... on... Rails...
> Time for Pi.
> 
>           --"The Register" user Alister, applying the famous 
>             "Blade Runner" speech to software development
> -------------------------------------------------------------------
> -----------
> _______________________________________________
> Pebl-list mailing list
> Pebl-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pebl-list

------------------------------------------------------------------------------
_______________________________________________
Pebl-list mailing list
Pebl-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pebl-list

Reply via email to