sending com port command

Erin erin.siebert at gmail.com
Tue Feb 21 00:07:26 UTC 2012


Thanks for the info Paul.  I was thinking something like that may
work.  In the past, I have successfully triggered a serial port pump
(via a usb to 9-pin serial port converter) in E-Prime sending text
commands using a serial.writestring inline.  (I installed a driver for
the computer to recognize the serial-usb converter as a serial com
port.)

However, the equipment I am currently working with is a usb to usb
connection, and E-Prime does not recognize it as a serial port.  When
I run the experiment with a serial device added, I get an "unable to
open port" error, even when I go through and try every com port.  Is
there a way to send this signal through a traditional USB connection?
thanks!

Erin




On Feb 20, 3:47 pm, Paul Groot <pfc.gr... at gmail.com> wrote:
> Hi Erin,
>
> Although, in theory, it would be possible to use the WritePort command
> to send bytes to a classicalserial(non-USB) RS232 port, it is
> definitely not the way to go. Instead you should use a SerialDevice
> object to communicate with a COM port. The easiest way is to add such
> aSerialdevice in the following dialog:
> E-Studio>Menu>Edit>Experiment>Devices>AddSerial. The default setting
> should be OK (9600bps, 8bit, no parity, 1 stopbit). When you add this
> device, EPrime will add a global SerialDevice object variable to your
> script. The name of this variable will be 'Serial' if there is only
> oneserialdevice.
>
> The next thing you should do is to add a single line of inline script
> to send the command:
>
> SerialDevice.WriteString "sk0" & ebCr
>
> The ebCr constant is a cariage return that is probably required by the device.
>
> I'm not sure if the external device also needs to be initialised first
> (by sending "CPA00000000" for example), but that's up to you to find
> out ;-)
>
> Hope this helps,
> Paul
>
> 2012/2/18 Erin <erin.sieb... at gmail.com>:
>
> > I am trying to send a command to an external device via ausb
> > connection.  The external device is an ADU200USBRelay I/O Interface
> > (http://www.ontrak.net/ADUcommands.htm).  This is a control box which
> > triggers an automatic feeder for our monkeys.  Using the control box's
> > test software, I can trigger the auto feeder by sending the control
> > box the command "sk0."  So, I know I need E-Prime to send the command
> > "sk0" to the ADU200 control box via ausbCOM port.
>
> > I have read the E-Prime help, and it appears it is difficult to send a
> > non binary message via a com port (the WritePort command).  It is
> > possible I may need to use something called a Declare Statement, which
> > is done outside of E-Prime.  However, I am hoping this is not
> > necessary.
>
> > Reading the OnTrak help, it appear a Visual Basic code similar to
> > MSComm1.Output = "sk0" would work (http://www.ontrak.net/visual.htm),
> > however this does not appear to be an option in E-Prime.
>
> > Any pointers would be very appreciated.  Thank you!
>
> > Erin
>
> > --
> > You received this message because you are subscribed to the Google Groups "E-Prime" group.
> > To post to this group, send email to e-prime at googlegroups.com.
> > To unsubscribe from this group, send email to e-prime+unsubscribe at googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/e-prime?hl=en.

-- 
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To post to this group, send email to e-prime at googlegroups.com.
To unsubscribe from this group, send email to e-prime+unsubscribe at googlegroups.com.
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en.



More information about the Eprime mailing list