I have a USB to Serial adapter that I use with a FB program to control an external relay. This is simple port ON/OFF voltage switching control and no data transmission is involved so port defaults are used.
Example FB external equipment critical timing delay program
(assume #LANG "fblite" , #include "vbcompat.bi", OPTION GOSUB)
Code: Select all
OPEN "com9:" AS #1
t = TIMER + 10
DO
IF TIMER >= t THEN EXIT DO
GOSUB dostuff:
SLEEP 10
LOOP
CLOSE
1. Which contacts on the serial DB9 do I take the reed switch contacts to to send a signal back to my FB program so I can record the exact time that the reed switch contacts have closed?
2. How do I modify the above program just to get a recognition in my FB that an event has happened?
I have searched for answers. Even a link would be appreciated but nobody seems to have done things like this?