It's me again. So, I was able to create the tcpClient using the comand System.Net.Sockets.TcpClient.
Then I created the slave and tried to make the connection but didn't work. I'm afraid I'm not using the proper functions in the Modbus assembly. Here is what I'm doing:
modbusObj = NET.addAssembly('C:\...\bin\net\Modbus.dll');
systemObj = NET.addAssembly('System');
%%
% Create Tcp Client
echotcpip('on',5500);
tcpClient = System.Net.Sockets.TcpClient(System.Net.Dns.GetHostName(), 5500);
%%
% Create Modbus Tcp Slave
% Create tcp Listener
ipAddress = System.Net.IPAddress.Parse('192.168.1.10');
tcpListener = System.Net.Sockets.TcpListener(ipAddress, 502);
tcpSlave = Modbus.Device.ModbusTcpSlave.CreateTcp(2, tcpListener);
%%
% Create Modbus Tcp Master Connection
modbusMasterConnectionObj = Modbus.Device.ModbusMasterTcpConnection(tcpClient, tcpSlave);
The port 502 is the port for modbus mode of my device, and it's address is 192.168.1.10.
Am I using the correct functions?
Thanks a lot for your help!!!
Camilo