From: shotgun on
I've designed a trancducer (RS485 to RS232) and it needs to power. I want to use RTS and DTR pins of RS232 port. How can I force and set to 1 these pins in the MATLAB code?

Is not there any a function or method for serial port pins like that,

serial.RTS = 1;
or
serial.RTS = 0;
From: Michael Purdy on
If you did happen to figure out how to do this am doing something very similar and would like to know how it is done. I want to be able to turn on/off a relay from either the PS/2 port (which is RS232) or a parallel port.
Thanks.
From: Salim Azak on
"Michael Purdy" <misterman90(a)hotmail.com> wrote in message <hsk0ct$bsb$1(a)fred.mathworks.com>...
> If you did happen to figure out how to do this am doing something very similar and would like to know how it is done. I want to be able to turn on/off a relay from either the PS/2 port (which is RS232) or a parallel port.
> Thanks.

no I did not yet.
From: Walter Roberson on
Michael Purdy wrote:
> If you did happen to figure out how to do this am doing something very
> similar and would like to know how it is done. I want to be able to
> turn on/off a relay from either the PS/2 port (which is RS232) or a
> parallel port.

PS/2 is not RS232; the reference for PS/2 that I posted earlier
describes the exact voltage levels and the clocking required. Think of
PS/2 more as a serial bus than a RS232 port.

As per the documentation,
http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_external/f85300.html#f85402
you can set() the FlowControl property of a serial port object to be
'none', and then you can set RTS high or not by using set() to the
RequestToSend property 'on' or 'off'. You can then pull power from the
RTS line. I do not know if you need to fopen() the object before the RTS
will be asserted.

Alternately, if it is just power that is needed, set the FlowControl to
'hardware', and then fopen() the port: RTS will come on, and will stay
on unless the input buffer fills up.