Hello there,
I am trying to access to the reference value (AXL SE INC1 ASYM) from C++. Is there any way I can achieve that? I couldn’t find anything in the documentation.

I’m fairly sure that’s possible using the PdiRead method on the Axioline Acyclic Communication service.
The documentation for that Axioline module gives details of the available application objects:

Thanks for the quick response. I am trying to make it work, however the DATA CNT is 00 instead of 44. I have tried to play around with the subslot and subindex but the result is still the same. Perhaps something else I am doing is not correct?


The request input needs to be triggered. You set it to TRUE. The data in the readbuffer is only valid with a rising edge of the NDR output. So with the rising edge you need to store the data in a different variable. I hope this helps.
Hello Stefan,
I have implemented your suggestions.
Now I start the PDI_READ setting REQ to FALSE and placing a breakpoint on the DATA_CNT, NDS and ERROR variables.
Then I set REQ to FALSE, but still, nothing happens.
Here is my example which works pretty well. Please check if you are using the correct index and subindex. Also check the datatype of your receive buffer. This must be a BYTE or WORD array.

I have tried to replicate your code, still not getting the right data. Would it be possible for you to share the project file?
No problem. Here is my project, You need PLCnext Engineer 2025.0 LTS to open it. Please change the file extension to pcweax before you open it.
PDI_READ_DEMO__2025-02-26__06-23.zip
I have opened the project with PLCnext Engineer 2025.0 LTS, replaced the controller with the AXC F 1152 2023.0.0 (Simulation), set the wIndex to 2, run the simulation, set the xTrigger to TRUE and then I get the error „ERROR - PDI_READ: Failed to subscribe service!“.
Could this be happening because I am not using a controller but instead the simulator?
Yes, the simulation does not support Fieldbus protocols like Axioline. For the FB to work you need a physical PLC.
I’m a technical consultant from Phoenix Contact The Netherlands, I’ve been working on a piece of demo software to retrieve the reference value using C++. It’s made for firmware version 2024.0 and uses PLCnext Engineer version 2024.6. See attached my project files, if you have any questions feel free to contact us at support@phoenixcontact.nl.
ReadPDI.zip
I’ve put some finishing touches on my C++ code, see attached. Also, to be able to post the code here I had to remove all compiled files. So in order to rebuild the code, the project file with the .sln extension must be opened in Visual Studio Community 2022. I use SDK version 2024.6.0 (24.6.0.81) with PLCnCLI version 24.6.0.5444 on a Windows host. You could also alternatively copy the source code to a new C++ project but please pay attention to the namespaces if you do so.
ReadWritePDI_C++.zip