Hi,
I have sucessfully been using the NSbasic win32 timer to change the state of the
DTR pin on an RS232 port which is connected to a relay Im operating at an
interval of approx 300ms, with a delay (on time) of approx 20ms...
Sub MyTimer_Interval()
objport.DTR = True
Sleep 20
objport.DTR = False
End Sub
I have been measuring the timing using a scope. The sleep delay is quite
accurate to a ms (millisecond) (thats great!). But the timer accuracy between
events is about +/- 10ms or worse.
I've managed to get the timegettime function operating using
Declare "Function timeGetTime Lib ""winmm.dll"" () As Long"
And the time intervals Im measuring on my scope closely match the timegettime
difference Im calculating in the software between intervals indicating the
timegettime has pretty good accuracy.
Could someone advise me how I might use the timegettime function to trigger an
interval event?
Regards,
Justin