Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SYNC-Message not generated #14

Open
tobhub93 opened this issue Nov 26, 2018 · 7 comments
Open

SYNC-Message not generated #14

tobhub93 opened this issue Nov 26, 2018 · 7 comments

Comments

@tobhub93
Copy link

Hi

I have implemented my node as a SYNC-Producer but it doesn't generate the corresponding messages.
thats the part where the Sync is initalised:

`/* index 0x1005 : SYNC COB ID. /
UNS16 ObjDict_obj1005 = 0x80; /
128 /
ODCallback_t ObjDict_Index1005_callbacks[] =
{
NULL,
};
subindex ObjDict_Index1005[] =
{
{ RW, CANopen_TYPE_uint16, (void
)&ObjDict_obj1005 }
};

/* index 0x1006 : Communication / Cycle Period. /
UNS32 ObjDict_obj1006 = 0x2710; /
10000 /
ODCallback_t ObjDict_Index1006_callbacks[] =
{
NULL,
};
subindex ObjDict_Index1006[] =
{
{ RW, CANopen_TYPE_uint32, (void
)&ObjDict_obj1006 }
};
`
Does anybody has a advice?

thx

@jgeisler0303
Copy link
Owner

I only ever used my PC as a sync producer and the node happily answered. It is very possible that I optimized the sync-producer capability away to fit the code in the restricted memory. But it's quite a while ago, so I don't really remember.

@jgeisler0303
Copy link
Owner

It seems sync capability is there after all. Maybe you have to call startSYNC() once in your code or set the ObjDict_Index1006_callbacks to &OnCOB_ID_SyncUpdate. Not sure whats the right method. Maybe you can try?

@tobhub93
Copy link
Author

tobhub93 commented Nov 26, 2018 via email

@jgeisler0303
Copy link
Owner

What error message? Did you forget to append it?

@tobhub93
Copy link
Author

tobhub93 commented Nov 27, 2018 via email

@jgeisler0303
Copy link
Owner

I somehow cannot find any attachments.

For communication on the PC side (well really its a BananaPi with builtin CAN controller) I use this: https://github.com/jgeisler0303/can2mqtt

@tobhub93
Copy link
Author

Unfortunately, I'm still struggling with the same problem. My goal is to build a small network with 2 Arduino Uno. Sensor values are transmitted from the slave to the master via CANopen. The master should generate the cyclic SYNC message. But this is not the case.
The code section below shows the implementation of the master as well as the corresponding object directory. For simplicity only with the SYNC function.
Master.ino
`
#include "canfestival.h"
#include "ObjDict.h"
// These all need to be included because canfestival needs them
#include <avr/io.h>
#include "Arduino.h"
#include <SPI.h>
#include "mcp_can.h"
#include "Timer.h"
#include "digitalWriteFast.h"
#include "BlinkPattern.h"

CO<3, 4> co; // template-Klasse erstellen

void setup() {
Serial.begin(9600);

co.CO_Init(); // init CAN, setState(Initialisation), setAlarm()

analogReference(INTERNAL);
startSYNC();
}

void loop() {

co.CO_Cycle();

}
`

ObjDict header.txt
ObjDict.txt

Does anyone have any idea why this isn't working?

thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants