Jump to content

Initiate a Data Table upload from PLC ladder logic


Recommended Posts

This is absolutely possible. Are you connecting over an Ethernet connection?


In the DataXport project the PC port can be selected for Ethernet (listen) with the port settings defined in the PC Ports menu. Once the PLC performs the connection to the PC running DataXport it will collect all of the data defined in the site configuration.

Link to comment
Share on other sites

Thanks for the response Alexander.

I think I understand what you are getting at, however I can't seem to figure out how to establish the connection from the PLC ladder logic.


Using Ethernet(Call) in the DataExport with TCP I have been able to sucessfully make the data transfer. In the PLC, I initialized the ethernet port using "TCP/IP CARD INIT" and initialized socket 0 to TCP, Slave.


Then I set the DataExport to Ethernet(listen) and in the PLC, initialized socket 0 to TCP, Master. (with all the same port & IP settings as above). Then I try to open the connection through socket 0, with the "TCP/IP Connect", the socket 0 Status changes from "14 - Socket Initialized" to "0 - Connection Closed".


Am I even supposed to be using the "TCP/IP Connect" FB to establish the connection?

I have been struggling with this for a couple of days now and think I must be approaching it wrong.


Any help you offer will be much appreciated.



Link to comment
Share on other sites

OK....I have managed to get this working, however it is not consistent. I have attached the current logic. I am simply using a screen button to initialize the socket, then open the connection.


Previously, I was using DataExport to set a bit that I used to close the socket connection once the data transfer was complete. That resulted in sucessful operation, but only once, after power up. I thought that the connection needed to be opened for data transfer and then closed once complete, but that doesn't seem to be the case.


When I removed the TCP/IP Close instruction, and use the code attached, it works fairly well, but not 100% of the time. For example, if I press the button again, while the transfer is still taking place, the socket seems to "lock-up". Even if I wait until the transfer is complete, it doesnt always make the connection.


I am wondering now if there is a "busy" bit that I should be making sure is OFF, before attempting to use the socket again.?


Link to comment
Share on other sites

All you should need to perform is the TCP/IP connect function within the ladder. Once the controller connects to the PC running DataXport, it will automatically collect all of the data that was set up for that site.


I did notice that in your application the Comm Test button was referenced as a direct contact in the logic. This will cause it to be triggered each scan that your finger holds it down, it may be 10's or 100's of times which can cause issues with the TCP/IP connect block. I would suggest changing the contact to a positive transition so that it can only occur once each time it is pressed. Otherwise the ladder is set up properly where it can only perform a connect operation if the socket isn't already connected.

Link to comment
Share on other sites

  • 2 weeks later...

I had to rearrange my logic a bit to get it to work with the positive transition triggerring the TCP/IP Connect function block. The attached code works perfectly and consistently......but only if I have both the laptop(with the DataExport running on it) and the V570 connected to office server.

If I connect directly from my laptop to the V570, I cannot get it to work at all. ( I tried a standard cat5e cable and also a cross-over cat5e cable)

If I connect everything to the office server (through a NetGear GS105 ethernet switch) it will work, even if I disconnect/reconnect the laptop.

If I disconnect the server from the switch, connection and data transfer still works fine, until the laptop is disconnected/reconnected. Before I can get it to work again, the server must be reconnected AND my wireless adapter has to be toggled from either OFF-ON or ON-OFF.

I don't think the issue is with the logic or settings in DataExport or in the V570. I think it is understanding the ip addressing/routing that is driving me nuts.

This probably isn't the right place for this discussion, but, if anyone can shed some light on the physical connection method / addressing, I would greatly appreciate it.CommTest.vlp

Link to comment
Share on other sites

Turns out that when I connected direct to the PLC, my laptop assigned the "network" as public and therefore the call was blocked by the firewall. When connected through the office network, it was considered "private" and therefore was not blocked. Adding DataExport to the "Incoming Rules" of the firewall, allowed me to make a direct connection.

Problem resolved!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...