Jump to content
  • 0

cbAOutScan events in USB-1208FS-Plus (UL)


Tony B Goode

Question

Hi there.

I'm trying to use callback function to detect the end of the output of cbAOutScan function.

It works when OPTIONS passed to cbAOutScan are none or BACKGROUND, but it doesn't work if OPTIONS are (BACKGROUND | CONTINUOUS). That is, the callback function is not executed.

In the configuration of  cbEnableEvent I'm using ON_END_OF_OUTPUT_SCAN and  LATCH_DO.

Thanks for your help,

Toni.

 

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0
On 10/31/2023 at 2:54 PM, JRys said:

The ON_END_OF_OUTPUT_SCAN event happens at the end of the output scan. Using the CONTINOUS scan option defeats this unless you force the event by calling cbStopBackground.

 

Thanks for your answer JRys.

The event ON_END_OF_OUTPUT_SCAN presents the same behavior when CONTINOUS mode is on. I guess that in CONTINUOS, the buffer is overwritten from the beginning  as soon as the new scan starts. So there is no way to know when the buffer is being overwritten. The only way is to avoid CONTINUOS mode. Right?

Thanks a lot for your help,

Toni.

Link to comment
Share on other sites

  • 0

If you want ON_END_OF_OUTPUT_SCAN to work, don't use CONTINOUS mode. I find it easier to use cbGetStatus to determine how far along the output scan is. If I'm updating the buffer with new data, I monitor the current index cbGetStatus parameter. When it indicates 1/2 of the buffer has been written, I update the low half of the buffer. When the index wraps around to zero, I update the upper half. 

Link to comment
Share on other sites

  • 0
On 11/8/2023 at 2:24 PM, JRys said:

If you want ON_END_OF_OUTPUT_SCAN to work, don't use CONTINOUS mode. I find it easier to use cbGetStatus to determine how far along the output scan is. If I'm updating the buffer with new data, I monitor the current index cbGetStatus parameter. When it indicates 1/2 of the buffer has been written, I update the low half of the buffer. When the index wraps around to zero, I update the upper half. 

Thanks for your answer. I wanted to ask about ON_END_OF_INPUT_SCAN (copy & paste mistake) but your answer applies for both input and output scans.

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...