Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Version published after converting to the new editor

Table of Contents

...

Code Block
languagebash
themeDJango
pi@raspberrypi:~/V2.1.1.0/V2.1.1.0/driver/libcifx/build $ make all
pi@raspberrypi:~/V2.1.1.0/V2.1.1.0/driver/libcifx/build $ make install


Create the necessary links and cache to the most recent shared libraries found.

Code Block
languagebash
themeDJango
$ sudo ldconfig 

...

Code Block
languagebash
themeFadeToGrey
collapsetrue
pi@raspberrypi:~/V2.1.1.0/V2.1.1.0/examples/build $ sudo ./cifxsample
---------- Display Driver Version ----------
Driver Version: LinuxCIFXDrv V2.1.0.0, based on cifX Toolkit 2.6.0.0 

 State = 0x00000000
----------------------------------------------------
---------- Board/Channel enumeration demo ----------
Found Board cifX0
 DeviceNumber : 7833000
 SerialNumber : 20000
 Board ID     : 0
 System Error : 0x00000000
 Channels     : 2
 DPM Size     : 65536
 - Channel 0:
    Firmware : PROFINET IO Device
    Version  : 5.4.0 build 0
    Date     : 10/18/2021
  Device Nr. : 7833000
  Serial Nr. : 20000
  netX Flags : 0x00000038
  Host Flags : 0x00000038
  Host COS   : 0x00000000
  Device COS : 0x00000001
 - Channel 1:
    Firmware : Network Services
    Version  : 1.0.0 build 0
    Date     : 10/18/2021
  Device Nr. : 7833000
  Serial Nr. : 20000
  netX Flags : 0x00000038
  Host Flags : 0x00000038
  Host COS   : 0x00000000
  Device COS : 0x00000001
 State = 0x00000000
----------------------------------------------------
---------- System Device handling demo ----------
System Channel Info Block:
==========================
DPM Cookie       : netX
DPM Size         : 32768
Device Number    : 7833000
Serial Number    : 20000
HW Options       : 0x0080 0x0080 0x0000 0x0000
Manufacturer     : 1
Production Date  : 4395
Device Class     : 60
HW Revision      : 3
HW Compatibility : 0
License Flags 1  : 0x00000000
License Flags 2  : 0x00000003
LicenseID        : 0x0000
LicenseFlags     : 0x0000
==========================
System Information:
===================
System Error     : 0x00000000
DPM Size         : 32768
Mailbox size     : 124
Device Number    : 7833000
Serial Number    : 20000
Open Count       : 1
===================
System Control Block:
=====================
Command COS      : 0x00000000
System Control   : 0x00000000
=====================
Waiting 2s to let cifX card calculate CPU load!
System Status Block:
====================
System COS       : 0x00000000
System Status    : 0x22000001
System Error     : 0x00000000
Time since start : 20899
CPU Load [%]     : 4.00
====================

Trying to read Security Eeprom:
===============================
System Mailbox State: MaxSend = 16, Pending Receive = 0
Send Packet (Read Crypto Flash Zone 1):
Dest   : 0x00000000      ID   : 0x00000000
Src    : 0x00000000      Sta  : 0x00000000
DestID : 0x00000000      Cmd  : 0x00001EBC
SrcID  : 0x00000000      Ext  : 0x00000000
Len    : 0x00000004      Rout : 0x00000000
Data:
01 00 00 00 
System Mailbox State: MaxSend = 16, Pending Receive = 1
Received Packet (Read Crypto Flash Zone 1):
Dest   : 0x00000000      ID   : 0x00000000
Src    : 0x00000000      Sta  : 0xC0000004
DestID : 0x00000000      Cmd  : 0x00001EBD
SrcID  : 0x00000000      Ext  : 0x00000000
Len    : 0x00000000      Rout : 0x00000000
Data:
System Mailbox State: MaxSend = 16, Pending Receive = 0
===============================

 State = 0x00000000
----------------------------------------------------
---------- Communication Channel demo ----------
Communication Channel Info:
Device Number    : 7833000
Serial Number    : 20000
Firmware         : PROFINET IO Device
FW Version       : 5.4.0 build 0
FW Date          : 10/18/2021
Mailbox Size     : 1596

Start put/get packet Demo!
Channel Mailbox State: MaxSend = 1, Pending Receive = 0
Send Packet:
Dest   : 0x00000000      ID   : 0x00000000
Src    : 0x00000000      Sta  : 0x00000000
DestID : 0x00000000      Cmd  : 0x00000000
SrcID  : 0x00000000      Ext  : 0x00000000
Len    : 0x00000000      Rout : 0x00000000
Data:
Received Packet:
Dest   : 0x00000000      ID   : 0x00000000
Src    : 0x00000000      Sta  : 0xC0000004
DestID : 0x00000000      Cmd  : 0x00000001
SrcID  : 0x00000000      Ext  : 0x00000000
Len    : 0x00000000      Rout : 0x00000000
Data:

Start read/write IO-Data!
Error setting Bus state lRet = 0x800C0012!

--- Read / Write Block Information ---
Read CONTROL Block 

00 00 00 00 
Write CONTROL Block 
Read COMMON Status Block 

01 00 00 00 
Write COMMON Status Block 
Error writing to common status block. lRet = 0x800A0006
Read EXTENDED Status Block 

00 00 00 00 
Write EXTENDED Status Block 
Error writing to extended status block. lRet = 0x800A0006

--- Event handling demo ---
Sync-handshake mode: 0x02 (host controlled)

Error: 0x800A001A, <Interrupt is disabled>

--- Set Bus / Host State Demo ---
Set CIFX_HOST_STATE_READY!
CIFX_HOST_STATE_READ, state 1 !
Error CIFX_BUS_STATE_ON, state 0, error 0x800C0012 !
CIFX_BUS_STATE_OFF, state 0 !
Set CIFX_HOST_STATE_NOT_READY!
CIFX_HOST_STATE_READ, state 0 !
 State = 0x00000000
----------------------------------------------------
pi@raspberrypi:~/V2.1.1.0/V2.1.1.0/examples/build $

...

If you do not want to compile the examples. You can run our python script to verify if the driver and the device work.

Download pycifx here.

Extract the sources from the zip-file and go in to pycifx folder.

...

Code Block
languagebash
themeFadeToGrey
collapsetrue
pi@raspberrypi:~/pycifx $ sudo python3 main.py
---------- Display Driver Version ----------
Driver Version: LinuxCIFXDrv V2.1.0.0, based on cifX Toolkit 2.6.0.0 


---------- Board/Channel enumeration demo ----------

Found Board cifX0
 Alias        : 
 DeviceNumber : 7833000
 SerialNumber : 20000
 Board ID     : 0
 System Error : 0
 Channels     : 2
 DPM Size     : 65536
 - Channel 0
   Firmware : PROFINET IO Device
   Version  : 5.4.0 build 0
   Date     : 10/18/2021
  Device Nr. : 7833000
  Serial Nr. : 20000
  netX Flags : 0x00000038
  Host Flags : 0x00000038
  Host COS   : 0x00000001
  Device COS : 0x00000001

 - Channel 1
   Firmware : Network Services
   Version  : 1.0.0 build 0
   Date     : 10/18/2021
  Device Nr. : 7833000
  Serial Nr. : 20000
  netX Flags : 0x00000038
  Host Flags : 0x00000038
  Host COS   : 0x00000000
  Device COS : 0x00000001

----------------------------------------------------
---------- System Device handling demo ----------
System Channel Info Block:
==========================
DPM Cookie          : netX
DPM Size            : 32768
Device Number       : 7833000
Serial Number       : 20000
Manufacturer        : 1
Production Date     : 4395
Device Class        : 60
HW Revision         : 3
HW Compatibility    : 0
License Flags 1     : 0x00000000
License Flags 2     : 0x00000003
LicenseID           : 0x0000
LicenseFlags        : 0x0000
==========================
System information:
===================
System Error        : 0x00000000
DPM Size            : 32768
Mailbox size        : 124
Device Number       : 7833000
Serial Number       : 20000
Open Count          : 1
===================
System Control Block:
=====================
Command COS        : 0x00000000
System Control     : 0x00000000
=====================
Waiting 2s to let cifX card calculate CPU load!

System Status Block:
====================
System COS         : 0x00000000
System Status      : 0x22000001
System Error       : 0x00000000
Time since start   : 21921
CPU Load [%]       : 4.00
====================
System Mailbox State: MaxSend = 16, Pending Receive = 0
Send Packet:
Dest    : 0x00000000    ID   : 0x00000000
Src     : 0x00000000    Sta  : 0x00000000
DestID  : 0x00000000    Cmd  : 0x00000000
SrcID   : 0x00000000    Ext  : 0x00000000
Len     : 0x00000000    Rout : 0x00000000
Data:

System Mailbox State: MaxSend = 16, Pending Receive = 1

Received Packet:
Dest    : 0x00000000    ID   : 0x00000000
Src     : 0x00000000    Sta  : 0xC0000004
DestID  : 0x00000000    Cmd  : 0x00000001
SrcID   : 0x00000000    Ext  : 0x00000000
Len     : 0x00000000    Rout : 0x00000000
Data:

System Mailbox State: MaxSend = 16, Pending Receive = 0

 State = 0x00000000 -> 
----------------------------------------------------
Communication Channel Info:
===========================
Device Number   : 7833000
Serial Number   : 20000
Firmware        : PROFINET IO Device
FW Version      : 5.4.0 build 0
===========================
Mailbox Size    : 1596

Start put/get packet Demo!
Send Packet:
Dest    : 0x00000000    ID   : 0x00000000
Src     : 0x00000000    Sta  : 0x00000000
DestID  : 0x00000000    Cmd  : 0x00000000
SrcID   : 0x00000000    Ext  : 0x00000000
Len     : 0x00000000    Rout : 0x00000000
Data:


Receive Packet:
Dest    : 0x00000000    ID   : 0x00000000
Src     : 0x00000000    Sta  : 0xC0000004
DestID  : 0x00000000    Cmd  : 0x00000001
SrcID   : 0x00000000    Ext  : 0x00000000
Len     : 0x00000000    Rout : 0x00000000
Data:

IO Demo running <Strg + c> to stop:

Error reading IO Data area!

 State = 0x800c0012 -> Device not running (running flag failed)
----------------------------------------------------

--- Read / Write Block Information ---
Read CONTROL Block
01 00 00 00 

Write CONTROL Block

Read COMMON Status Block
01 00 00 00 

Write COMMON Status Block

Error writing to common status block 
 State = 0x800a0006 -> Invalid command

Read EXTENDED Status Block
00 00 00 00 

Write EXTENDED Status Block

Error writing to extended status block. 
 State = 0x800a0006 -> Invalid command
----------------------------------------------------
pi@raspberrypi:~/pycifx $

...