@@ -64,17 +64,18 @@ ethercat:
64
64
And then you can run the following python script:
65
65
66
66
` ` ` python
67
- from poulpe_ethercat_py import PyPoulpeRemoteClient, launch_server, get_all_slaves_in_network
67
+ from poulpe_ethercat_py import PyPoulpeRemoteClient, PyEthercatServer
68
68
import time
69
69
70
70
# launch the server first
71
- address = launch_server("file_config.yaml")
71
+ server = PyEthercatServer()
72
+ server.launch_server("file_config.yaml")
72
73
73
74
# wait for the server to start
74
75
time.sleep(1.0)
75
76
76
77
# print all slaves in the network
77
- devices = get_all_slaves_in_network(address )
78
+ devices = server. get_all_slaves_in_network()
78
79
print("Devices connected in the network : " )
79
80
for i,name in zip(devices[0],devices[1]):
80
81
print(" Slave {}: {}".format(i,name))
@@ -86,7 +87,7 @@ no_axis = 3
86
87
87
88
print('Connecting on slave : {}'.format(slave_id))
88
89
# Create an instance of the client
89
- client = PyPoulpeRemoteClient(address , [slave_id], 0.001)
90
+ client = PyPoulpeRemoteClient(server.addr , [slave_id], 0.001)
90
91
91
92
time.sleep(1.0)
92
93
0 commit comments