Home > Software engineering >  VB vbRC5Base cPhysicsEngine, high precision timer
VB vbRC5Base cPhysicsEngine, high precision timer

Time:09-22

Because serial data processing has high requirement of real-time demand so the Timer, millisecond at least, VB Timer control similar problem is that in the interface operation as well as some other delay factors can lead to a long delay before the Timer control events will come out, originally envisioned using multimedia API to write one, just that things don't seem to safety, now, of course, the main use vbRC5Base library to write, but found it cTimer and VB Timer has a problem, have a headache, CCRPTimer can use, of course, just don't want to use the

Then search vbRC5Base example, feel there should be a high precision timer in it? Anyway is not found, is to find a cPhysicsEngine this stuff, should be a animation engine and things like that, is not very familiar with, that it is just one example, used as a time event, suddenly feel full of imagination, so also can? Experiment under this thing can't set a time interval, I think this is not much of a problem, can add delay, it seems that no reentrant problems, use good simple, is such a usage? There is a problem? Feel so dizzy was used?

That example:
'in this case, we use only the timing - events (no real physical here in this demo)
'the from this instance, we use only its nice Timing - Events (no real Physics here in this Demo)
The Set PhTimer=New cPhysicsEngine

PhTimer. StartSimulation 'start'
PhTimer. StopSimulation "stop"

Private Sub PhTimer_RenderUpdatedScene (ByVal dT As Double, ByVal FPS As Double)
.
End sub

CodePudding user response:

Test this stuff a cycle is roughly 1.6 ms

CodePudding user response:

OnComm event-driven way, better real-time performance, best without timer, not only without communication overhead is large, and is also difficult to ensure real-time performance,

CodePudding user response:

Serial port communication of the underlying have buffer, it can realize "millisecond" communication,
Your program by MSComm controls such as communication, is the event driven, asynchronous,
If there is a "millisecond" synchronization requirement, multitasking operating system (Windows) are not appropriate, to use single chip microcomputer,

CodePudding user response:

refer to the second floor of123 response:
OnComm event-driven way, better real-time performance, best without timer, not only without communication overhead is large, and is also difficult to ensure real-time performance,


OnComm can realize the Timer?

CodePudding user response:

reference 4 floor Bobogg response:
Quote: refer to the second floor of123 response:

OnComm event-driven way, better real-time performance, best without timer, not only without communication overhead is large, and is also difficult to ensure real-time performance,


OnComm can realize the Timer?



I don't have my wrong sorry

CodePudding user response:

Windows system timing precision material 15 ms
  • Related