B40 Brick, Host Application Implementation Guide

Background: B40 Brick, SPI connection, PIC32MZ2048EFH064, no operating system

I’ve completed step one, and I can see the device with the IPconfig application. My question is with respect to the host application implementation guide (HAIG). It says, “When this step is completed you have…exchanged data between the host application and the network master/scanner.”

What is the network master/scanner in this scenario? Is there an application that I can use to simulate this? I’m looking for a little guidance in this respect.

Hi @bblessing

Which compactcom B40 are you using? Also are you communicating with this device using our starter kit or is this an already embedded device? Depending on which B40 you have though it could be you need an EtherCat master, Profinet Master, etc.


 Sorry for the late reply. It’s actually a C40 brick, and we want to use it configured for Ethernet IP. As it stands now, we’re using SPI to communicate with it via a PIC32MZ2048EFH064 processor, and it is embedded into a device.

Hi @bblessing

Did you have an OEM embed this into a device or is this something you’re working on. If it’s something you’re working on we’d recommend starting with our starter kit to setup the device. If an OEM did this originally we’d recommend contacting them, because the will have more information on how this device was setup along with the code for how this was setup

No. This is a custom circuit board with the a socket for the brick. As I had mentioned in the forum, the device shows up with Ipconfig, and I’ve made it through step 1 of the Host Application Implementation Guide (HAIG).

We do have a starter kit: the Anybus CompactCom 40 Starter Kit. I didn’t design the hardware for the circuit board, but based on the datasheets that I’ve seen here -
– everything appears to be in good working. I just thought that the HAIG was the starting point for integrating a “brick” into a project from a software standpoint.

Maybe a better question is where to start developing software for the host, i.e. the PIC32. Since it’s bare metal with no OS, I’m using the Generic implementation. Ultimately I will need something to send down to the brick that I can then access via the PIC32 SPI bus to verify that the settings are correct.

Hi @bblessing

Sorry for the delay, have you already downloaded our SDK starter code? It should have some good reference code and be a good starting point

At the bottom of this page there’s a small forum to fill out that will give you access to the code.

Yes. That’s all integrated, compiling and apparently working ok. I can view the speed example through the web page without issue.

I guess the overall problem is just climbing documentation mountain. I’m a beginner with respect to Ethernet IP, and there a number of very large files that will
take some time to digest. I was hoping to cut down on some of that reading because not all of it is relevant to what I’m trying to accomplish: namely taking some of our legacy devices, putting them on the 485 bus, and using the brick/PIC32 to allow devices
on an Ethernet IP network access them.

I would say a good starting point would be to go to the ad_obj.c and define your ADI definition table so that it’s pointing to the correct variables on your side.


Let me back up a bit, as I want to verify that I have something correct. Using the Generic example, I’ll go to the device’s website and see the
parameters page. Am I correct to believe that if I enter the REF_SPEED, the SPEED field will move to that number? If I enter a 20 then eventually the SPEED variable will be 20?

Also, in the APPL_CyclicalProcessing function, the state returned by ABCC_AnbState() is always the following: ABP_ANB_STATE_WAIT_PROCESS. I would think that this
would be ABP_ANB_STATE_PROCESS_ACTIVE if my SPI comms are correct. Just looking for verification.

Hi @bblessing

You are correct that if you set the Reference Speed, then the Speed field will eventually become that number. It is meant to show how fast cyclic processing data can be. What it is doing is runing an if statement and is constantly checking to see what the Speed value is compared to the Reference Speed. If the Speed value is less than the Ref Speed, then it will add one, and run through the proccess again until it reaches that value. The same is true for if the Speed value is greater than the reference speed.


Excellent! Based on what I read in the HAIG appendix, it appears that I have to set up an IO connection with an external device in order to get to the ABP_ANB_STATE_PROCESS_ACTIVE
state and see the SPEED change. Would HMS happen to have a desktop application available to test this with?

Hi @bblessing

I think I may need to look into this for a little bit and get back to you tomorrow


I may have been thinking too hard on this, you can just comment out the if statement that checks if the CompactCom is in Process Active

No problem, Tim. I’m deeply grateful for all of your help.

Sure, that definitely does it, but I was wondering if a desktop application was available for testing an IO connection. I know it’s not the same as the real thing,
but I can’t keep PLCs for very long before they’re needed. Even then, I’m not sure how I would set it up for testing. I guess I have a lot more reading to do at this point.

I was kind of thinking Putty might work, but I’d have to figure out what the packet looks like. Maybe I could test it with ModbusTCP, provided I set it up for

We have a software called EIPScan that could let you create an Ethernet IP master to talk to the device if you’re interested in that?

It’s a software made by Pyramid Solutions that we sell licenses to

Quick question. As I pore through all of this documentation, is it the case that we will need to purchase a vendor ID if we sell any products with the CompactCom
40 embedded?