tomcx / tame4

JS library for the access to a TwinCAT PLC. Current version V4.3.1 final.
GNU General Public License v3.0
44 stars 8 forks source link

XMLHttpRequest timed out #21

Closed mdiflorio closed 5 years ago

mdiflorio commented 5 years ago

Hi there, I apologise if this is really simple to solve. However, I can't manage to get the examples working.

I'm using TwinCat 3. I've created the ADS server and it works. This can be confirmed as I'm able to run a PLC application using Beckhoff's HMI in Visual Studio, connecting to the PLC variables.

I've copied the Tamex file into the IIS virtual directory and I access the site through localhost.

This is my webService setup.

function startClient(handles) {
    Plc =  TAME.WebServiceClient.createClient({
        serviceUrl: 'http://localhost/TcAdsWebService/TcAdsWebService.dll',
        //configFileUrl: 'http://192.168.1.2/tamex/resources/demo2.tpy',  //Path to the TPY file
        amsNetId: '172.16.0.23.1.1',
        amsPort: '851',       //default
        useHandles: handles,    //use handles
        alignment: '8',       //default, set it to "4" if you have TC2 and an ARM based PLC device (i.e. CX90xx), to 8 with TC3
        //language: 'ge',       //default, set it to "en" for english names of days and months
        onReady: loadExample    //this function is defined in each example
    });
}

And, I've tried various of other combinations. However, I still get XMLHttpRequest always returns an error Status code : 0 and I'm not able to access any of the variables (Read or write) within your examples.

If you could point me in the right direction, that would be greatly appreciated!

Thanks!

You can see my NetID here. image

image

image

image

tomcx commented 5 years ago

Strange. It stucks trying to fetch the symbols from the PLC. To me it's definitely a problem with the web connection, not with ADS. The setup seems to be OK. The only thing thats a little bit weird is the picture of the tcadswebservice.dll. On all my systems the port number is 32xxx, not 1. I've just set up a TC3 test system, TAME works (besides a small bug with the 1st BOOL variable in the demo).The port number of the tcadswebservice.dll is 33224.

tomcx commented 5 years ago

Could you solve your problem?

mdiflorio commented 5 years ago

Sorry, I apologise for the late response and thank you for your reply.

Unfortunately, I only have access to the PC running TwinCAT at school and was only able to try things out for a couple of minutes a couple of weeks ago.

I was still unable to get it working. However I believe you're right, I think there is something wrong with the web connection. That being said, I was unable to fix the issue of the port number. I followed the steps outlined here. But, always had the same result.

If you have any ideas, that would be great. Using Beckhoff's HMI is a misery.

tomcx commented 5 years ago

Unfortunately I have no clue. It seems like the webservice is not running properly, but if you have followed all the steps I have no idea what else could be done. You could contact the Beckhoff support, maybe they know whats the reason for the port number of "1" and give you a hint.

tomcx commented 5 years ago

I've contacted the Beckhoff support. They said a port number "1" is totally wrong and recommended the reinstallation of the webservice according to the documentation. But that's what you have done, so nothing new here.

mdiflorio commented 5 years ago

@tomcx Thanks a heap for all your help! I'm going to give it another go, but from what it seems I won't have access to TwinCAT for a while.

Feel free to close the issue, I'm sure this is the problem.

originals commented 4 years ago

i had the same problem timeout and port: 1

i forgot the following step with configuring iis: Double-click the "Authentication" icon, select "Anonymous Authentication" and click on "Edit". Instead of specifying a user account, select the "Application pool identity" and click on "Ok".