Recent

Author Topic: Using OnStatus with the synaser unit of Synapse and the USB ports  (Read 3567 times)

Relativity

  • Full Member
  • ***
  • Posts: 103
My laptop should manage two peripherals connected at two USB ports.
I'm going to use the synaser unit of Synapse and in particular the TBlockSerial class.

It is important for my application not only to receive data from each peripheral, but also to know WHEN the data come in, because my software has to correctly combine and elaborate the pieces of information coming in from the two peripherals.

I have read this documentation on "OnStatus":

http://ararat.cz/synapse/doku.php/public:howto:onstatus

If I have well understood, this mechanism calls a procedure of mine AS SOON AS some data comes in. So when this event happens my program would check the timer, take the data and save it together with its arrival time.

Is this correct ?

But later I read this:

http://ararat.cz/synapse/doku.php/public:howto:readevent

according to which there exists no read event in Synapse.
This is the contrary of what I understood about OnStatus. Isn't OnStatus the handler of an event ? I used to think that when THookSocketReason = HR_CanRead, that was the signal that some data had come in and upon this event I could fetch the data.

If this system doesn't work, can you suggest me any other method to get the exact arrival time of the data to the USB port ?

Thank you.

"How'm I gonna get through?"
  -- Pet Shop Boys

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Using OnStatus with the synaser unit of Synapse and the USB ports
« Reply #1 on: May 31, 2015, 12:11:25 pm »
Those two pages are actually talking of Synapse (the internet library), not Synaser (the serial comms. library).
Though they are now joined in a single download, they used to be separated and had different sets of documentation. Furthermore, the wiki at Ararat is a bit outdated; it's best to use the list at sourceforge to asks question of Lukas and/or other Synaser users.

Unless someone here knows more than me (which is very probable) :)
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

Relativity

  • Full Member
  • ***
  • Posts: 103
Re: Using OnStatus with the synaser unit of Synapse and the USB ports
« Reply #2 on: May 31, 2015, 05:28:58 pm »
Ok, thank you very much lucamar.

"How'm I gonna get through?"
  -- Pet Shop Boys

 

TinyPortal © 2005-2018