photoelectric sensor to PC COM port

Status
Not open for further replies.

draze75

New Member
Hi Guys,

Does anyone knows how to connect the photoelectric sensor, Optex VR-1000T to computer via RS-232 port ? I need to read the sensor signal from the computer.

My project is about to detect the vehicle movement from 1 stage to another stage.

Thanks!.
 

hi,
The datasheet for that model says its a relay contact output, can you confirm that.?

Use a Control pin input on the PC's 9Way RS232 connector, using Visual Basic you could write a short program to detect the pins state.


https://www.aggsoft.com/rs232-pinout-cable/pinout-and-signal.htm

EDIT:
Code:
Private Static Sub MSComm1_OnComm()
    Dim ERMsg$
       
   Select Case MSComm1.CommEvent
        ' Event messages.
        
        Case comEvReceive           
        Case comEvSend
        
        Case comEvCTS' >>>>>>>>>>>>>>>>>>>>>> use one of these control signal events
            ERMsg$ = "Change in CTS Detected"
        Case comEvDSR
            ERMsg$ = "Change in DSR Detected"
        Case comEvCD
            ERMsg$ = "Change in CD Detected"
        Case Else
            ERMsg$ = "Unknown error or event"
    End Select
 
   
End Sub
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…