DataBlClpCopy and DataBlClpPaste Functions Inconsistency in DIAdem

Updated Feb 6, 2023

Reported In

Software

  • DIAdem

Issue Details

I have a script in DIAdem that is copying data from a channel and pasting it in a different one using the DataBlClpCopy and DataBlClpPaste functions, but sometimes several data points are not copied or pasted correctly, there is no consistent behavior with this operation.

Solution

When using the DataBlClpCopy and DataBlClpPaste functions in a script, timely access to the Windows clipboard is unpredictable and may lead to unexpected behavior, specially when used in loops.

The recommended alternative for those functions would be to use the GetValuesBlock and SetValuesBlock methods instead.

Additional Information

When you use the Recording Mode in DIAdem, copying and pasting data in a channel table will result in the DataBlClpCopy and DataBlClpPaste functions being added to the recorded script, this is done as the functions don't represent an issue within the interactive operation, however, it is not recommended to use those functions in an automation script.

The DataBlClpCopy and DataBlClpPaste functions use the Windows clipboard, which can produce unexpected results as it might not be able to reliably execute the copy and paste operations in quick succession. Adding a delay between calls of the clipboard functions can produce more stable results, but this can also introduce a significant delay in the overall script performance.