CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum by 3S-Smart Software Solutions GmbH | A member of the CODESYS Group
Deutsche Version English version russian version 
It is currently Mon Oct 22, 2018 12:47 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Generic Device Parameter
PostPosted: Tue Jul 03, 2018 8:00 pm 
Offline

Joined: Mon Jul 02, 2018 4:51 pm
Posts: 4
Hello, everybody,

I have a problem with an Ethernet/IP Master. In this case I would like to make the Target IP address of the Ethernet/IP Slave dynamically changeable. So save the IP address in a persistent variable and enter it as the Target IP address at program start.

I have seen that there is the variable as shown in the picture under the Generic Device Parameters of the Ethernet/IP Master. However, I don't know how to specify a variable under the value. Is it possible here don't have to enter the value manually instead of using a variable that can also be changed in the visualization?
Attachment:
target_ip2.JPG


Thank you very much for your help in advance.

Greeting Kunz


You do not have the required permissions to view the files attached to this post.


Top
   
PostPosted: Thu Jul 05, 2018 7:52 pm 
Offline

Joined: Mon Jul 02, 2018 4:51 pm
Posts: 4
Has nobody an idea? or is there a different solution in general? I would be really grateful for help

Greetings Kunz


Top
   
PostPosted: Fri Jul 06, 2018 2:18 pm 
Offline

Joined: Wed Oct 12, 2016 12:28 pm
Posts: 14
Dear Kunz,

the basis is this example: https://store.codesys.com/caa-device-di ... ample.html

In the method DeviceController\Reset I pass the desired IP address.

Var
itfAdapter : IoDrvEthernetIP.IRemoteAdapter2;
abyIp : ARRAY [0..3] OF BYTE := [192,168,99,140];
end_var

IF itfDevice <> 0 THEN

(* with CheckSupportedCommunicationState() it is possible to check whether the requested state can be performed in general. *)
IF itfDevice.CheckSupportedCommunicationState(DED.DEVICE_TRANSITION_STATE.RESET) THEN

(* with CheckCurrentSupportedCommunicationState() it is possible to check whether the device can be reset right now. *)
IF itfDevice.CheckCurrentSupportedCommunicationState(DED.DEVICE_TRANSITION_STATE.RESET) THEN
IF __QUERYINTERFACE(itfDevice, itfAdapter) THEN
itfAdapter.IPAddress := abyIp;
END_IF
(* reset the device*)
itfDevice.SetCommunicationState(DED.DEVICE_TRANSITION_STATE.RESET);


Good luck


You do not have the required permissions to view the files attached to this post.


Top
   
PostPosted: Tue Jul 10, 2018 5:42 pm 
Offline

Joined: Mon Jul 02, 2018 4:51 pm
Posts: 4
Hello,

thank you very much that helped me a lot. However, I cannot apply the solution to another problem. I would also like to dynamically adjust the station name of a PROFINET device. However, here the library looks different and I don't know the procedure. Is there a solution to this problem?

Greeting Kunz


Top
   
PostPosted: Tue Jul 10, 2018 7:37 pm 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 2904
Hi,
your plc is profinet device?
The PN Controller should give the IP and device name.. so I think this should not be needed to do.
BR
Edwin


Top
   
PostPosted: Wed Jul 11, 2018 5:28 pm 
Offline

Joined: Mon Jul 02, 2018 4:51 pm
Posts: 4
Hello, yes, normally. But in this case the controller cannot configure the device because no development environment such as Codesys is available. In other words, the controller is always looking for the same device. Thus it comes to this problem to adjust the station name of the device dynamically. Is there a possibility here? Greetings Kunz


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 6 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited