Can open Recieve Bootup

Hello,

I am using a 4PPC70.0702-21B. I have several CANopen sensors and want to test whether they are working. I tried using the FUB CANopenReceiveBootup for this. Since I only ever connect one sensor at a time to the PP, I should be able to check if the sensor is functioning.

I have the following information about the sensors: baud rate of 250 kbit, CANopen, and no EDS file. However, I am not receiving any response. I don’t know where or what the error is. The Communication is not working. It makes no difference whether the sensor is connected or not; the FUB delivers the same result.
Best regards
Viktor Weiss

Hello Viktor,
welcome to the community !

I think we would first need a CAN trace for this (e.g. PCAN, IXXAT).
Also the outputs of the FUB might be interesting …

Best regards

Hello,

Thank you for your help.
The outputs of the FUB are as follows: status=0, error=0, node=0, stateman=0, statusbuffer=0. It makes no difference whether the sensor is connected or not.

What exactly do you mean by PCAN, IXXAT? I have never heard of that before. We can also chat in german if you like.

What exactly do you mean by PCAN, IXXAT? I have never heard of that before.

These are brands delivering simple PC adapters to record CAN- messages, e.g.

PCAN-USB: PEAK-System

Ixxat USB-to-CAN V2 compact

BTW: did you add the sensors by their EDS file to the hardware tree ?
By this you’ll see their status in the IO- mapping.

I have no EDS files for my Sensors. The Sensors have an M12 Plug. Why do I need such a device? I made an M12 connection so that I can connect the sensor to my CAN interface IF 6.

EDS files make the configuration of a CANopen participant much easier.
You will then rarely need functions from the AsCANopen library.
You may still have to configure the sensor, start it and monitor it for errors.
Most manufacturers therefore provide them.

Strictly speaking, of course, you can do without it. However, this is associated with increased effort.

You must then first inform the CANopen master that there are nodes in the network:

CANopenActivateSlaveMonitoring()

+++ If the manufacturer is unable to supply an EDS file (and there is no alternative), you can also use the default file from your Automation Studio folder

(\Program Files\BRAutomation4\AS412\Specials)

you should at least be able to establish a connection to the sensor.

I just need to test if the sensor is still working. I know that the sensor sends a boot-up message as soon as it is powered. So I should be able to receive this boot-up message with the FUB. But it doesnt‘t work.

ok.
I was curious and gave it a try. And I did not use an EDS.

VAR
	fbbootup : CANopenRecvBootup;
	node : USINT;
END_VAR

PROGRAM _INIT
	fbbootup.enable := TRUE;
	fbbootup.pDevice := ADR('SS1.IF1');
	
	 
END_PROGRAM

PROGRAM _CYCLIC
	fbbootup();
	IF fbbootup.status = 0 AND fbbootup.node <> 0 THEN
		node := fbbootup.node;
		fbbootup.enable := FALSE;
	END_IF
END_PROGRAM
  1. boot the CPU
  2. power on the Slave
  3. see the node number in ‘node’

so this is working with my components …

I just tried it, but it didn’t work. Do you have any idea why I’m not getting a node number? Did I maybe make any mistakes in the configuration? I only know that the baud rate is 250 kbit.

I also did a short test and it does NOT work when simply powerfailing the node BUT it does work when sending a NMT restart command to the node:

So I would suggest that you cyclically call the “RecvBootup” and send a NMT command whenever you want to check a node. Nevertheless the slave will reboot upon this command and the master will get the bootup

I just did this:

Of course, the CANopen master must already be working when the CANopen slave is powered on. Otherwise the boot-up message is already lost …

It still doesn’t work . I tried both Programms and powerd the Sensor after the PP . The FUB CanopenRecvBootup just keeps running continuously in borh programms. I’m not getting a node.

What happens when you give the “SendReset” a second time ? In your program is is immediatly 1 due to the Init up

@christoph.hilchenbac this is not what my test showed. The Master was already running and a simple powerfail did not trigger the RecvBootup

no problem here. no NMT command required.

The wiring is definitely correct, but it doesn’t work.

Are you sure that the device sends a bootup at all ? I have (unfortunatly) seen devices which does not do this.
You should check this using any CanOpen Monitor (3rd party hardware to trace the CAN bus)

1 Like

I know that when the voltage is switched on, the sensors send a boot-up message. Subsequently, the message “Start all nodes” must be sent to the sensors. After receiving four sync messages (COB-ID 0x80) each, the sensors send their measurement value.
I just have to check if the sensors send a message at all.

can you post the data sheet of the sensor ?