Git Product home page Git Product logo

tame4's People

Contributors

kimbrerfesten avatar tomcx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tame4's Issues

TAME with angular2

Hello,

Thanks for a great library!
My previous project built with Jquery. Today I have migrate the project to angular2 framework.
There is a problem trying to read arrays or structs. I have followed your documentation but couldn't resolve the issue. Any idea what can be the problem?

iOS Support

Hello!
for me it seems that on iOS devices the onready function isn't called. Could you please habe a look on it.

XMLHttpRequest timed out

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

No values from TwinCat 3.1

Hello,
first many thanks for your great work!

I try with Tame 4.0.1 to connect a variable from TwinCat 3.1 (CX9020) and show
the values in an apache cordova android app. (With TwinCat 2.11 it works)
The connection works. Unfortunately i get no value from plc (MAIN.Ramp1).
Code:
`
(webservice.js)
var Plc;

function startClient(handles) {

Plc =  TAME.WebServiceClient.createClient({
    serviceUrl: 'http://192.168.1.88/TcAdsWebService/TcAdsWebService.dll',
    amsNetId: '192.168.1.88.1.1',
    amsPort:   '851',      
    alignment: '8',      
    language: 'en',    
    onReady: dataconnection   
});

}

(demo.js)
Plc.sumReadReq({
id: 1,
items: [
{
name: 'MAIN.Ramp1',
jvar: 'ai_flow.data'
}
],
oc: function() {

        }
    });

`

Still needs anything set in the webservice.js like typ paht?
Thanks, regards
Daniel

Ensure correct order of struct members

Hi and thanks for this great library!

I've noticed that the members of a structure are stored in an object. The library seems to rely on the order of the object's properties.
However, according to these two Stack Overflow questions the correct iteration order of an object is not guaranteed, especially if a "for...in" loop is used (even if used with arrays).

At least there seems to be some consistency across current major browsers regarding the order of object properties. As far as I know, this isn't the case for "for...in" loops.

This could be a major problem as the data for reading/writing structs might be completely wrong if a browser with untested behaviour is used.
Do you have any plans on making the creation of structs "waterproof" (maybe by using an array with names of the struct members)?

Using handles

Hi,

First of all thanks for a great library!
I wanted to ask about how to use handles. I have structs inside structs and also struct that contain array of structs. I've used the manual but could not get it right. Can you provide a little example please?

Thanks and keep up the good job!

Direct link to command

Hi Tom, is there a way to invoke commands trough a specific URL. I'm experimenting with linking Tame to Siri shortcuts, my way of doing so would be to invoke commands directly trough the URL.

HTTP access control

Hi,

I'm testing TAME4 on different hardware/possibilities.

Connecting remotely to
CX5130 / CX9020

Connecting TAME4 to ADS on CX9020 I run into the HTTP access control and pre-flight errors.
On a CX5130 with windows embedded standard 7 you can add the needed headers into IIS and everything is running fine.

The CX9020 running windows embedded compact I see no possibility to add the needed headers somewhere.
As I am not a javascript expert I had no luck trying xdomain or any proxy possibility to bypass this issue.

Do you see any resolution to this?

Great work!

Bryan

Cannot process the values in oc at polling

Hi,
We created our web service and constructed a polling structure. When we watch the polled values on browser's inspect element, we can see their values as true or false but in the if statements in oc function the variables are not processed as they suppose to. As an example:

oc: function() {
if (s_B2D_k === true) {document.getElementById('field_s_B2D').style.backgroundColor = 'red';}
else if(s_B2D_y===true) {document.getElementById('field_s_B2D').style.backgroundColor = 'green';}
else if(s_B2D_s===true) {document.getElementById('field_s_B2D').style.backgroundColor = 'yellow';}
else {document.getElementById('field_s_B2D').style.backgroundColor = 'orange';}
}

since we see s_B2D_k as true on the inspection the element background color becomes orange for some reason and when I try to show the s_B2D_k's value on window.alert() in oc:function() it says "undefined". Also there are a lot of warnings comes from tame.js and TcAdsWebService.dll which is not explaining any issue properly but it says "Request Dropped". Also if it means anything, we are not connected to Internet when we run the program, we are just connected to PLC. We can send you the files if it is necessary..

Can you help? Any suggestions?

Variable values does not change

``var Plc;
function startClient() {
Plc = TAME.WebServiceClient.createClient({
serviceUrl: 'http://192.168.1.150/TcAdsWebService.dll',
//configFileUrl: 'http://192.168.1.2/tamex/resources/demo2.tpy', //Path to the TPY file
amsNetId: '5.22.187.194.1.1',
amsPort: '801', //default
// useHandles: handles, //use handles
alignment: '4', //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: test //this function is defined in each example
});
}
function test()
{

Plc.writeBool({name:"MAIN.Licht_Hobby1", val: true});

}``
I can read the values but when i modify the variable value it shows me no error but does not changes its value.

Chrome Warning

Hello!

Chrome is giving me following warning:

Subresource requests whose URLs contain embedded credentials (e.g. https://user:pass@host/) are deprecated, and will be blocked in M59, around June 2017. See https://www.chromestatus.com/feature/5669008342777856 for more details.
J @ tame.js:11
TAME.WebServiceClient @ tame.js:11
TAME.WebServiceClient.createClient @ tame.js:11

What to do?

Usage of tame4 in nodejs

Hi tomcx! First of all, you made a great job!! I think Tame4 is really useful and makes things much more easy with respect to the JS WebService offered by Twincat.

I have a question for you, if you can help.

Would you suggest a way to use your library in a NodeJS application? When it comes to function calls made directly from the browser there is no problem, but I would like to create a server that offers a REST API in NodeJS, so that at each request against the REST endpoint the server can call a Tame4 function to retrieve data from Twincat.

The problem is that, as I have seen, Tame4 is "browser" based: it relies in XmlHttpRequests and "window" calls, for instance, and I cannot use them in a "nodejs" environment..

Hope you understood my doubts and maybe can give me some hints :)

Nicola

TPY-parser

Hello!

I have a Problem with the tpy-Parser, when I include the M-Bus lib.
I've figured out that the problem must be at this datatype (at subitem pcomin)

FB_KL6781WriteRegisters 528 TIME_OUT_VALUE TIME 32 0 REGISTERNUMBERMASK BYTE 8 32 REGISTERWRITEMASK BYTE 8 40 state INT 16 48 TriggerExecute R_TRIG 24 64 NumRegisters UINT 16 88 n UINT 16 104 Register BYTE 8 120 Value WORD 16 128 Timeout TON 120 144 pCTRL BYTE 32 264 pSTATUS BYTE 32 296 SaveCTRL BYTE 8 328 Execute BOOL 8 336 Mode E_KL6781ComSerialLineMode 16 344 pComIn ARRAY [0..65] OF BYTE 32 360 pComOut ARRAY [0..65] OF BYTE 32 392 SizeComIn UINT 16 424 pRegisterList ARRAY [0..63] OF ST_KL6781ComRegisterData 32 440 SizeRegisterList UINT 16 472 Done BOOL 8 488 Busy BOOL 8 496 Error BOOL 8 504 ErrorId E_KL6781ComError 16 512 316 317

Please have a look at it.

Error when connection lost

Hello,
is there a way to get an error when connection to plc is lost or a Reconnect function or any idea to solve it?
Many thanks
Daniel

TPY, example

Hi, first off really awesome library you have put together here.
Much easier to work with than the stuff Beckhoff put together.

One request.
Is it possible to make a small example to demonstrate the advantages of using the tpy file as described in the readme?
Digging in the source did not give me much.

Best regards

Some crippling syntax error in WinCE IE, fix inc.

Hey! This package is a gift from heavens for my new project, I was set out to do something similar by myself, but now that I see how much stuff is involved with this I'm very glad I didn't have to do that part of the project.

With the initial tests, I noticed that when I try to connect with WinCE own version of Internet Explorer, it crashes with errors. I was able to find and fix the said errors and I'm glad to find out it works (more or less) in the CE Internet Explorer too. This is important for me because I use the Beckhoff Control Panel CP6606 in my project and I would like to access the site locally too.

I'm new to GitHub and web development in general so I'm not sure about branching nor how to package the .tame.js as you've done but I was able to debug and correct by replaceing that tame.js with tame-with-comments.js.

The 'error' was that the IE of WinCE can't handle var { } where the last entry was commented out, resulting in "," being the last character of the code inside brackets. There was I think 3 iterations of those and 1 which had "," without any commented section afterwards .

Thanks a bunch for letting us use this!

How change amsPort?

In your library the amsPort has to be in the range (801-891) but mi IIS assign me the port 35347. So when I try to run the example I have the next error: "TAME library error: AMS Port Number (35347) is out of range (801-891)!" @tomcx

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.