- Download the GSDML file from the manufacturer and install it in the project.
- Integrate the hardware into the project (catalog > Other field devices > PROFINET IO > General > E-T-A > CPC12PN-T1).
- Add the submodules (e.g., 4x double channels when 4 REX22D fuses are being used).
- Connect the device to the PROFINET IO network, and assign it an IP address and Profinet name.
- Note that two ports are dedicated to the PROFINET IO network (XF1/XF2) and one port is dedicated to the webserver connection (X1).
- Assign XF1/XF2 IP and Profinet name using Proneta. It may be initially set to 0.0.0.0.
- Assign the IO addresses to each slot.
// Read data from CPC12
"PowerMeter_WriteData".StatusProfinet := "StatusProfinet";
"PowerMeter_WriteData".TotalCurrent := UINT_TO_REAL(SWAP("TotalCurrent")) / 100.0;
"PowerMeter_WriteData".StatusChannel1 := "StatusChannel1";
"PowerMeter_WriteData".LoadCurrentChannel1 := UINT_TO_REAL(SWAP("LoadCurrentChannel1")) / 100.0;
"PowerMeter_WriteData".LoadVoltageChannel1 := UINT_TO_REAL(SWAP("LoadVoltageChannel1")) / 100.0;
// Write data to CPC12
// on/off fuse switch
"ControlChannel3".%X0 := NOT "PowerMeter_ReadData".OnOffSwitch;
// reset fuse
"ControlChannel1".%X1 := "PowerMeter_ReadData".Reset;
Notes:
- The current/voltage readings must be byte swapped.
- In order to control (on/off) the fuses from the PLC, they must be unlocked from the webserver (192.168.1.1, admin/admin).




No comments:
Post a Comment