11-02-2022 02:01 PM
Hi,
In the script I've been working on I use the functions "ChnClpCopy" and "ChnClpPaste" a lot (~30 times each) to reorganize how data is structured in the data portal, but it seems that because of these functions I get a different error every time I run the my script. Sometimes I get an error because one channel didn't get copied and pasted correctly, sometimes I get an error because another channel didn't get copied and pasted correctly.
Is this a known issue, and if so, how do I go about fixing it? I would prefer to not implement while loops where it keeps checking if the channel was pasted successfully.
Thanks.
Solved! Go to Solution.
11-03-2022 04:12 AM
11-07-2022 03:47 AM
Hi jjbane,
In the DIAdem help you find this information about these commands.
Note Avoid using the Windows clipboard in scripts, especially in loops. Timely access to the clipboard is unpredictable and may lead to unexpected behavior. Use the ChnCopy command to copy channels directly. When you copy and paste a calculation channel, DIAdem first deletes all calculated data, the unit and, if available, the xy relationship. When you update values in the Data Portal, DIAdem attempts to recalculate the values with the channels in the channel group and restore the xy relationship. This is only possible if the specified channels are available in the channel group. Use the RunCalculation for CalculationChannel method to calculate the values of of a calculation channel. |
Greetings
Walter
11-08-2022 03:31 PM
I was unaware that "ChnCopy" existed, thank you!