{"action":"created","issue":{"url":"https://api.github.com/repos/machinekit/machinekit/issues/589","labels_url":"https://api.github.com/repos/machinekit/machinekit/issues/589/labels{/name}","comments_url":"https://api.github.com/repos/machinekit/machinekit/issues/589/comments","events_url":"https://api.github.com/repos/machinekit/machinekit/issues/589/events","html_url":"https://github.com/machinekit/machinekit/issues/589","id":70954643,"number":589,"title":"HAL driver for CAN","user":{"login":"luminize","id":2206842,"avatar_url":"https://avatars.githubusercontent.com/u/2206842?v=3","gravatar_id":"","url":"https://api.github.com/users/luminize","html_url":"https://github.com/luminize","followers_url":"https://api.github.com/users/luminize/followers","following_url":"https://api.github.com/users/luminize/following{/other_user}","gists_url":"https://api.github.com/users/luminize/gists{/gist_id}","starred_url":"https://api.github.com/users/luminize/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luminize/subscriptions","organizations_url":"https://api.github.com/users/luminize/orgs","repos_url":"https://api.github.com/users/luminize/repos","events_url":"https://api.github.com/users/luminize/events{/privacy}","received_events_url":"https://api.github.com/users/luminize/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/machinekit/machinekit/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":113,"created_at":"2015-04-25T19:12:09Z","updated_at":"2015-07-22T11:56:47Z","closed_at":null,"body":"As a subissue of https://github.com/machinekit/machinekit/issues/586 I'll try to get history, questions, contemplations, answers, tips and all what passes collected into this issue.\r\n\r\nDuring the process I want to write down \"the stuff\" so when we release it into the wild we have the docs also ready to go. I'll do that in a dedicated branch can-in-machinekit here: https://github.com/luminize/machinekit-docs/tree/can-in-machinekit"},"comment":{"url":"https://api.github.com/repos/machinekit/machinekit/issues/comments/123693614","html_url":"https://github.com/machinekit/machinekit/issues/589#issuecomment-123693614","issue_url":"https://api.github.com/repos/machinekit/machinekit/issues/589","id":123693614,"user":{"login":"githubuser0xFFFF","id":4239304,"avatar_url":"https://avatars.githubusercontent.com/u/4239304?v=3","gravatar_id":"","url":"https://api.github.com/users/githubuser0xFFFF","html_url":"https://github.com/githubuser0xFFFF","followers_url":"https://api.github.com/users/githubuser0xFFFF/followers","following_url":"https://api.github.com/users/githubuser0xFFFF/following{/other_user}","gists_url":"https://api.github.com/users/githubuser0xFFFF/gists{/gist_id}","starred_url":"https://api.github.com/users/githubuser0xFFFF/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/githubuser0xFFFF/subscriptions","organizations_url":"https://api.github.com/users/githubuser0xFFFF/orgs","repos_url":"https://api.github.com/users/githubuser0xFFFF/repos","events_url":"https://api.github.com/users/githubuser0xFFFF/events{/privacy}","received_events_url":"https://api.github.com/users/githubuser0xFFFF/received_events","type":"User","site_admin":false},"created_at":"2015-07-22T11:56:47Z","updated_at":"2015-07-22T11:56:47Z","body":"Hi Bas,\r\n\r\nthe EDS file itself will not tell you anything - it is only there for configuration tools to display object dictionary entries in a human readable format. From such a configuration tool, you can then save a DCF file - a device configuration file. This is an EDS file with the current configured parameters filled in. So you need to parse DCF files, if you would like to read current device settings.\r\n\r\nI think, there are two main approaches for setting up the configuration of a CANopen device.\r\n- configure it with a configuration tool and then read all devices parameters at startup from the device or from the DCF file\r\n- write the desired configuration including PDO setup from your (Machinekit)application into the device, to force a certain configuration\r\n\r\nIn our software, we prefer the first solution. We configure the devices in an external configuration tool, and read the device parameters at startup and configure out local PDOs according to the remote device PDO configuration. We do not parse DCF files.\r\n\r\nThis approach does not work with all devices, because some devices like the Trinamic CANopen stepper controllers do not save important parameters or because some devices like the ELMO CANopen drives do not store their PDO configuration. For such devices it ist necessary, to configure them at startup. We do this via XML files:\r\n\r\n```xml\r\n<ObjDictEntries>\r\n\t<ObjDictEntry Index=\"2000\" SubIndex=\"0\" Value=\"6\" Size=\"1\" comment=\"Microstep Resolution\"/>\r\n\t<ObjDictEntry Index=\"2003\" SubIndex=\"0\" Value=\"255\" Size=\"1\" comment=\"Maximum Current Percent\"/>\r\n\t<ObjDictEntry Index=\"2004\" SubIndex=\"0\" Value=\"64\" Size=\"1\" comment=\"Standby Current Percent\"/>\r\n\t<ObjDictEntry Index=\"2005\" SubIndex=\"0\" ValueHex=\"C\" Size=\"4\" comment=\"Limit Switches Enable\"/>\r\n\t<ObjDictEntry Index=\"2085\" SubIndex=\"0\" Value=\"5\" Size=\"1\" comment=\"Ramp Divisor\"/>\r\n\t<ObjDictEntry Index=\"2086\" SubIndex=\"0\" Value=\"1\" Size=\"1\" comment=\"Pulse Divisor\"/>\r\n\t<ObjDictEntry Index=\"6067\" SubIndex=\"0\" Value=\"0\" Size=\"4\" comment=\"Position Window\"/>\r\n\t<ObjDictEntry Index=\"607C\" SubIndex=\"0\" Value=\"-396895\" Size=\"4\" comment=\"Home Offset -401245\"/>\r\n\t<ObjDictEntry Index=\"6083\" SubIndex=\"0\" Value=\"260\" Size=\"4\" comment=\"Profile Acceleration\"/>\r\n\t<ObjDictEntry Index=\"6085\" SubIndex=\"0\" Value=\"320\" Size=\"4\" comment=\"Quick Stop Deceleration\"/>\r\n\t<ObjDictEntry Index=\"6098\" SubIndex=\"0\" Value=\"18\" Size=\"1\" comment=\"Homing Method\"/>\r\n\t<ObjDictEntry Index=\"6099\" SubIndex=\"1\" Value=\"1200\" Size=\"4\" comment=\"Fast Homing Speed\"/>\r\n\t<ObjDictEntry Index=\"6099\" SubIndex=\"2\" Value=\"400\" Size=\"4\" comment=\"Slow Homing Speed\"/>\r\n\t<ObjDictEntry Index=\"609A\" SubIndex=\"0\" Value=\"260\" Size=\"4\" comment=\"Homing Acceleration\"/>\r\n</ObjDictEntries>\r\n```\r\n\r\nThat means, before executing step 1, we simply dump the paramters from XML into the device.\r\n\r\nSo parsing the DCF file is not a solution for all devices, because some devices simply do not store important device parameters like PDO or drive configuration and you must be able to do the configuration.\r\n\r\nIf a device is properly configured, you can read all parameters, including PDO configuration from the device via SDO transfers.\r\n\r\n\r\n"}}