1. Create LabVIEW project and add Real-Time PXI controller in the network.
2. Make sure the
NI-Industrial Communications for EtherCAT driver has been well installed in PXI RT controller.
3. In NI Max, configure the PXI controller Ethernet Adapter eth1 as "EtherCAT" Adapter mode. If you cannot find EtherCAT selection, you need to check your drivers and software environment.
4. Add your
PXI EtherCAT interface resource into your project.(In this case, Intel 82574L)
5. Import Nidec Unidrive M700 XML file (Provided by Drive Vendor, need to align with drive/EtherCAT comms module's firmware, confirm with your drive vendor) into NI LabVIEW.
Note: Do not rename the xml file, this may cause unknown error.
After successful import, LabVIEW now can detect the existed EtherCAT slave device connected to PXI controller and will automatically imported opened IO for later operation.
If you would like to revise opened IO in LabVIEW, you need to revise XML file, please ask Drive Vendor's expert to do this, otherwise not recommended to do this, refer to
Change PDO Mappings for a Third Party EtherCAT XML File6. To Look up for the
Online state and parameters of the EtherCAT slave device(the Drive), right click the Slave device in LabVIEW project and select "
Online Slave Device State".
Under normal communication, the green light of the Ethernet network port will continue to
blink, if it is steady green on it is successful connected but not established data communication.
7. Configure the EtherCAT slave device
Distributed Clock to be same with
NI Scan Engine period, in this case, 1ms is Scan Engine's period. Enable Distributed Clock and set
Shift Time as half of the Scan period.
8. Configure some
Initial commands data for the slave device, to make sure it works as expected in pre-operational states. In this case, need to configure 0x60C2, subindex 0x1 as 01, 0x2 as FD. Different hardware has different configuration requirements, ask your drive vendor for specific information.
9. Before running your VI code, switch the Scan Engine from configuration mode to
Active mode and check the
Operational state has entered in the EtherCAT slave Status.
10. Run your LabVIEW RT vi, develop code based on opened IO of the drive. (attached code as reference)
11. "
Control word" send 0110B, 0111B, 1111b in sequence to start the drive, the drive panel will display "
Run";
12. Modify the value of "
Target Position". It can be found that in Position mode, the motor shaft rotates as the value changes.
13. Refer to the EtherCAT communication documentation from the drive vendor to check the meaning of "
Status Word" IO return values, which correspond to the current Status of the drive.
14. "
Position Actual Value" comes from the return Value of the motor encoder. There will be different return Value when the Position of the shaft changes.