Skip to content

Native C++ app using "AXL F IF CAN 1H"

Hi,
I'd like to use "AXL F IF CAN 1H" from a pure C++ application.
I am completely new to PLC world.
My customer has several existing C++ programs making use of I/O modules and CANBus. They want to run their old application on "AXC F 2152". I am working on adapting the applications to new HW.
Following tutorial at https://github.com/PLCnext/SampleRuntime/tree/master/getting-started/Part-03 I managed to manipulate digital I/O ports from C++ application without creating anything in PLCNext Engineer. But I could not find any sample C/C++ application using "AXL F IF CAN 1H". I have noticed 64 bytes input and output data space is reserved for module on GDS. But I could not find any document how to use reserved spaces.

My questions:
Is it possible to use "AXL F IF CAN 1H" in C++ native linux application (without PLCNext engineer programming)?
Is there a sample C/C++ native linux application using "AXL F IF CAN 1H"?
Where is the right place to find documentation about usage of a module (e.g. "AXL F IF CAN 1H") in a native linux C++ application?

Here is my test plant.

[attachment]plant.jpg[/attachment]

Thank you,

Comments

  • Is it possible to use "AXL F IF CAN 1H" in C++ native linux application (without PLCNext engineer programming)?
    Yes. If you are able to control "simple" Axioline I/O modules like digital I/O from a C++ application, then it is possible to control any Axioline I/O module. You will need to set the module parameters in PLCnext Engineer, in the "Parameters" tab of the I/O module window, but I assume you have done this already.
    Is there a sample C/C++ native linux application using "AXL F IF CAN 1H"?
    No, not specifically for that I/O module (sorry). But the principle is the same as for the digital I/O module shown in the Sample Runtime example.
    Where is the right place to find documentation about usage of a module (e.g. "AXL F IF CAN 1H" ) in a native linux C++ application?
    The "Data Sheet" (really a user manual) for that I/O module is an essential document. You can download this from our website, and I have also attached it here. In that document, section 15 describes the 64 bytes of input and output process data, which you will need to read and write from your C++ application. You need to keep in mind that process data is transferred between the Axioline master (PLC) and I/O modules cyclically (default 500µs cycle, if I remember correctly). So when you set Output process data, it will take a period of time for that data to be transferred to the I/O module, and for the reply (if any) to be received from the I/O module on the Input process data.

    PLCnext Engineer users will use the CANbus library from the PLCnext Store, so they don't need to deal directly with the process data. You could consider writing a C++ function or class that does something similar to the PLCnext Engineer Function Block. I can try to get you the source code for that FB (probably in Structured Text) if you like, which might help to show how to use the process data on that I/O module.
  • I can try to get you the source code for that FB (probably in Structured Text) if you like, which might help to show how to use the process data on that I/O module
    That would really help.
    Thank you...
  • An email has been sent - please check your Spam folder if you have not received it.
  • edited December 2024


Sign In or Register to comment.