Dave Posted October 8, 2015 Report Share Posted October 8, 2015 Hi. I would like to be able to trigger the DataExport call from my ladder logic (transfer data table info upon completion of a cure cycle). The cure cycles vary in duration and start time, so a scheduled call doesnt work. Is there a way to this? Link to comment Share on other sites More sharing options...
Alexander Posted October 15, 2015 Report Share Posted October 15, 2015 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 More sharing options...
Dave Posted October 17, 2015 Author Report Share Posted October 17, 2015 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. dave Link to comment Share on other sites More sharing options...
Dave Posted October 19, 2015 Author Report Share Posted October 19, 2015 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.? CommTest.vlp Link to comment Share on other sites More sharing options...
Alexander Posted October 26, 2015 Report Share Posted October 26, 2015 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 More sharing options...
Dave Posted November 8, 2015 Author Report Share Posted November 8, 2015 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 More sharing options...
Dave Posted November 13, 2015 Author Report Share Posted November 13, 2015 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 More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now