Other Parts Discussed in Thread: C2000WARE
Hi,
I'm trying to control an Induction motor model through IPC registers. What I have done so far is, I have generated a v/f voltage in CPU1 and an Induction Machine Model in CPU2. I'm trying to transfer my voltage from CPU1 to CPU2 through IPC SENDDATA, SENDADDR,SENDCOM to the other CPU. Here is the code for both the cores.
CPU1 (v/f)
IpcRegs.IPCSENDDATA = (float32) Va; // Write the result to the IPC data register
IpcRegs.IPCSENDADDR = (float32) Vb;
IpcRegs.IPCSENDCOM = (float32) Vc;
IpcRegs.IPCSET.bit.IPC4 = 1; // Set the IPC4 flag for CPU2
CPU2(IM Model)
//--- Read the 3-Phase voltages from IPC4
v_a = (float32) IpcRegs.IPCRECVDATA;
v_b = (float32) IpcRegs.IPCRECVADDR;
v_c = (float32) IpcRegs.IPCRECVCOM;
//--- Manage the IPC registers
IpcRegs.IPCACK.bit.IPC4 = 1; // Clear IPC4 flag
The issue is none of the registers (SEND registers in CPU1 and RECV registers in CPU2) are updating. All are showing zero. One more issue is, even though I have given the type as float32, it is showing unsigned long in watch window. I have confusions in setting the master for the message RAM and GS RAM. Can anyone please help me to resolve these problems?
Thanks and regards