Professional OPC
Development Tools

logos

Node.JS Projects???

More
07 Nov 2015 13:02 #3646 by support
Replied by support on topic Node.JS Projects???
Unfortunately not, I have to admit it is not high on the priority list.

Best regards

Please Log in or Create an account to join the conversation.

More
06 Nov 2015 17:15 #3645 by steveebling
Replied by steveebling on topic Node.JS Projects???
Any progress with Node.js integration and subscriptions?

Please Log in or Create an account to join the conversation.

More
02 Sep 2014 15:15 #2210 by support
Replied by support on topic Node.JS Projects???
Thank you

Zbynek

Please Log in or Create an account to join the conversation.

More
02 Sep 2014 08:06 #2209 by giles
Replied by giles on topic Node.JS Projects???
Maybe also take a look at Edge.js - lets you mix in c# code to node js

www.hanselman.com/blog/ItsJustASoftwareIssueEdgejsBringsNode...TTogetherOnThreePlatforms.aspx

Please Log in or Create an account to join the conversation.

More
16 May 2014 12:36 #1967 by support
Replied by support on topic Node.JS Projects???
Alright, then let's leave the subscriptions aside. Regarding the arrays, can we close it assuming that you will try to add the arrays to win32ole, but if that doesn't work out, let us know so that we can plan for a different resolution?

Please Log in or Create an account to join the conversation.

More
13 May 2014 12:07 #1964 by dlbrown06
Replied by dlbrown06 on topic Node.JS Projects???
1. - I was actually thinking about forking this project and updating it to support the VARIANT arrays. It looks like in their c code that they have everything stubbed out for it, just the support needs added.

2 - I'm okay with the subscriptions not being supported right now. NodeJS has some handy functionality to create events that are trigger when items may change based on polling the items.

The language is IO event driven and non-blocking which lends itself perfectly for applications using your COM object with PLC applications.So far with just using the read/write methods, the functionality is working quite well.

Please Log in or Create an account to join the conversation.

More
13 May 2014 07:15 - 13 May 2014 07:17 #1962 by support
Replied by support on topic Node.JS Projects???
Thank you. There are two things here.

1. Working with multiple items.

It is kind of hard to do something alike, if arrays are not supported. I think we already have had a request like this once, coming from some kind of different programming environment, but with a similar limitation. The best way, of course, would be if win32ole is extended to support arrays in VARIANTs. In my view, it should not be too difficult, but it is not something that we can or want to do.

The other solution we have contemplated was to simulate the arrays using something else. The current thinking is that we may support a use of "Scripting.Dictionary" objects ( msdn.microsoft.com/en-us/library/x4k5wbx4(v=vs.84).aspx ) in place of input and output (result) arrays. We would allow integer (or even arbitrary) keys to serve the purpose of array indices.

You should be able to create Scripting.Dictionary using win32ole, and then access its methods to get and set the elements in the dictionary. Do you think it would work on your side? If so, however, this is something we cannot do quickly. It'll have to be put into the development plan, with earliest chance to see it in production something like October/November 2014.

2. Subscriptions.

This depends on win32ole again, and is, in fact, much more difficult to do, so I am not surprised it is not supported in the current version of it. We need a support for connection points/events/outgoing interfaces in OLE automation. It should be doable as well, but with a larger effort in the win32ole area.

So I am rather pessimistic about whether win32ole will ever have this kind of support - but you need to figure out with the authors to see if this is truly the case.

From the very beginnings of the EasyOPC component, we have, however, anticipated usage scenarios where subscriptions are not feasible. An example of it might be a Web app with just HTTP connection that is periodically asking the Web server for OPC data. The EasyOPC component internally sets up a an OPC subscription when there is a (periodic) Read detected, and then it tries to maintain that subscription at a suitable update rate. Subsequent reads, if/when they come at the right time, do not physically hit the OPC server, but are server valued from the component's "memory" instead. There are also some parameters to tweak this behavior. The disadvantage is that you do not get full control of the internal subscriptions, and guarantees of the update rate etc.; but at least you get the most of the performance benefits associated with using OPC subscriptions versus calling OPC Reads periodically.

Of course your need may be to have "real" subscription - I do not know how the above fits your scenario.

Please let me know your thoughts.
Last edit: 13 May 2014 07:17 by support.

Please Log in or Create an account to join the conversation.

More
12 May 2014 19:14 #1960 by dlbrown06
Replied by dlbrown06 on topic Node.JS Projects???
Sure, here is the github project: https://github.com/idobatter/node-win32ole

This code will write to the console the value of tag1 every time it changes. This is tested and works. I would LOVE if this module worked with multiple item reads/writes though. I also haven't figured out how to get it working with subscriptions.
var win32ole = require('win32ole');
var Opc = win32ole.client.Dispatch('OPCLabs.EasyDAClient.5.2');
var val = -1;
var tmp = -2;
 
setInterval(function () {
	tmp = Opc.ReadMultipleItemValues('', 'Kepware.KEPServerEX.V5', 'Channel_1.Device_1.tag1');
	if (val !== tmp) {
		console.log(tmp);
		val = tmp;
	}
 
}, 100);

Please Log in or Create an account to join the conversation.

More
08 May 2014 07:34 #1949 by support
Replied by support on topic Node.JS Projects???
Thanks for raising an interesting topic.

From OPC Labs side, we currently do not have much (if anything) on this (Node.JS). I would be happy to hear what the obstacles and requirements are. We have already met with a problem of using arrays, and have contemplated adding a support for arrays to be replaced by dictionary objects.

Which language are you interested in using? Is that JavaScript directly?

Can you point me to the documentation of the win32ole module you mentioned? I would like to evaluate whether there is something that can be used for subscriptions.

Also, do I understand it correctly that you have a made a kind of "Hello World" solution with QuickOPC.COM in Node.js, with at least reading a single tag, and that it works? - but you are looking for efficient ways of expanding it?

Best regards

Please Log in or Create an account to join the conversation.

More
07 May 2014 14:30 #1940 by dlbrown06
Has anyone out there started any projects using this COM object with Node.JS? It seems to be the hot new language all the cool kids are using. :D

I started one using the win32ole node module to communicate to the EasyOPC com object, but that module doesn't support parameters that are arrays as of yet, so that means that read/writing multiple tags is out of the question using that out of the box.

Also I'm not sure how subscriptions would work either in that environment.

I would love to hear if anyone else has tried doing anything like this and if there are any examples out there.

Please Log in or Create an account to join the conversation.

Moderators: support
Time to create page: 0.228 seconds

      

 Recommend this on Google