Page 1
Guide Abstract This document is intended to help users get started with the HPE Edgeline EL300 daughter cards. The daughter cards described in this document are CAN bus A/B/FD2.0, RS232/422/485, 8 bit configurable GPIO, and 1GB Ethernet with Time Sensitive Network support.
Contents 2x CAN Bus A/B/FD 2.0 - Glavanically Isolated Daughter Card..4 Overview............................4 Configure the Card Using iSM...................... 4 CAN Bus Programming.........................4 Windows..........................4 Linux..........................11 2x RS232/422/485 Glavanically Isolated (up to 12 Mbps in RS 422/485) Daughter Card................ 16 Overview............................. 16 Configure the Card Using iSM....................
Daughter Card Overview HPE implemented a two channel CAN bus that communicates through a single serial port. Each channel is associated with a DE-9 (commonly referred to as "DB-9") connection on the daughter card. All communication is done through the single serial port and each channel is individually addressed through the CAN protocol.
Page 5
3. Select the Details tab. a. Under the Property drop-down menu, select Device instance path. b. If the Value contains USB_CAN_FD_APPLICATION, then use this COM port as the CAN Bus serial port. 2x CAN Bus A/B/FD 2.0 - Glavanically Isolated Daughter Card...
Page 6
C Language When using the C language in Windows, the HPE CAN bus serial port is opened and written to as a file. A program can communicate to the CAN bus serial port by opening the port as a file and then reading and writing to that port.
Page 7
Prerequisites CAN Bus COM port identified - Determine Windows COM Port Procedure 1. Open the COM port as a Windows file. char comPort[] = "COM4"; HANDLE serialPort = CreateFileA(comPort, GENERIC_READ | GENERIC_WRITE, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); 2. Clear the communication error, and then get information regarding the current status of the device. COMSTAT comStat;...
Page 8
Communicating with a Specific CAN Bus Channel Each DE-9 on the front of the HPE EL300 CAN bus daughter card represents an individual CAN bus channel. In the CAN bus commands, described in Appendix A, the channel number is represented by a byte: channel 0 (left DE-9) is 0x00 and channel 1 (right DE-9) is 0x01.
Page 9
FILE_ATTRIBUTE_NORMAL, NULL); Clear the communication port. COMSTAT comStat; DWORD errors; ClearCommError(serialPort, &errors, &comStat); Enable channel 0. From Appendix A, Enable or Disable CAN Module command is 0xFF 0x00 0xcc 0xoo, where 0xcc is the channel number and 0xoo is enable (0x01) or disable(0x00). unsigned char data[] = { 0xFF, 0x00, 0x01, 0x01 };...
Page 10
The CAN bus command to send data from a host to a device is, Send FD Data - Host to Device (command 0x05), with an 8 byte data payload of 0xDE, 0xAD, 0xBE, 0xEF. The second byte represents the write-from channel number: channel 0 for this example. char moreData[] = {0xFF,0x00,0x05,0x00,0x08,0x00,0x00,0x00,0x01,0xDE,0xAD,0xBE, 0xEF};...
Linux C Language Example When using the C language in Linux, the HPE CAN bus serial port is opened and written to as a file. The termios structure is used to set up the serial port. When using the Read SW Version command, bytes will demonstrate how to view and edit the serial port.
Page 12
The following code block explains how to view the serial port: unsigned char buffer[255]; memset(buffer, '\0', sizeof buffer); int bytesRead = 0; bytesRead = read(fd, &buffer, 255); Return codes should always be checked for errors. If there are no errors, assign the 5 and 7 bytes as the version number based on the command response described in Appendix A.
Page 13
cfmakeraw(&SerialPortSettings); //set RAW mode tcflush(fd, TCIFLUSH); //flush input tcsetattr(fd, TCSANOW, &SerialPortSettings); //set the attributes The following code block explains how to enable channel 0: char data[] = { 0xFF, 0x00, 0x01, 0x01 }; size_t bytesToWrite = 4; int wlen = write(serialPort, data, bytesToWrite); if (-1 == wlen) printf("ERROR: enabling channel 0 - error is: %d\n", errno);...
Page 14
for (index = 8; index < 13; ++index) printf("Byte[%d] is: %x\n", index, inBuffer[index]); After executing all the commands, the code to close the port is as follows: close(serialPort); Programming with Python Prerequisites In Python, serial communication is done by a serial module named pyserial. To accomplish this, download the pyserial installer from the web and use the installer.
Page 15
Procedure 1. Read 7 bytes from the port. for index in range(7): for byte in ser.read(): mybyte = "%02X" % byte line.append(mybyte.lower()) 2. Pull out the major and minor versions, and then print. major = int(''.join(line[3:5]),16) minor = int(''.join(line[5:7]),16) version = "%s.%s" % (major,minor) print("Version is %s"...
2x RS232/422/485 Glavanically Isolated (up to 12 Mbps in RS 422/485) Daughter Card Overview This section describes how to use the serial daughter card using code examples. It also describes the basic MODBUS RTU functionality over serial and leverages Libmobus, a common Open Source Library, to help in understanding the fundamental methods.
Software Example This section describes how the MODBUS communicates using the Libmodus open source library from http://libmodbus.org. As this example is done on Centos 7.5, a few changes could be made to this example to make it work on other platforms like GNU or Linux. Getting the Tools Download and install the necessary packages required for compiling the example and Libmodbus.
Page 18
4. Use the prefix option on the configure command to change the installation directory: ./configure --prefix-/usr/local/ 5. Verify the installation with example MODBUS traffic. To verify the installation, loopback the interfaces with a NULLMODEM serial cable. The following expects to separate terminals. On Terminal 1 1.
Overview The HPE EL300 DIO daughter card adds 8 DIO ports for use. Each of the ports is isolated and thus allowed to be designated as an input or output. These DIO ports are available through a Phoenix style 12 pin connector.
Keeping the system in sync The HPE EL300 DIO daughter card is designed to not allow power from a connected device to harm the internal electronics of the system. To accomplish this, there are two different chips that must be kept in sync in order for the system to work.
4. Reset the multiplexer by changing the signal back to high on GP0 of the Microchip chip. 5. Write the byte from above to the control register of the main chip. NOTE: Any changes to the Mode on this web page MUST be accompanied by changing the configuration byte of the main chip.
Page 23
Whenever a device is opened, it should be closed. rc = Mcp2221_Close(handle); Read a register from the device The following example reads the Configuration register of a slave device using I2C and puts the results into a provided unsigned char. Assumptions: •...
Page 24
rc = Mcp2221_SetGpioValues(handle, gpioValue); Linux When using Linux, the HID API is used to interact with the Multiplexer. This code can be found on GitHub. After locating the code, perform the following functions: Open the HID device Open the device and establish a handle to allow the application to interact with the device directly. hid_device *handle = NULL;...
Page 25
Close the open device. close(file); Read the device To read the device, execute the write command to set the pointer for the read. This is an example to read the four (4) registers. unsigned char data[4]; memset(data, ‘\0’, sizeof(unsigned char) * 4); data[0] = 0x00;...
4x 1GB Ethernet with TSN Support Daughter Card Overview In this section, there are code and usage examples for the TSN daughter card. The software examples used in this section explain the basic communication functionalities over TSN and leverage the tc command from Linux's Iproute2, a common Open Source Library, to provide the underlying methods.
Enabling the OS Support To illustrate the usage of the TSN daughter card, the MQPRIO kernel module should be installed. To install the kernel module, perform the following steps: 1. Execute the following command to install the module: dnf install -y kernel-modules-extra-`uname -r` 2.
Page 28
Execute the following command to configure the network on tsn2: ssudo nmcli con add con-name mw-eth4 ifname enp12s0 type ethernet ip4 192.168.11.101/24 Execute the following command to verify the configuration: ip a show enp12s0 This is an example of the command's usage and output. [admin@tsn2 ~]$ ip a show enp12s0 9: enp12s0: <BROADCAST,MULTICAST,UP,LOWER_UP>...
Execute the following command to verify: sudo tc -g qdisc show dev enp12s0 This is an example of the above command's usage and output: [admin@tsn1 ~]$ sudo tc -g qdisc show dev enp12s0 qdisc mqprio 8001: root tc 3 map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 queues:(0:0) (1:1) (2:3) qdisc fq_codel 0: parent 8001:4 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 32Mb ecn...
Page 30
Compile tsn-talker.c on TSN2 Execute the following command to compile the example program: gcc -o tsn-talker tsn-talker.c Running the Software The RFC also includes the steps for command usage. Capture tsn-listener's MAC Address (TSN1) Execute the following command to capture the MAC Address for TSN1: ip link show enp12s0 Here is an example command usage and output.
Support and other resources Accessing Hewlett Packard Enterprise Support • For live assistance, go to the Contact Hewlett Packard Enterprise Worldwide website: http://www.hpe.com/assistance • To access documentation and support services, go to the Hewlett Packard Enterprise Support Center website: http://www.hpe.com/support/hpesc Information to collect •...
IMPORTANT: Access to some updates might require product entitlement when accessed through the Hewlett Packard Enterprise Support Center. You must have an HPE Passport set up with relevant entitlements. Customer self repair Hewlett Packard Enterprise customer self repair (CSR) programs allow you to repair your product. If a CSR part needs to be replaced, it will be shipped directly to you so that you can install it at your convenience.
Documentation Feedback (docsfeedback@hpe.com). When submitting your feedback, include the document title, part number, edition, and publication date located on the front cover of the document. For online help content, include the product name, product version, help edition, and publication date located on the legal notices page.
Page 35
Appendix A Table 1: Supported CAN Bus Commands Command Description Sample Message 0xB0 Request to Jump to Command - 0xFF 0x00 0xB0 Bootloader Application Response - 0xFF 0x00 0xB0 0x00/0x01 (Boot/User App) 0xB1 Request to Reset Device Command - 0xFF 0x00 0xB1 0xB2 Query to know Device Mode Command - 0xFF 0x00 0xB2...
Page 36
0x05 Send FD Data - Host to Command - 0xFF CH 0x05 Device Message Length - 2 bytes (Including Message ID and payload Length) Message ID - 4 bytes (0 to 0x1FFFFFFF) Data - CAN Data 0x06 CAN Status Request Command - 0xFF CH 0x06 Response - FF CH 0x06 MCAN_PSR - 4 bytes (Register content)
Need help?
Do you have a question about the Edgeline EL300 and is the answer not in the manual?
Questions and answers