I am looking for an advise what I am doing wrong in the c-script code in terms of transforming currents from abc to alfabeta and alfabeta to dq. The file with relevant code is attached.
The Multiplexer block is flipped such that the signal order in the C-Script doesn’t align with the inputs (i.e. currents in indices 4-6 in signal vs 1-3 in C-Script).
You never assign A.alphabeta and so alpha_out and beta_out are always zero. Lines 12-13 in your Update function code were pointing to the dq variables instead of the alphabeta variables.
You also are inserting an extra one model step delay in your alpha-beta calculations. See the “Eliminate One Cycle Delay” section of the C-Script tutorial for additional information.