I wrote a basic function to find the number of modules per string, but the two lines with the (*) take the value from the CEC user entered specifications, rather than the CEC module database. I specified the PV module type in line 3, but dispite this it does not get it from the correct location. If anyone could help me with this issue it would be appreciated. Also: is there a way to have SAMUL select a different module from the CEC database within a script? i.e.: I want to have SAM cycle through multiple modules to see which has the best dc output per my location.
any help would be appreciated,
Jon
function modulePerString(mintemp)
type = getInput("pv.mod.model_type")
setInput("pv.mod.model_type",1)
oldmodules = getinput("pv.array.user_modules_per_string")
out("there were ", oldmodules , " modules per string\n")
STC = 25
tempc = (mintemp-STC)
*Voc = getInput("pv.mod.6par.voc")
*Vcoef = getInput("pv.mod.6par.bvoc")
vdcmax = 600
vocmax= (tempc*(Vcoef))+Voc
modules = (vdcmax/vocmax)
modulesint = integer(modules)
out("type :",type, "Voc:",Voc,"Vcoef: ",Vcoef,"Vocmax: ",vocmax,"\n")
setInput( "pv.array.user_modules_per_string", modulesint)
out("there are now ", modulesint , " modules per string\n")
end