Extracting CANbus variable mapping from Codesys 3.x project.

jking22
2014-03-22
2015-01-16
  • jking22 - 2014-03-22

    Is it possible to get access (Python/ Other) to CANbus Mapping information at compile time in Codesys 3.5?

    In our case, we would port it to a Vector(CANalyzer) .DBC file, but it could be ported to any 3rd party format, but csv, xml would also be useful.
    There are a number of 3rd party vendors that can use such files directly.
    The following and many others use .DBC
    1. SCADA- Matricon/Honeywell
    2. CAN Bus analyzer: Vector CANtec,
    3. Telemtry: LHP Telematics
    4. Data Acquisition: HBM

    It could also used to create customer documentation (PDF)

    Perhaps something similar for EtherCAT, UDP Net Var etc...

    IMG: CAN_Mapping Table.jpg

     
  • Anonymous - 2014-03-24

    Originally created by: M.Schaber

    Hi, jking22,

    CDS-37756), but it is not scheduled yet.

    On the other hand, CODESYS already has a feature which may be helpful for your goal: For Devices in the context menu, there are two commands (see the attached screenshot) to allow the import and export of IO Mappings in CSV format.

    Those commands can also be triggered by python scripts, for example:

    dev = projects.primary.find("Device")[0]
    system.commands["device", "exportcsv"].execute("D:\\DeviceExport.csv", str(dev.handle), str(dev.guid))
    

    The parameters are filename, projecthandle, objectguid, each of them as a string. For the import, the command is ["device", "importcsv"].

    HTH, Markus

    PS: The execute() function on the commands is intentionally not documented, but having a "backdoor" in cases like yours where the scripting API is missing functionality are exactly the reasons why we implemented it.

    IMG: mapping

     
  • jking22 - 2015-01-16

    Thanks...

    This is very helpful, however the output contains no COB ID Information or position in message.
    Can you suggest some way of extracting it (Some .xml relational structure or something???

    IMG: Node_Properites_COdesys.jpg

     

Log in to post a comment.