Hi !
I am trying to use an LK script code to exchange data between excel and SAM (the idea is to pre-size my PV system with excel, export the main outputs data to SAM and use the simulation to asses my system.
I have issue on importing the load profile on SAM. I want to import the load hour by hour, for each hour of the year, in the Energy Usage data.
For that, I created the following loop which seems to be okay when I simulates :
for( i=5; i<8766; i++) {
index='L'+i;
Energy_usage[i-5]= xl_get(xl,index);
outln(index);
}
L is the letter where the load are on excel, going from 5 to 8766
Energy_usage is how I named the data I want to extract from excel.
But after, I tried to link this Energy_usage to the load_user_data with this :
set('load_user_data',Energy_usage);
But the following error message appears :
"equation engine: [62]: reference to unassigned variable: count\
equation engine: [62]: failed to evaluate function call argument 1 to 'msgbox()'\
fail: [load,load_annual_total,annual_peak,energy_1,peak_1,energy_2,peak_2,energy_3,peak_3,energy_4,peak_4,energy_5,peak_5,energy_6,peak_6,energy_7,peak_7,energy_8,peak_8,energy_9,peak_9,energy_10,peak_10,energy_11,peak_11,energy_12,peak_12] = f( load_model,load_user_data,normalize_to_utility_bill,utility_bill_data,scale_factor )
no variables calculated in a single iteration, cannot make progress!
eqn not evaluated: [load,load_annual_total,annual_peak,energy_1,peak_1,energy_2,peak_2,energy_3,peak_3,energy_4,peak_4,energy_5,peak_5,energy_6,peak_6,energy_7,peak_7,energy_8,peak_8,energy_9,peak_9,energy_10,peak_10,energy_11,peak_11,energy_12,peak_12] = f( load_model,load_user_data,normalize_to_utility_bill,utility_bill_data,scale_factor)"
I understood that load_user_data is an array type of variable, so I tried to do the same for Energy_usage, but I really do not see how to move forward,
if someone have a clue on that, it would really help me !
Thanks,
Clara