LBC Profibus Testing on new CMU

We ordered a PCI express version of the profibus board:
Item: DRL-DPM-PCIE
Molex Part N\xBA 1120115028

The card came with a CD which includes the Windows configuration tool and GSD files

We downloaded the Linux driver from http://www.molex.com/molex/mysst/doCenter.action (search on Linux )

Driver

What do we use of the applicom API for profibus?

    rc = IO_Init( sBoard, &Status );
    rc = IO_Exit( BHandle[sBoardHandle]->sBoard, &Status );
    rc = IO_RefreshInput( sBoard, &Status );
    rc = IO_GetEquipmentStatus( sBoard, sEquip, &sEquipmentStatus, &Status );
    rc = IO_ReadIDWord( sBoard, sEquip, 0, 1, &Value, &Status );

[ksummers@rm580f-1 libs]$ ar t libappio.a
adksys.o
u_libsys.o
apcpyio.o
appio.o
memio.o
mutexio.o

In the Linux 2.6 stuff I downloaded, there is a directory Linux 2.6/Linux 2.6/sovio3.0.0/aplib/os_linux/application there are three .a files here:

 apaccdrvio.a  appio.a  applicomio.a 

The appio.a applicomio.a have loads of methods and differ only by appio.a having the following extra methods:
  > apcpyio.o
  > appio.o
  > memio.o
  > mutexio.o
  > vxwmem.o

The apaccdrvio.a file has only two objects:
[ksummers@rm580f-1 application]$ ar t apaccdrvio.a
adksys.o
u_libsys.o 
[ksummers@rm580f-1 sovio3.0.0]$ find . -name \*.a -exec ls -al {} \;
-rw-rw-rw-. 1 ksummers domain users 1457836 Jun  4  2010 ./aplibusr/os_linux/io/applicomio.a
-rw-rw-rw-. 1 ksummers domain users 1531070 Jun  2  2010 ./appio/os_linux/appio.a
-rw-rw-rw-. 1 ksummers domain users 1531070 Jun  2  2010 ./aplib/os_linux/application/appio.a
-rw-rw-rw-. 1 ksummers domain users 1457836 Jun  4  2010 ./aplib/os_linux/application/applicomio.a
-rw-rw-rw-. 1 ksummers domain users 27508 Jun  2  2010 ./aplib/os_linux/application/apaccdrvio.a

There are two makefiles:

  ./applicatif/itemdllio/dvwaibrw/os_linux/io/Makefile makes tagLibrary
  ./apdriver/os_linux/io/Makefile makes applicom.ko 

Had to change permissions on all the mk_* files since they were not executable after unzip

I used top-level script mk_all_io

And then also I went down to sovio3.0.0/applicatif/utilansi/ClearAccess/os_linux and did the mk_clearaccessio

Building on Test CMU

Unpacked the Linux 2.6 stuff on the rm580h-1 machine (our test CMU).

With the top-level script, I didn't get the driver module (daemon) that has to be installed. The top-level script has a bug:
  echo '| Building driver layer                                         |'
  cd apdriver/os_linux/io
  ./mk_drv_io
  cd ../../.. 

But, there's no script in the apdriver directory called mk_drv_io, but there is a Makefile

However, the Makefile failed because I unpacked the tar and it had spaces in the name ("Linux 2.6") of two directories. When I changed the directory names, the make worked and I got the applicomio.ko file referenced in the applicomIO Linux solution 3.0.0 document to install.
I copied the built library: appio.a to the LBC source area to build with as libappio.a

Had to create a script to put into /etc/rc3.d to start the daemon on startup. Copied from the current CMU.

System Setup

Couldn't get the dual-boot setup, but DF did get a USB hard disk set up with bootable Windows.
to boot in Windows:
  1. attach USB drive to machine
  2. F12 during boot sequence
  3. select USB for boot device
  4. sometimes had to hit F1 to try again

Windows username is user, password is lbt1234567890

Linux system has root with Tucson standard password and lbccontrol account

Set up for CMU IP address, but static on the mountain didn't work, had to change the /etc/sysconfig/network-scripts/ifcfg-eth0 file
BOOTPROTO="dhcp"   to    BOOTPROTO="static"  

Board Configuration

28-February-2014 On the mountain with rm580h-1 machine as the new CMU machine.

Turned off the current CMU and booted this machine in Windows with CMU address.

Brought up the Console application to configure the board.

Applicomio.png


It found the board automatically.

Andrea's notes say "add to the lower-left panel the GSD encoders definitions". But, we did not have a Heidenhain GSD file anywhere -- not on the current applicom CD or in the downloaded driver code. Looked on the Heidenhain site and did not find any references to GSD files for our encoders. Booted the old CMU in Windows mode ( note that the Administrator password is not set! ) and found a board configuration listing. I found what I thought was the associated GSD file there based on the "JH" devices in the configuration -- named JHDPA401.GSD .

I added this to the "Equipment Library" :

AddGSD.png

And then did the "Network Detection" like noted in http://lbccontrol/devices/Applicom_PCI-DPIO/configuration.shtml

I got a pop-up on each device however, when I tried to add them to the current configuration, because the GSD file has a duplicate:

Error.png


But, I continued on, downloaded to the board, and saved the configuration as LBC

Running testprofibus on Linux System

Rebooted the machine into Linux, had to set the IP to static to get into it.

Ran the testprofibus program. The first time, in the log I saw:
2014/02/28 20:00:05.072707 < Log Service: session started >
2014/02/28 20:00:05.077853 < Log Service: RPC server started >
2014/02/28 20:00:05.087160 N B PROFIBUS ENCODER1 Profibus library initialized
2014/02/28 20:00:05.087193 N B PROFIBUS ENCODER1 Profibus board 1 device 10: initialization start...
2014/02/28 20:00:05.090270 N B PROFIBUS ENCODER1 Profibus board 1 device 10: board initialization error 93 (applicom driver not accessible)

Because the module/daemon was not starting on startup. I did the insmod again (see notes in the applicom PDF file) and saw it running.

But, the board was already up? I ran it again and got this:

2014/02/28 20:01:46.194538 < Log Service: session started >
2014/02/28 20:01:46.194651 < Log Service: RPC server started >
2014/02/28 20:01:46.195668 N B PROFIBUS ENCODER1 Profibus library initialized
2014/02/28 20:01:46.195698 N B PROFIBUS ENCODER1 Profibus board 1 device 10: initialization start...
2014/02/28 20:01:46.195750 N B PROFIBUS ENCODER1 Profibus board 1 device 10: board initialization error 99 (board already initialized)

So, I ran the clearaccessio command and ran again. ... Success! It read the encoders:

ProfiBus Blue Encoder1 Initialization ...
ProfiBus Blue Encoder2 Initialization ...
ProfiBus Blue Encoder3 Initialization ...
ProfiBus Red Encoder1 Initialization ...
ProfiBus Red Encoder2 Initialization ...
ProfiBus Red Encoder3 Initialization ...
Reading 3 red and 3 blue encoders 30 times ...
1393617864 --> 33544718 33543889 5795498 33542126 33543659 8674431
1393617873 --> 33544718 33543889 5795498 33542126 33543659 8674431
1393617883 --> 33544718 33543889 5795498 33542126 33543659 8674431
1393617884 --> 33544718 33543889 5795498 33542126 33543659 8674431
ProfiBus Blue Encoder1 Uninitialization ...
ProfiBus Blue Encoder2 Uninitialization ...
ProfiBus Blue Encoder3 Uninitialization ...
ProfiBus Red Encoder1 Uninitialization ...
ProfiBus Red Encoder2 Uninitialization ...
ProfiBus Red Encoder3 Uninitialization ...
Closing Log Service ...

Are mutexes hanging around? Or do we always see about 25 when cleaning up?

[root@cmu profibus]# clearaccessio appio

 applicom========== 
 =====international 
 +---------------------------------------------------+ 
 |  clear access V3.7.1                              |
 +---------------------------------------------------+ 

 Delete all mutex of appio result:
Mutex 1812 of board 1 delete
Mutex 1707 of board 1 delete
Mutex 1708 of board 1 delete
Mutex 1709 of board 1 delete
Mutex 1710 of board 1 delete
Mutex 1711 of board 1 delete
Mutex 1712 of board 1 delete
Mutex 1713 of board 1 delete
Mutex 1714 of board 1 delete
Mutex 1715 of board 1 delete
Mutex 1716 of board 1 delete
Mutex 1717 of board 1 delete
Mutex 1718 of board 1 delete
Mutex 1719 of board 1 delete
Mutex 1720 of board 1 delete
Mutex 1721 of board 1 delete
Mutex 1722 of board 1 delete
Mutex 1723 of board 1 delete
Mutex 1724 of board 1 delete
Mutex 1725 of board 1 delete
Mutex 1726 of board 1 delete
Mutex 1727 of board 1 delete
Mutex 1728 of board 1 delete

Delete all mutex OK.
I Attachment Action Size Date Who Comment
AddGSD.pngpng AddGSD.png manage 32 K 04 Mar 2014 - 21:09 UnknownUser GSD files in console
Applicomio.pngpng Applicomio.png manage 25 K 04 Mar 2014 - 20:51 UnknownUser Applicom IO console
Error.pngpng Error.png manage 34 K 04 Mar 2014 - 21:13 UnknownUser Configuration error
LinuxIO_sov3.0.0.pdfpdf LinuxIO_sov3.0.0.pdf manage 43 K 04 Mar 2014 - 20:41 UnknownUser applicomIO Linux solution 3.0.0
configuration_board1_channel0.lstlst configuration_board1_channel0.lst manage 10 K 04 Mar 2014 - 21:04 UnknownUser Board configuration listing from old CMU
Topic revision: r2 - 26 Aug 2014, KelleeSummers
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback