08-17-2015 09:11 AM
Hello,
I'm searching for a solution to an error that does not make much sense to me:
Error in <NoName(2).VBS> (Line: 75, Column: 3):
Classification error. The class begin is higher than the class end.
It appears when I call the attached VBS on the also attached TDMS. Diadem 2012. The index file did not make it thru the upload system here.
It seems to be triggered by funtion ChnHistogram() and the help page says something about ClassBegin/End being "Global Parameters". What are these? Where does one set them.
Thanks in advance for clues.
Solved! Go to Solution.
08-18-2015 03:18 AM
Hey cubz,
you script is to big to debug it quickly.
The issue is caused by the ChnHistogram in line 75. It happens in the 3rd iteration of the surounding for-loop.
The issue seems to be the parameter ClassBegin and/or ClassEnd. I think the error message should tell you, that ClassBegin > ClassEnd, but this needs further debugging.
Regards, Stephan
08-18-2015 03:23 AM
Oh, stupid me. The function couldn't compute on a channel that does not contain any values (or contains only NOVALUE). Sry guys.
08-18-2015 03:35 AM
Hi Stephan,
thx, yes, you are right, the third iteration passes an empty channel to the function, therefore error
Call ChnHistogram(Y, R, R, ClassMeth1, FrequencyType)
Y | Specifies the data channel that contains the y-values. | ||||||||||||||||||||||||
R | Specifies the result channel that receives the class means. | ||||||||||||||||||||||||
R | Specifies the result channel that receives the samples. | ||||||||||||||||||||||||
ClassMeth1 | Specifies how DIAdem specifies the class limits.
When you use the Automatic method, you specify the number of classes. DIAdem calculates the missing parameters from the maximum and minimum values of the channel to be classified. If you use the Channel method, DIAdem uses the values of the specified channel as class limits. |
||||||||||||||||||||||||
FrequencyType | Specifies whether DIAdem calculates the class frequency absolutely or relatively.
The absolute class frequency Hi of the i-th class Ki for i=1, 2, ...p for even numbers p of the created classes is equal the number of observation values in the class Ki. The relative class frequency hi of the class Ki is then 1/n multiplied by the absolute class frequency. with n = Channel length |
Thanks for reply. Well, just what did you use to find out it is 3rd iteration? I use function logfilewrite that outputs text below the code.
I'll keep the topic here, so that it is searchable.
08-18-2015 03:55 AM
Hey cubz,
I did not use the logfilewrite function.
I set an breakpoint on line 75 and added two lines after this line to the script to display the content of ClassBegin and ClassEnd with an msgBox.
I recognized that the code executed well untill the 3rd call of my added msgBox commands.
Stephan