CompactCom: How to R&W via PROFIBUS and KUNBUS

Hello.

I just got a CompactCom 40 Starterkit with a M40 PROFIBUS, but I’m having trouble conncetng via PROFIBUS to a KUNBUS board in a NI PXIe.

I compiled the example code and everything works fine, but I’m not sure where to go from there. How can I see that Data is being exchanged in the network?

Thanks in advance

Hello @German,

Can you elaborate on your setup and what you are trying to accomplish? I am not familiar with a KUNBUS board in a NI PXIe. Is this a Profibus master?
Once the Starterkit application is running you can interact with the device over the bus. The Master is going to give you info on the device and its state. You can see some info on the state of the device in the console window, though this is primarily focused on communication between the host and the M40. You can enable some more debugging in abcc_drv_cfg.h. You of course can update the application to print other things to the console.

Deryck

Hello Deryck, thank you so much for your reply.

What I’m trying to accomplish is to communicate with a Profubus master KUNBUS PCI and the M40.
On the console window I just see that the M40 is in the WAIT_PROCESS state, but I’m not sue how to exchange data with the Master, or where to go from there, and read it on the host application (is it in the same console terminal). Also, how could I codify the code to send data to the Master, assuming the netwrk configuration is correct.

Please find attached my KUNBUS setup. How can I verify in the host application that im receiving something at the ADI 106?

German

Hi @German,

The host applications doesn’t have anything implemented on the host side to verify what data is on the device. The IO connection with the profinet master should be enough to verify the data is exchanged.

You might need to put your master in to a run state to start exchanging data. I would expect that software to allow you to go online and then offer an monitor/modify option. It should also give you diagnostic feed back if you have issues with the connection giving you error data.

Deryck

Thanks again Deryck,

Is there an example code on how I can send something to the ADI 100 for example? Do I have to add that on main.c? Just to see if theyre communication correctly.

Also, how can I set the slave number of the Compactcom from the application? as I couldnt find it in the documentation. I think thats the reason the PCI doesnt recognize the module.

There are a few different ADI mappings that can be used with the starter kit host application. Each have slightly different ADI’s and can be interacted with in it default state over the fieldbus side. You can pick what ADI mapping to use in the appl_adi_config.h. See the comments for details. The speed example can be useful since the input feeds back into the output.

/*------------------------------------------------------------------------------
** Active ADI setup to use
**------------------------------------------------------------------------------
*/
#ifndef APPL_ACTIVE_ADI_SETUP
#ifdef USE_BOARD_SPECIFIC_ADI_SETUP
#define APPL_ACTIVE_ADI_SETUP   APPL_ADI_SETUP_BOARD_SPECIFIC
#else
#define APPL_ACTIVE_ADI_SETUP   APPL_ADI_SETUP_SPEED_EXAMPLE
#endif
#endif

Regarding the Node ID, you should be able you should be able to set the Node id from the slave address from the Profinet master configuration software. Are you able to do a scan of the network? If it is connected and wired correctly you should at least see the device. I would expect to see this under the online menu option.

Deryck

Thanks Deryck, unfortunately, the software is not able to do a scan of the network. Under the online menu I can only set the driver, and monitor/modify.

How can I manually set the slave address in the example code?

Thanks for your time.

I was just able to connect to the board with a different GSD I found online. The software says its connected but when I try to send a value, nothing shows on the output, when usid the Set speed example. Am I missing something. Also, I was getting an error 8 on the terminal of the host application. Thanks.

Hello German,

Is the speed example the enabled ADI? Where did you get the GSD file. I would expect that you can use the first one in your list on the left with the Speed and ref speed options.

Deryck

Thanks Deryck,
I was just able to communicate correctly and run the speed example. I now want to read and write 10 words of data, but I couldnt find how to properly define the modules on the GSD so the matches the address and the host application ADIs. Is there a guide i’m missing to modify these files for PROFIBUS?
Thanks again.

Hello German,

The Network Guide - PROFIBUS DP-V0/DP-V1 covers the GSD file configuration in section . You might also want to look at section 7.2 with the Modular Device Object (ECh).

Deryck

Thanks a lot Deryck, I am now able to successfully write and read 10 words via profibus. Now I want to know how I could use the M40 module without the starterkit and instead with a SB RIO, would it be possible? Are there any guides regarding this migration?

Thnks

Excellent Glad to hear you have made progress.

It sounds like you will want to take a look at the Hardware design guide and implementation guide for the M40. Anybus CompactCom 40-series Files and Documentation

The starter kit also provides a few example projects for various boards. You can take a look at these for some details on implementation for your host. The Generic example notes what sections need to be implemented. Doing a diff between two versions can help make it obvious what needs to be implemented as well.

Thanks a lot! Will check them out

You’re Welcome! Have a great week!

Thanks! you as well!