DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Integration in Analysis vs. ChnIntegrate in Script - Help Brad!!!!

Ok, when I integrate Temp/Power over Temp/RunTime and graph the results in View...everything is as intended.

 

When I execute this code in a script I get the error following:

 

Call DataBlCopy("'Time/RunTime','AI\AO Data/Comp_Power'",StartIndex1, _
                 StartIndex2-StartIndex1,"'Temp/RunTime','Temp/Power'", 1)
  ' Now integrate over the range
  Call ChIntegrate("[6]/[1]", "[6]/[2]", "[6]/[3]")
  ' Calculate the max integration result
  CalculatedSUEnergy = CMax(CNo("Temp/Energy"))

 

Returns this error

PM Error:Type mismatch: 'ChIntegrate'

 

What am I doing wrong????

0 Kudos
Message 1 of 4
(3,963 Views)

Well,  I tried recording the integration action and then cutting and pasting the resulting lines of script.  I get:

 

Call DataBlCopy("'Time/RunTime','AI\AO Data/Comp_Power'",StartIndex1, _
                 StartIndex2-StartIndex1,"'Temp/X','Temp/Y'", 1)
 
  ' Now integrate over the range
  Call ChnIntegrate("Temp/X","Temp/Y","Temp/Integrated") '... XW,Y,E

 

vs.

 

Call DataBlCopy("'Time/RunTime','AI\AO Data/Comp_Power'",StartIndex1, _
                 StartIndex2-StartIndex1,"'Temp/RunTime','Temp/Power'", 1)
  ' Now integrate over the range
  Call ChIntegrate("[6]/[1]", "[6]/[2]", "[6]/[3]")

 

Not sure why, but the top one works, the bottom doesn't.  The only difference is the name of channels, which I changed for other reasons.  RunTime & X are [1], Power & Y are [2] 

 

Anyhow, solved!

 

Message Edited by JeffGrimes on 06-08-2009 11:13 AM
0 Kudos
Message 2 of 4
(3,930 Views)

Hi Jeff,

 

It looks like the issue was the spelling of the function.  The bottom one is missing the "n" in ChnIntegrate.  


Mark E.
National Instruments

0 Kudos
Message 3 of 4
(3,927 Views)

Thanks, Mark.  Never caught it.

 

Smiley Sad

0 Kudos
Message 4 of 4
(3,924 Views)