LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to load shared library 'EposCmd.dll' on sbRIO 9267

Hello.

 

I want to run Maxon EPOS4 driver and motors using sbRIO 9627 board. I downloaded example codes from the maxon's website. The connections of the driver and motor is done. The driver is connected to sbRIO via RS232 serial communication cable. 

 

I am running the Maxon Epos.lvproj downloaded from the site. In this project, I added sbRIO as a new target device. Then dragged one of the examples (Example_MoveWithVelocity.vi) under the sbRIO target (not under its fpga). When I ran this example, I got an error: 

"LabVIEW: Failed to load shared library EposCmd.dll:_VCS_GetErrorInfo@12:C . Ensure that the library is present on the RT target. Use either MAX to install NI software or FTP to transfer custom libraries to the RT target."

 

After getting this error, I added the EposCmd.dll file into the sbRIO using two different methods: 

1). Using Ni max and right-clicking the sbRIO, a file transfer option comes up. I opened it and added the EposCmd.dll file to /home/lvuser/natinst/bin location inside sbRIO 9627.

 

2). In this method, I used the build specification feature under the sbRIO tree in the LabVIEW project file. I tried to make a .rtexe file in the same location of sbRIO.

 

Even after using both the above solutions, I am getting the same error when running the same example code (Example_MOveWithVelocity)

 

Therefore, it would be a great help if anyone could tell me what I missed and what is the solution to resolve the error.

 

The following files are attached below:

a). screenshot of the error

b). Maxon Epos.lvproj file with all the dependencies

c). screenshot showing that the missing 'EposCmd.dll' was added inside the real-time target directory (herein, the sbRIO 9627)  

 

Thanks in Advance!!

0 Kudos
Message 1 of 26
(3,732 Views)

The sbRIO 9627 has an ARM-Cortex 9 processor and the OS is NI-Linux.

 

Your Maxon DLL (according to the Definitions.txt in your zip-file) works only on a Windows Operating Systems (x86 or x64).

 

How do you expect this DLL to work on such an sbRIO?

 

Regards, Jens

Kudos are welcome...
0 Kudos
Message 2 of 26
(3,723 Views)

Your sbRIO controller is using NI-Linux as operating system with an ARM CPU and as such a Windows DLL of course will NEVER be usable on it.

 

Your options are as follows:

 

1) use another RIO controller that uses Pharlap ETS as operating system (this is not an easy one since Pharlap ETS is considered legacy by NI and they have stopped releasing new controllers with it several years ago. Also due to runtime library differences it is highly likely that the Maxon provided DLL won't be loadable on Pharlap ETS anyways as Pharlap ETS basically emulates the Windows API as was present in Windows NT4/2000 times.)

2) Get Maxon to provide you with a compatible Linux shared library driver. (This is also not trivial as first Maxon would have to have such a library available, which they likely might not, and even if they have it is not guaranteed to run on the NI Linux kernel. Linux shared libraries can even have trouble to run on different Linux distributions without being recompiled for the system in question, which requires the source code to do so).

3) Get the serial port commands specification from Maxon to write your own driver using NI-VISA calls. (This is most likely the only feasable approach).

Rolf Kalbermatter
My Blog
0 Kudos
Message 3 of 26
(3,719 Views)

This is the Communication Guide specification for the EPOS4. Doesn't look terribly complicated but it will be still a serious work to implement such a driver, even if you don't implement all data objects.

Rolf Kalbermatter
My Blog
0 Kudos
Message 4 of 26
(3,699 Views)

Thanks for the quick response from everyone.

 

I found that the Maxon website has some library for Linux based operating system (attached below). I deployed these libraries into the sbRIO but still got the same error that the EposCmd.dll is still missing. Why is it still giving an error?

 

Now, coming to the solution that I need to make my own driver using NI VISA, I have some query. How to make these drivers? Should it be in .vi or .dll format?

0 Kudos
Message 5 of 26
(3,681 Views)

Two reasons:

 

1) In your VIs the library path in the Call Library Node is set to the full name with DLL extension. There are ways to make LabVIEW automatically look for the right extension by writing as library name the  

<library name>.*

instead of an explicit file ending. But that requires that the library name remains the same for all platforms involved and much more importantly that the library exports exactly the same function with the same function prototypes. Unless Maxon specifically took care about that, it's very very unlikely that this is the case.

 

2) Your shared library is of course compiled for a standard Linux distribution. That means for a Intel x86 or x64 CPU. Your controller uses an ARM CPU which is a completely different beast and needs a shared library that is specifically compliled for that.

 

As to writing a VISA driver yourself, you could write it in C and compile it into a DLL/shared library but that would be quite a roundabout way to go about this. First debugging such a thing is more complicated for sure. Second you end up with the same throubles about having to create different shared libraries for every possible platform.

 

Writing it fully with VIs has the advantage that you can develop and debug it on your development machine under Windows/Mac/Linux (whatever you use) and later move it to your sbRIO after it works.

Rolf Kalbermatter
My Blog
0 Kudos
Message 6 of 26
(3,674 Views)

Did you managed to solve this? I'm having exactly the same problem where I instead use a myRIO connected to the DC-motor via X-can

0 Kudos
Message 7 of 26
(2,092 Views)

The myRIO runs NI Linux RT and to make it even more special has an ARM CPU core on which the software runs!

 

So what is this X-Can software you talk about?

Why do you think it relates to the thread in question which is about Maxon Epos shared library to communicate with their hardware?

Rolf Kalbermatter
My Blog
0 Kudos
Message 8 of 26
(2,062 Views)

Maybe I should have formulated myself a little bit better. So I am trying to establish contact between myRIO and the motor which is from EPOS. The plan is to use CAN as communication network with the protocol CANopen and the CAN hardware is called X-CAN which is used for myRIO. Maybe I dont even need the drivers for the X-CAN.

 

So what I am trying to do right now is to run the example VIs from EPOS4, but I got the same error message as OP and I also think I have my problem is similar to OP, with the difference that instead of myRIO OP is using sbRIO and instead of using RS232 serial communication cable I am using a CAN interface.

0 Kudos
Message 9 of 26
(2,053 Views)

I'm not sure what X-Can is. Are you referring to NI XNet software?

CAN communication certainly will pose extra problems as even the EPOS driver from Maxon won't just run with any software. Their driver uses mainly an FTDI communication library to communicate to the drive through the integrated USB interface. This is not going to be trivial to setup on any Linux system and the myRIO (and sbRIO) are not just any standard Linux system but a little special when it comes to integrating hardware drivers.

Rolf Kalbermatter
My Blog
0 Kudos
Message 10 of 26
(2,049 Views)