Jump to content
  • 0

AOutScan has an unwanted delay before it finishes on USB-2627 card


Ceco

Question

Hello,
I have a problem with a USB-2627 card. The AOutScan function ends with a delay in some cases. I am using the Universal Library with Visual Studio and VisualBasic.NET on Windows 10. I start the AInScan and AOutScan functions simultaneously with a trigger (for this, I am using one of the DOs on the USB-2627, which I have connected to the trigger input). Both run in the background at the same rate. Example of a parameter set where the problem occurs: Output array with 15 elements, and a buffer with 15 elements is also allocated and a rate of 275 samples/second. The AInScan function captures the points (I want to capture as many points with AInScan as are output with AOutScan), but AOutScan still runs for about 100 ms. This is indicated by the status function (status is "Running" although CurrentIndex is already 14), the EnableEvent event of type OnEndOfAoScan is also not fired yet, and _board.StopBackground(MccDaq.FunctionType.AoFunction) doesn’t help either – I still see the delay of about 100 ms. I also observe the delay with other parameters, but not with all parameters. Could you please explain why this happens and how I can avoid it?
Thank you

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hello @Ceco.

The USB-2627 subsystems may run concurrently but they are not synchronized.  According to the Universal Library Help, for the analog input subsystem, the default packet size for USB transfer is 256 samples and rate dependent, while the packet size for the analog output subsystem is not specified.

image.png

 

image.png

 

Do you call the AOutScan() function before the AInScan()?

Which parameters do not show an extended AOutScan delay?

Windows OS may also be a factor with the delay.  Do you have other background tasks/processes running in Task Manager?

 

Regards,

Fausto

Link to comment
Share on other sites

  • 0

Hello @Fausto,

The informations about the packet sizes I also had read, but what can I do about that? For the input the size of the allocated buffer is a multiple of 256. Is there something else I should do?

Both functions AOutScan and AInScan I start simultaneously with a trigger. For the trigger signal I use one of the digital outputs of the USB-2627 itself, which is directly connected to do digital trigger input TTLTRG:
_board.AOutScan(_dAChannel, _dAChannel, _Points.Length, _Rate, Range.Bip10Volts, _MemHandle_AOut_Method, ScanOptions.Background Or ScanOptions.ExtTrigger)
_board.AInScan(_aDChannel, _aDChannel, NumPointsMethod, _Rate, Range.Bip10Volts, _MemHandle_AIn_Method, ScanOptions.Background Or ScanOptions.Continuous Or ScanOptions.ExtTrigger)
_board.DBitOut(DigitalPortType.FirstPortA, DOChannel,  DigitalLogicState.High)

Parameters without the delay are for example: rate of 275 samples/second, with an output array and buffer with 9 points. These are of course very small numbers but the issue is also there with higher rates and more points: For example: at a rate of 305780 I observe the delay with 16665 points but not with 9999.

I dont think its connected to windows background processes because it happens at different times on different days and very reproducibly when I change the number of points. To me at least it seems to be more likely something connected to the buffers and data transfer but what and how to prevent it?

Best regards

Ceco

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...