I want to read data from my PLC over ANSL protocol, is the documentation available for this protocol.
Or if there is any library available for the same purpose
Hi,
the protocol description itself isn’t open available.
But writing own programs using ANSL communication is possible by using the PVI DLL functions (as it’s a DLL interface, Windows is needed as operating system).
You have to install the PVI Development Setup which is available on the B&R homepage for download to get access to the needed header files or the .NET classes, some samples a.s.o.
Best regards!
An old version of PVI development 4.0.18.50 contains a ANSL sample for Windows and Linux.
The newer versions of PVI development only contains sample for Linux.
https://www.br-automation.com/en/downloads/software/automation-studio/automation-studio-3090/pvi-development-setup/
Thanks @corne.geerts and @alexander.hefner ,
One question , can I read process variable data from ANSL protocol stack. While we dont have program running on PLC. I know we can’t read the variable directly but can I get data without variable names, so it will be kind of raw data from variable location.
Hi,
with ANSL, process variables are always adressed by their name and scope (global or task locale). So, a “raw reading” of variable values without knowing the variable names and scope isn’t possible.
But the’re possibilities in ANSL to query objects, for example the names of the modules / tasks on the PLC, and also the names of process variables in the scope.
So, it would be possible to implement a “browse-like” functionality to get the variable names.
More or less, using the PVI DLL (or, like Corne mentioned the ANSLUIF) you have the same possibilites like using Automation Studio or Runtime Utility Center to open a watch / reading objects (tasks, variables, values) without having the source code of the project.
Best regards!
The name of the variable and the datatype is stored in the PLC and there are functions to read this information and to access.
@corne.geerts , can you please help me with the function to get these variable names. And also documentation says that we need to place information of your plc in some xml file. But could not find the xml file, do we have to manually write it.