DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Different Errors Every Time I Run Script (ChnClpPaste)

Solved!
Go to solution

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.

0 Kudos
Message 1 of 4
(781 Views)
Hello, could you please tell, what is the purpose of this data reorganization in your case? This can help to find a solution. For example, when we export the test data to the customer, we reorganize (i.e. change the order of the channels) the data just before the export. In this case, the content of each data file (names of the channels of interest) is known, just the order is "not optimal". So I create a TXT file with the channel names in the "right" order, and then load these channels via DataFileLoadSel. Would this help? Greetings, Vassili
0 Kudos
Message 2 of 4
(758 Views)
Solution
Accepted by topic author jjbane

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

0 Kudos
Message 3 of 4
(730 Views)

I was unaware that "ChnCopy" existed, thank you!

0 Kudos
Message 4 of 4
(710 Views)