Document toolboxDocument toolbox

DF PROFI II | Getting Started - Linux Driver Example

This instruction shows how to load the Profibus driver in Linux.

To use this Getting Started it is requiered to have the following data:

  • Kunbus CD or current Kunbus.iso file

  • Profibus driver

    • if not delivered with the hardware, please contact support@kunbus.com

  • (opt.) patch for 64-Bit OS

    • please contact support@kunbus.com

Instructions

At first we will load the driver to kernel and then compile and run the example application. This introduction is compatible with 32 Bit and 64 Bit operating systems.

  1. Download the current driver via the link requested from support@kunbus.com.

  2. Extract the package df_profi_II_linux_kmod to your preferred direction.

  3. Open a terminal and navigate to the extracted file.

  4. Compile the driver to your current Kernel by running make.

  5. Load the driver to kernel → sudo insmod dfprpci.ko.

  6. Mount Kunbus.iso to your pc.

  7. Extract the file Kunbus.iso/DF_PROFI_II/Linux/dfpr_II_pci.rpm to your preferred location.

  8. Navigate to the extracted package.

  9. Run the script DFPROFI_II-PCI-INSTALL.sh → sudo bash ./DFPROFI_II-PCI-INSTALL.sh.

    1. The Board should be detected like shown in this screenshot.

    2. In case the driver will not start by the script, close the script with CTRL+C.

      1. Start the driver manually.

        1. Navigate to /etc/init.d/ and run sudo ./DFPROFI_II start.

        2. Now you should find a file named “dfpr” located in /dev/.

    3. In case the driver denied with “invalid major device number”

      1. please go back to step 4

  10. Now the Profibus board should be shown in the response of dmesg (in bolt letters) with the MAJOR-No. displayed in the last line of the previous step.

  11. In case of using an 64 Bit OS, get the folders loados_x64 and load_x64. Else continue with next step.

    1. opt. delete or rename existing executables in loados_x64 and load_x64.

    2. Compile the code by running the makefiles in both folders.

    3. Make the compiled outputfiles executable by typing for example chmod +x loados in your terminal

    4. Copy the executables loados and load out of this path to your extracted package path. Place it there in /<extracted package>/usr/local/dfprpci/ and replace the existing ones.

  12. Navigate to /<extracted package>/usr/local/dfprpci/C_Sample_Program/ and compile the example by running the makefile.

  13. Run the example in your terminal with ./DFProfi_2_PCI_DEMO.

    1. Initialize the board by typing I.

    2. Now the os dependencies should be load within “loados”.

    3. The application “load” loads the driver packages to the example application.

    4. A successfull initialization will shown as I Initialize hardware : OK! in our application.

How to configure the board in Linux via Windows:

  1. Plug in the board in a Windows PC.

  2. Install and open Confiugrator III in Windows.

  3. Create a new configuration regarding to your controller device hardware setup.

  4. Download the configuration to your board like explained in GettingStarted_DF_PFOFI_II_Linux.pdf included in our driver CD.

  5. Move the board to Linux and run the Linux Driver Example. It will stay configured with the downloaded setup.

Compatibility

Of course, the driver is not checked for every single new kernel version. That would be very time-consuming and is disproportionate for basic accesses. However, it was tested for kernel versions:

  • 3.xx,

  • 4.16.xx

  • 5.4.x.

Related Articles

Filter by label

There are no items with the selected labels at this time.