Author Topic: Nano and F2424 seperated by network  (Read 7680 times)

secs

  • Newbie
  • Posts: 25
  • I'm a llama!
    • View Profile
Nano and F2424 seperated by network
« on: August 01, 2016, 09:56:08 PM »
We have a F2434 operating at a remote location and it hangs off a 4G network. At our office we have a nano 10. I need to monitor 2 inputs from the f2424 on the nano.

There is no issue with the f2424 getting out but the other way around is is an issue.

I was thinking about making the 2424 a Modbus client and have it connect to the nano via tcp but couldnt find how to make that happen.

Is there an example somewhere or can someone suggest a different approach?

Peter

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3171
    • View Profile
    • Internet Programmable PLCs
Re:Nano and F2424 seperated by network
« Reply #1 on: August 02, 2016, 09:14:29 PM »
Do you mean you have problem connecting to the Fx2424 while it is connected to a 3G modem?

I assume the 3G modem is connected to the Fx2424 via Ethernet port? The 3G modem then act as a router and there is a firewall protecting the Fx2424 from external access.

What you need to do is to "port forward" the TCPIP packets with the FServer port number (default is 9080) or the Modbus TCP server port number (default is 502) to the private static IP address that Fx2424 is configured. The firewall also must open to allow packets destined to these ports to be passed through. Once you have set it up this way, you will then be able to remotely access the Fx2424 using the 3G modem public IP address. You can test it with i-TRiLOGI first (or a Modbus TCP client software in case of Modbus TCP server is used). If you are able to remotely program and monitor the Fx2424 it is now very easy for the Nano-10 to access the Fx2424 since it can make a connection to the 3G modem public IP address.

Likewise, you can also make the Fx2424 access the Nano-10 in your office. You will need to "port-forward" the relevant port from the router of your office to the IP address of the Nano-10. Also firewall on the router must allow packets destined to these ports to pass through to the PLC. Again if properly setup you should be able to use i-TRiLOGI to access your Nano-10 from outside of your office using the public IP address of your office router. Once that test is successful the Fx2424 should have no problem accessing the Nano-10 to upload or download data.
« Last Edit: August 02, 2016, 09:15:02 PM by support »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

secs

  • Newbie
  • Posts: 25
  • I'm a llama!
    • View Profile
Re:Nano and F2424 seperated by network
« Reply #2 on: August 02, 2016, 09:29:59 PM »
Thanks for that.

I was having issues with finding a reference to using the f2424 as a modbus client. However in rereading the manual I found the net command stuff. From that I found the Ethernet examples and am playing with that.

I write software in Delphi/pascal and previously wrote some software that connected via tcp to the 24 using modbus. I just havent played with it the other way around.

I have set up the nano in the office and am waiting for a convenient time to go back to the workshop and see if I can get it to connect.

secs

  • Newbie
  • Posts: 25
  • I'm a llama!
    • View Profile
Re:Nano and F2424 seperated by network
« Reply #3 on: August 04, 2016, 10:11:45 AM »
Ok I have been playing with the Ethernet examples. I can see its possible to do it either by Modbus or by NETCMD$

So a couple of questions.

Which would be the more stable method?

Secondly, if I only want to pass data say every 20 seconds, would it be better to retain the connection and if so how do I detect a disconnect

or

Connect, pass the data and disconnect each time?

Peter

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3171
    • View Profile
    • Internet Programmable PLCs
Re:Nano and F2424 seperated by network
« Reply #4 on: August 04, 2016, 01:57:54 PM »
Given that the Nano-10 is on 4G network which is likely to be less stable than the internet connection at the ISP, it will probably be better for the Nano-10 to update the status on the F2424. If you are just monitoring digital inputs you also can report only when there is a change of logic state and when nothing change the Nano-10 need not report the state to the Fx2424 (or at least report much less frequently).

Nano-10 can send a NETCMD$ and check for response from the Fx2424. If there is no response it can try again and if still no response, there is probably a loss connection and the Nano-10 can do the necessary such as disconnect and make a new connection. In some cases it may need to restart the 4G modem in order to resolve the connection problem. These are possible if Nano-10 can control the power to the 4G modem.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

secs

  • Newbie
  • Posts: 25
  • I'm a llama!
    • View Profile
Re:Nano and F2424 seperated by network
« Reply #5 on: August 08, 2016, 04:52:19 AM »
Ok I have got the F2424 connecting to the nano10 using netcommands but I am thinking Modbus will be a lot easier so will try the modbus connection tomorow.

The f2424 is the one hanging off the 4g network.

The nano is at the main office.

All I need to do for now is get the f2424 to connect to the nano, pass/write dm1 to dm100 to the nano and read dm101 to itself all in the same positions.  So the F2424 will mirror the values in Dm1-100 to the nano and mirror the Nano 101-200 back into itself.

I know its a basic command but can someone give me an idea?

I think I need to use

to write f2424 dm 1-100 over to the nano
WRITEMB2 4,1,41001,DM[1],100

and to read the nano 101-201 back to the f242
READMB2 4,1,41101,DM[101],100

Regards, Peter

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3171
    • View Profile
    • Internet Programmable PLCs
Re:Nano and F2424 seperated by network
« Reply #6 on: August 08, 2016, 05:27:01 PM »
First you need to make a Modbus TCP connection. After the connection is made then you can send the WRITEMB2 and READMB2 commands.

However, the command can't process 100 registers at a time. Please try to limit a single WRITEMB2 and READMB2 command to not more than 32 registers at a time so that you do not exceed the transmit and receive buffer size. Therefore you may need multiple read and write to update all 100 DMs.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

secs

  • Newbie
  • Posts: 25
  • I'm a llama!
    • View Profile
Re:Nano and F2424 seperated by network
« Reply #7 on: August 08, 2016, 05:38:00 PM »
Yep thats the help I need. I do realise that I have to make the connection first.

So other than the 32 instead of 100 does my command structure look ok?