How CANopen Master Accesses Modbus Device Data

PXB-6021 is a Modbus to CANopen protocol converter launched by ZLG Zhiyuan Electronics, featuring 1 CAN channel, 1 100M Ethernet, and 1 RS485. This product supports Modbus RTU and Modbus TCP, enabling data conversion from Modbus master to CANopen slave. The PXB-6021 supports up to 12 groups of TPDO and 12 groups of RPDO, and supports EDS distribution as well as custom PDO and Modbus data mapping; it is characterized by fast conversion, simple setup, and flexible use.
Next, we will use the USBCAN-E-P CANopen master card and the PXB-6021 protocol converter to achieve data retrieval from Modbus devices by the CANopen master.
How CANopen Master Accesses Modbus Device Data Preparation Conditions
  • USBCAN-E-P CANopen master card and upper computer software CANManager for CANopen;

  • PXB-6021 converter and upper computer configuration software AWPX Tools;

  • RS485 temperature and humidity transmitter;

  • 24V power adapter;

  • 6 Dupont wires, 1 USB cable, 1 network cable, and 1 terminal resistor of 120 ohms.

How CANopen Master Accesses Modbus Device Data Hardware Wiring

The device wiring is shown in Figure 1:

How CANopen Master Accesses Modbus Device Data

Figure 1 Device Connection Diagram
  • PC connects to PXB-6021 via network cable and to USBCAN-E-P CANopen master card via USB cable;

  • CAN_H and CAN_L of the CAN bus of PXB-6021 connect to CAN_H and CAN_L of USBCAN-E-P CANopen master card respectively;

  • RS485 A and B of PXB-6021 connect to A and B terminals of Modbus temperature and humidity transmitter.

How CANopen Master Accesses Modbus Device Data PXB-6021 Parameter Configuration

Open the AWPX Tools tool, click to search for devices, and then select the PXB-6021 device.

According to the temperature and humidity sensor’s manual, the baud rate of the temperature and humidity transmitter is 9600, data length is 8, parity is 0, stop bit is 1. Configure the Modbus parameters of PXB-6021 as shown in Figure 2:

How CANopen Master Accesses Modbus Device Data

Figure 2 Set Modbus Parameters

Next, configure the PXB-6021 CANopen parameters as shown in Figure 3.

How CANopen Master Accesses Modbus Device Data

Figure 3 Set CANopen Parameters

According to the introduction of the temperature and humidity transmitter, the temperature data is in holding register address 0, and the humidity data is in address 1, both data are scaled by a factor of 10. We also need to configure the TPDO parameters of PXB-6021 and the mapping relationship between Modbus and TPDO, as shown in Figure 4.

How CANopen Master Accesses Modbus Device Data

Figure 4 TPDO Configuration

How CANopen Master Accesses Modbus Device Data CANopen Master Settings

USBCAN-E-P CANopen master card loads the slave EDS, as shown in Figure 5.

How CANopen Master Accesses Modbus Device Data

Figure 5 Import EDS

Then click the search button in the CANManager for CANopen software to search for the slave, as shown in Figure 6.

How CANopen Master Accesses Modbus Device Data

Figure 6 Search for Slave

Find the slave, as shown in Figure 7.

How CANopen Master Accesses Modbus Device Data

Figure 7 Found Slave

How CANopen Master Accesses Modbus Device Data Modbus Data Retrieval

Click the start button to collect data from the slave, as shown in Figure 8.

How CANopen Master Accesses Modbus Device Data

Figure 8 Collecting Data
From the figure, we can see:
  • The temperature is 0x118, converting to decimal gives 280. Since the parameter is scaled by a factor of 10, the current temperature is 28 degrees;
  • The humidity is0x294, converting todecimal gives660. Since the parameter is scaled by a factor of 10, the current humidity is 66.

For more articles, please click “ Read the Original ”.

How CANopen Master Accesses Modbus Device Data

How CANopen Master Accesses Modbus Device Data

How CANopen Master Accesses Modbus Device Data
How CANopen Master Accesses Modbus Device Data
How CANopen Master Accesses Modbus Device Data
How CANopen Master Accesses Modbus Device Data
How CANopen Master Accesses Modbus Device Data

Leave a Comment