I have several EDS files and use'em in project. Now I want to recognize node using their Generic Parameters to assign correspond IP-addresses. For example:
Node := Scanner.FirstChildNode; FOR node_index := 0 TO Scanner.ChildNodeCount-1 DO Node := Node.NextSiblingNode; RemoteAdapter_diag := Node; vendor_code := get_vendor_code(RemoteAdapter_diag); if vendor_code = eds1_vendor_code then RemoteAdapter_diag.IPAddress := eds1_IP; elsif vendor_code = eds2_vendor_code then RemoteAdapter_diag.IPAddress := eds2_IP; end_if end_for
So the question: anybody know how to get this "Device Generic Parameters" in program?
VAR pParam: POINTER TO IoConfigParameter; pVendor: POINTER TO DWORD; Vendor: DWORD; END_VAR pParam := ConfigGetParameter(RemoteAdapter_diag.Connector,512); IF pParam <> 0 AND pParam <> RTS_INVALID_HANDLE THEN pVendor := pParam^.dwValue; IF pVendor <> 0 AND pVendor <> RTS_INVALID_HANDLE THEN Vendor := pVendor^; END_IF END_IF
You can get the parameter ID 512, by exporting the adapter to PLCopenXML
Thanks, It works, and I got other parameters ID within XML =)
Log in to post a comment.
I have several EDS files and use'em in project.
Now I want to recognize node using their Generic Parameters to assign correspond IP-addresses.
For example:
So the question: anybody know how to get this "Device Generic Parameters" in program?
Last edit: asivakov 2021-09-15
You can get the parameter ID 512, by exporting the adapter to PLCopenXML
Last edit: i-campbell 2021-09-15
Thanks,
It works, and I got other parameters ID within XML =)
Last edit: asivakov 2021-09-20