Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Timing issue while accessing serial port

by Phemto (Acolyte)
on Jan 20, 2011 at 10:27 UTC ( [id://883283]=note: print w/replies, xml ) Need Help??


in reply to Timing issue while accessing serial port

I'm inclined to blame the OS. You didn't mention what the is, by the way. If it's a unix variant, you could try renicing the program to give it a higher priority. (There is also a way to do this under windows, but I don't know it off the top of my head). I don't know that it would completely solve the problem, but if it makes a difference in your test results, it would imply that your program is not getting enough CPU cycles to do this in real time.

One non-perl solution could be to use a microcontroller (eg arduino) to communicate with the device. It could handle the triggering and also report back to the PC when it has happened.

  • Comment on Re: Timing issue while accessing serial port

Replies are listed 'Best First'.
Re^2: Timing issue while accessing serial port
by Marshall (Canon) on Jan 20, 2011 at 10:57 UTC
    As slow as Windows is, it is hard for me to say that Windows is to blame here. 1,000 ms is one second. 116ms is about 1/10th of a second. There is something wrong with the code or the code that this code calls.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://883283]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2024-04-24 08:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found