From: Namo on
I never worked with serial communication using RS232 cable or USB. and I have few questions


Is there a chip that has input and output port or RS232 interface ,and can programmed with Matlab?

I have Matlab on windows 7 on laptop with USB(I can connect USB to RS232 adapter if required)

an entrance of a room has two pair of transimter-reciver detector as shown below

==T1=======T2=

==R1=======R2=

the two receivers connected to Matlab port(wired or wireless connection). the Two transmitters send contentious DC signal. Matlab checks if the signal is received at the receivers If the T1-R2 bath is blocked then cleared this mean that a person has passed and now check R2 if it blocked then clear then the person entered the room and set a counter to one and Matlab apply a voltage to Digital electronic switch that connect to the room light and the light turn on.

if a second person enter the room, the counter set 2 and light remain turn on. If T2-R2 blocked then cleared first then R1-R2 blocked then clear, this mean that a person exit the room and counter decreaed.

If the counter become zero, Matlab remove the voltage applied to the switch and light turn off.

I know that this is possible with Microcontroller chip and microcontroller programing. But I don't about Matlab.

I am very good with Matlab programming so I want to try it even if the devices connected to a PC.

I don't want a detail programming. I just want to create input and output in Matlab. the input should be observe continuously.
From: Jerry Mouse on
No ... no such chip exists, no direct connection Matlab and USB ....


http://hidlibrary.codeplex.com/SourceControl/changeset/view/9137#194395
http://hidlibrary.codeplex.com/Thread/View.aspx?ThreadId=83082

everything must be programmed using standard C functions

http://www.osronline.com/ddkx/install/di-rtns_9ks2.htm

or WMI functions...
From: Jerry Mouse on
here is source code you need.....

http://forum.builder.cz/read.php?16,3097006,3105765#msg-3105765
From: Jerry Mouse on
http://www.coridiumcorp.com/ARMhelp/index.htm#page=HwUSB3.html

http://www.mathworks.com/matlabcentral/newsreader/view_thread/150767