> But in codegen mode, it appears three error as attachment.
I cannot see your model, but our previous discussion on PV Models is likely relevant. You either need to break the algebraic loop ensuring the inputs to your PV model are not directly influenced by the output (e.g. are states like capacitor voltage or inductor current), or you can break the loop with a low pass filter or discrete delay. Do not use a Memory block (see the component help for a description as to why this is not advisable).
> It seems like "from file" can not be used in codegen mode, then which method can I adopt to solve those problem, and can be work in codegen mode.
You can process the CSV data into look-up tables. See this forum post describing the technique. The difference is that the file is read only at the start of the simulation / code generation process during model initialization. The "DC Microgrid" C2000 model uses a similar technique, but encodes the data as a vector in the model initialization commands.
Note that rather than using the "Clock" block you'll want to use an integrator with rollover to prevent issues as the time approaches infinity. Again, look in the "DC Microgrid" demo model at the "Time Generator" subsystem in the "DC Power Grid" part of the model.