Replies: 22 comments
-
Can you share the error you receive when you try to use a callback? You should be able to do something like this without issue: logix5000.readTag('tagname', function(res) {
}); Async/await is syntax for writing asynchronous JavaScript and is built on top of promises. Here are a few links that cover async/await:
The node executive loop (event loop) is single threaded and will only process one function at a time, however, I/O runs on separate threads. This means you can run one asynchronous function, then run another ansynchronous function, then wait for both of them to finish. See the code example below: /**
* test1 requests the value of tag1 and waits for the response,
* then requests the value of tag2 and waits for the response
*/
async function test1() {
const promise1 = logix5000.readTag('tag1');
const value1 = await promise1;
const promise2 = logix5000.readTag('tag2');
const value2 = await promise2;
}
/**
* test2 requests the value of tag1, then requests the value of tag2,
* then waits for the response of tag1, then waits for the response of tag2.
* This may execute faster than test1 because while it is waiting for tag1's response, tag2's
* value has already been requested. It doesn't wait for tag1's response before requesting tag1's value.
*/
async function test2() {
const promise1 = logix5000.readTag('tag1');
const promise2 = logix5000.readTag('tag2');
const value1 = await promise1;
const value2 = await promise2;
} Use the Logix5000 layer on top of the TCP layer to communicate with Control-Logix and Compact-Logix PLCs. The code example is here. The documentation I followed for developing the Logix5000 layer is here. |
Beta Was this translation helpful? Give feedback.
-
I figured it out. Here is what I wrote ~/wic/plc2$ cat p2.js //---------------code---------------------
const { TCP, CIP } = require('node-drivers');
const tcpLayer = new TCP('192.168.100.174');
// with eip layer
// const eipLayer = new CIP.EIP(tcpLayer);
// const logix5000 = new CIP.Logix5000(eipLayer);
// w/o eip layer
const cipLayer = new CIP(tcpLayer);
const logix5000 = new CIP.Logix5000(tcpLayer);
console.log( new Date() )
logix5000.readTag('HMI_CC03_FULL[0]').then( (result) => {
console.log(new Date())
console.log(result);
}).catch( (error) => {
console.log(error);
}); ---output My comment: Is very slow, taking ~ 104ms
X_Rcv:~/wic/plc2$ echo "mread,0,hmi_cc03_jam[0]/hmi_cc03_full[0];"|nc localhost 9000 0:ok/13ms,MREAD,0,DINT:hmi_cc03_jam[0]=0/DINT:hmi_cc03_full[0]=1344; Q: Did you ever test speed of callbacks vs promises ? |
Beta Was this translation helpful? Give feedback.
-
@gman8a Your second example doesn't test the speed of using callbacks in this package and instead appears to be using using a different program. Can you try running the following code? This code first reads the tag using a promise and then reads the same tag using a callback. This still may not be a fair test because there might be some setup happening for the first read that the second read is able to take advantage of. const { TCP, CIP } = require('node-drivers');
const tcpLayer = new TCP('192.168.100.174');
const logix5000 = new CIP.Logix5000(tcpLayer);
const promiseStart = Date.now();
logix5000.readTag('HMI_CC03_FULL[0]').then(() => {
const promiseEnd = Date.now();
console.log('Time elapsed for promise:', promiseEnd - promiseStart);
const callbackStart = Date.now();
logix5000.readTag('HMI_CC03_FULL[0]', (err, result) => {
const callbackEnd = Date.now();
if (err) {
console.log('Error reading tag using callback', err);
} else {
console.log('Time elapsed for callback:', callbackEnd - callbackStart);
}
tcpLayer.close();
});
}).catch((err) => {
console.log('Error reading tag using promise', err);
tcpLayer.close();
}); |
Beta Was this translation helpful? Give feedback.
-
// output of your test program request: _Rcv:~/wic/plc2$ node p1.js 2021-10-15T18:18:10.022Z |
Beta Was this translation helpful? Give feedback.
-
So... What is the best code to get minimum overall time from application call to return value into application ? |
Beta Was this translation helpful? Give feedback.
-
I guess it it this, as programmed in your example to me. const callbackStart = Date.now();
logix5000.readTag('HMI_CC03_FULL[0]', (err, result) => {
const callbackEnd = Date.now();
if (err) {
console.log('Error reading tag using promise', err);
} else {
console.log('Time elapsed for callback:', callbackEnd - callbackStart);
}
tcpLayer.close();
}); |
Beta Was this translation helpful? Give feedback.
-
Interesting! Try running this as well and let me know the results: const { TCP, CIP } = require('node-drivers');
const tcpLayer = new TCP('192.168.100.174');
const logix5000 = new CIP.Logix5000(tcpLayer);
const callbackStart = Date.now();
logix5000.readTag('HMI_CC03_FULL[0]', (err, result1) => {
const callbackEnd = Date.now();
if (err) {
console.log('Error reading tag using callback', err);
} else {
console.log('Time elapsed for callback:', callbackEnd - callbackStart);
console.log(result1);
}
const promiseStart = Date.now();
logix5000.readTag('HMI_CC03_FULL[0]').then((result2) => {
const promiseEnd = Date.now();
console.log('Time elapsed for promise:', promiseEnd - promiseStart);
console.log(result2);
}).catch((err) => {
console.log('Error reading tag using promise', err);
}).finally(() => {
tcpLayer.close();
});
}); |
Beta Was this translation helpful? Give feedback.
-
HMI_CC03_FULL[0] ^^^^^^^^^^^^^ERROR FROM PREVIOUS RUN ABOVE ^^^^^^^^^^^ Rcv:~/wic/plc2$ node p1.js function f1(cnt){
let callbackStart = Date.now();
console.log('here ', cnt);
logix5000.readTag('HMI_CC03_FULL[0]', (err, result) => {
let callbackEnd = Date.now();
if (err) {
console.log('cnt:', cnt,' Error reading tag using promise', err);
} else {
console.log('cnt:', cnt, ' Time elapsed for callback:', callbackEnd - callbackStart);
}
});
}//fn
f1(1)
f1(2);
f1(3);
f1(4);
f1(5);
f1(6);
f1(7);
f1(8);
setTimeout( ()=>{
logix5000.close();
cipLayer.close();
tcpLayer.close();
process.exit();
}, 3000); |
Beta Was this translation helpful? Give feedback.
-
result of your last execution request Rcv:~/wic/plc2$ node p3.js |
Beta Was this translation helpful? Give feedback.
-
Based on the first test and the second test, the speeds of using callbacks and promises are identical. The reason the first read is slow in both tests is the stack has to establish the TCP connection, then the EIP connection, then the CIP connection, and then it executes the CIP read request. The second read uses the existing TCP/EIP/CIP connections and simply executes the read request. |
Beta Was this translation helpful? Give feedback.
-
...well in my last test w/ consecutive f1() calls, the elapsed times were around 100ms. |
Beta Was this translation helpful? Give feedback.
-
In your consecutive f1() test, you aren't really reading the tag 8 times consecutively. You are really queuing 8 requests to read the tag. To make your test read the tags consecutively, do this instead: function f1(cnt, cb) {
let callbackStart = Date.now();
console.log('here ', cnt);
logix5000.readTag('HMI_CC03_FULL[0]', (err, result) => {
let callbackEnd = Date.now();
if (err) {
console.log('cnt:', cnt, ' Error reading tag using promise', err);
} else {
console.log('cnt:', cnt, ' Time elapsed for callback:', callbackEnd - callbackStart);
}
if (typeof cb === 'function') cb();
});
}//fn
/** call f1(1) first */
f1(1, () => {
/** call f1(2) after f1(1) finishes */
f1(2, () => {
/** call f1(3) after f1(2) finishes */
f1(3, () => {
/** etc... */
f1(4, () => {
f1(5, () => {
f1(6, () => {
f1(7, () => {
f1(8);
});
});
});
});
});
});
});
setTimeout(() => {
logix5000.close();
cipLayer.close();
tcpLayer.close();
process.exit();
}, 3000); I expect you will see the following:
The first request takes the most time because the stack has to establish the connection to the PLC and then all the remaining requests take a short amount of time. You should also notice one of the drawbacks of using callbacks in the code above which some people refer to as "callback hell"! With async/await you could rewrite the code above as: async function f1(cnt) {
let callbackStart = Date.now();
console.log('here ', cnt);
try {
await logix5000.readTag('HMI_CC03_FULL[0]');
let callbackEnd = Date.now();
console.log('cnt:', cnt, ' Time elapsed for callback:', callbackEnd - callbackStart);
} catch (err) {
console.log('cnt:', cnt, ' Error reading tag using promise', err);
}
}//fn
(async () => {
/** call f1(1) first */
await f1(1);
/** call f1(2) after f1(1) finishes */
await f1(2);
/** call f1(3) after f1(2) finishes */
await f1(3);
/** etc... */
await f1(4);
await f1(5);
await f1(6);
await f1(7);
await f1(8);
})();
setTimeout(() => {
logix5000.close();
cipLayer.close();
tcpLayer.close();
process.exit();
}, 3000); |
Beta Was this translation helpful? Give feedback.
-
///output of your last program request follows _Rcv:~/wic/plc2$ node p4.js /plc2/p4.js:49 ReferenceError: cipLayer is not defined |
Beta Was this translation helpful? Give feedback.
-
Perfect! Does it make sense now? |
Beta Was this translation helpful? Give feedback.
-
...more than it did when i started. However my application looks like this:
|
Beta Was this translation helpful? Give feedback.
-
@gman8a I have moved the issue to a discussion since we addressed the initial question. Regarding your last message, the function readmytag is not valid JavaScript. Can you share more of your code? I might be able to infer what you are trying to do and provide suggestions. |
Beta Was this translation helpful? Give feedback.
-
Justin, /////////// CODE BEGIN
const { TCP, CIP } = require('node-drivers');
const tcpLayer = new TCP('192.168.100.174');
const logix5000 = new CIP.Logix5000(tcpLayer);
//way 1
function plc_read(tag, callback){
logix5000.readTag( tag, (err, value) => {
callback( {tagName: tag, tagValue: value, message: value, err:err});
});
}//fn
//way 2
function plc_read2(tag){
logix5000.readTag( tag, (err, value) => {
process_handler({process:'DINT', how:'plc_read2', tagName: tag, tagValue: value, message: value, err:err});
});
}//fn
//way3
async function plc_read3(tag){
try{
let value = (await logix5000.readTag(tag));
process_handler({process:'DINT', how:'plc_read3', tagName: tag, tagValue: value, message: value, err:null});
}
catch(err){
process_handler({process:'DINT', how:'plc_read3', tagName: tag, tagValue: 0, message: 0, err:'promise err: '+err});
}
}//fn
function process_handler(data){
let process_name=data.process;
switch(process_name){
case 'DINT':{
console.log(data)
}
break;
}//sw
}//fn
///////////////// MAIN LINE ///////////////
setTimeout( ()=>{
logix5000.close();
//cipLayer.close();
tcpLayer.close();
process.exit();
}, 5000)
var tag_list = [
'HMI_CC03_FULL[0]',
'HMI_CC03_FULL[1]',
'HMI_CC03_JAM[0]',
'HMI_CC03_JAM[1]',
'HMI_CC03_PE[0]',
'HMI_CC03_PE[1]',
];
// WAY 1, with callback handled here
// way 2, with callback handled in common func. process_handler()
// way 3, with callback handled in common func. process_handler(); using await low level drive
let way=3;
for(let i=0;i<tag_list.length;i++)
switch(way){
case 1: plc_read(tag_list[i], (data)=>{ console.log(data);}); break;
case 2: plc_read2(tag_list[i]); break;
case 3: plc_read3(tag_list[i]); break;
}//sw
//end-of-file
///////// CODE END issue #1 the code has 3 ways of operating. all 3 ways will not return all the requests.For example an output of way 3, is missing the first request for FULL[0]; {
process: 'DINT',
how: 'plc_read3',
tagName: 'HMI_CC03_FULL[1]',
tagValue: 0,
message: 0,
err: null
}
{
process: 'DINT',
how: 'plc_read3',
tagName: 'HMI_CC03_JAM[0]',
tagValue: 0,
message: 0,
err: null
}
{
process: 'DINT',
how: 'plc_read3',
tagName: 'HMI_CC03_JAM[1]',
tagValue: 0,
message: 0,
err: null
}
{
process: 'DINT',
how: 'plc_read3',
tagName: 'HMI_CC03_PE[0]',
tagValue: 301537983,
message: 301537983,
err: null
}
{
process: 'DINT',
how: 'plc_read3',
tagName: 'HMI_CC03_PE[1]',
tagValue: 67583,
message: 67583,
err: null
} issue #2: successive opening of the the low-level cip sockets fail.I think you need to do something like follows (python coded) with cid and vsn attributes (sourced from pycomm) def open(self, ip_address, direct_connection=False):
"""
socket open
:param: ip address to connect to and type of connection. By default direct connection is disabled
:return: true if no error otherwise false
"""
# set type of connection needed
self.__direct_connections = direct_connection
# handle the socket layer
if not self._connection_opened:
try:
if self.__sock is None:
self.__sock = Socket()
self.__sock.connect(ip_address, self.attribs['port'])
self._connection_opened = True
self.attribs['ip address'] = ip_address
self.generate_cid() #<----------- HERE
self.generate_vsn() #<------ and HERE
if self.register_session() is None:
self._status = (13, "Session not registered")
return False
# not sure but maybe I can remove this because is used to clean up any previous unclosed connection
self.forward_close()
return True
except Exception as e:
# self.clean_up()
raise CommError(e)
def close(self):
"""
socket close
:return: true if no error otherwise false
"""
error_string = ''
try:
if self._target_is_connected:
self.forward_close()
if self._session != 0:
self.un_register_session()
except Exception as e:
error_string += "Error: inFn cip_base.close() -> session Err: %s" % e.message
logger.warning(error_string)
# %GLA must do a cleanup __sock.close()
try:
if self.__sock:
self.__sock.close()
except Exception as e:
error_string += "; Error: inFn cip_base.close() -> __sock.close Err: %s" % e.message
logger.warning(error_string)
self.clean_up()
if error_string:
raise CommError(error_string)
def generate_cid(self):
self.attribs['cid'] = '{0}{1}{2}{3}'.format(chr(random.randint(0, 255)), chr(random.randint(0, 255))
, chr(random.randint(0, 255)), chr(random.randint(0, 255)))
def generate_vsn(self):
self.attribs['vsn'] = '{0}{1}{2}{3}'.format(chr(random.randint(0, 255)), chr(random.randint(0, 255))
, chr(random.randint(0, 255)), chr(random.randint(0, 255))) |
Beta Was this translation helpful? Give feedback.
-
Justin, |
Beta Was this translation helpful? Give feedback.
-
In the code: ~/node-drivers-master/src/layers/cip/core/objects$ head -n30 ConnectionManager.js 'use strict';
// EIP-CIP-V1 3.5, page 3-53
const { InvertKeyValues } = require('../../../../utils');
const { ClassCodes } = require('../constants');
const CIPRequest = require('../request');
const EPath = require('../epath');
let ConnectionSerialNumberCounter = 0x0001;
let OtoTNetworkConnectionIDCounter = 0x20000002;
let TtoONetworkConnectionIDCounter = 0x20000001;
function incrementConnectionCounters() {
ConnectionSerialNumberCounter++;
OtoTNetworkConnectionIDCounter++;
TtoONetworkConnectionIDCounter++;
} |
Beta Was this translation helpful? Give feedback.
-
@gman8a Regarding issue 1, my guess is you are closing the connection before all requests are finished responding. Try the following code and see if all tags are read: const { TCP, CIP } = require('node-drivers');
const tcpLayer = new TCP('192.168.100.174');
const logix5000 = new CIP.Logix5000(tcpLayer);
function processHandler(data) {
const processName = data.process;
switch (processName) {
case 'DINT': {
console.log(data);
break;
}
default:
}
}
async function plcRead3(tag) {
try {
const value = await logix5000.readTag(tag);
processHandler({
process: 'DINT',
how: 'plc_read3',
tagName: tag,
tagValue: value,
message: value,
err: null,
});
} catch (err) {
processHandler({
process: 'DINT',
how: 'plc_read3',
tagName: tag,
tagValue: 0,
message: 0,
err: 'promise err: ' + err,
});
}
}
const tagList = [
'HMI_CC03_FULL[0]',
'HMI_CC03_FULL[1]',
'HMI_CC03_JAM[0]',
'HMI_CC03_JAM[1]',
'HMI_CC03_PE[0]',
'HMI_CC03_PE[1]',
];
(async () => {
for (let i = 0; i < tagList.length; i++) {
await plcRead3(tagList[i]); // way 3, with callback handled in common func. process_handler(); using await low level drive
}
await tcpLayer.close();
})(); Regarding issue 2, I'm looking into this. I'd like to avoid randomizing the connection identifiers as that leaves the connection resources open on the target until they timeout. This library should properly clean up connections and be able to handle existing connections that didn't clean up properly. If I am unable then I will randomize the connections. |
Beta Was this translation helpful? Give feedback.
-
Your code works properly !
All 3 of my functions plc_read() and plc_read2() and plc_read_3()
always drop the first tag out.
…----output
/plc2$ node p6
{
process: 'DINT',
how: 'plc_read3',
tagName: 'HMI_CC03_FULL[0]',
tagValue: 1344,
message: 1344,
err: null
}
{
process: 'DINT',
how: 'plc_read3',
tagName: 'HMI_CC03_FULL[1]',
tagValue: 0,
message: 0,
err: null
}
{
process: 'DINT',
how: 'plc_read3',
tagName: 'HMI_CC03_JAM[0]',
tagValue: 0,
message: 0,
err: null
}
{
process: 'DINT',
how: 'plc_read3',
tagName: 'HMI_CC03_JAM[1]',
tagValue: 0,
message: 0,
err: null
}
{
process: 'DINT',
how: 'plc_read3',
tagName: 'HMI_CC03_PE[0]',
tagValue: 569973439,
message: 569973439,
err: null
}
{
process: 'DINT',
how: 'plc_read3',
tagName: 'HMI_CC03_PE[1]',
tagValue: 67583,
message: 67583,
err: null
}
On Tue, Oct 19, 2021 at 10:07 AM Justin Moser ***@***.***> wrote:
@gman8a <https://github.com/gman8a> Regarding issue 1, my guess is you
are closing the connection before all requests are finished responding. Try
the following code and see if all tags are read:
const { TCP, CIP } = require('node-drivers');
const tcpLayer = new TCP('192.168.100.174');const logix5000 = new CIP.Logix5000(tcpLayer);
function processHandler(data) {
const processName = data.process;
switch (processName) {
case 'DINT': {
console.log(data);
break;
}
default:
}}
async function plcRead3(tag) {
try {
const value = await logix5000.readTag(tag);
processHandler({
process: 'DINT',
how: 'plc_read3',
tagName: tag,
tagValue: value,
message: value,
err: null,
});
} catch (err) {
processHandler({
process: 'DINT',
how: 'plc_read3',
tagName: tag,
tagValue: 0,
message: 0,
err: 'promise err: ' + err,
});
}}
const tagList = [
'HMI_CC03_FULL[0]',
'HMI_CC03_FULL[1]',
'HMI_CC03_JAM[0]',
'HMI_CC03_JAM[1]',
'HMI_CC03_PE[0]',
'HMI_CC03_PE[1]',];
(async () => {
for (let i = 0; i < tagList.length; i++) {
await plcRead3(tagList[i]); // way 3, with callback handled in common func. process_handler(); using await low level drive
}
await tcpLayer.close();})();
Regarding issue 2, I'm looking into this. I'd like to avoid randomizing
the connection identifiers as that leaves the connection resources open on
the target until they timeout. This library should properly clean up
connections and be able to handle existing connections that didn't clean up
properly. If I am unable then I will randomize the connections.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#7 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGNHFF5IC4YFEEKCJML4RNLUHV3SPANCNFSM5GCVYIPA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Beta Was this translation helpful? Give feedback.
-
/*
/// **** THIS WORKS w/o lost tags results ***
(async () => {
for (let i = 0; i < tagList.length; i++) {
await plcRead3(tagList[i]); // way 3, with callback handled in common
func. process_handler(); using await low level drive
}
await tcpLayer.close();
})();
*/
Sorry for being confused. I am trying to figure out how my app does a
single read.
more tests results follow; notice the first tag out is lost.
Is the connection auto closed somehow ? i.e. not persistent.
(async ()=> { await plcRead3('HMI_CC03_FULL[0]'); await console.log('done
1'); })();
(async ()=> { await plcRead3('HMI_CC03_FULL[1]'); await console.log('done
2'); })();
(async ()=> { await plcRead3('HMI_CC03_JAM[0]'); await console.log('done
3'); })();
(async ()=> { await plcRead3('HMI_CC03_JAM[1]'); await console.log('done
4'); })();
/*---output
{
process: 'DINT',
how: 'plc_read3',
tagName: 'HMI_CC03_FULL[1]',
tagValue: 0,
message: 0,
err: null
}
done 2
{
process: 'DINT',
how: 'plc_read3',
tagName: 'HMI_CC03_JAM[0]',
tagValue: 0,
message: 0,
err: null
}
done 3
{
process: 'DINT',
how: 'plc_read3',
tagName: 'HMI_CC03_JAM[1]',
tagValue: 0,
message: 0,
err: null
}
*/
////////// another try //////
(async ()=> { await plcRead3('HMI_CC03_FULL[0]'); })();
(async ()=> { await plcRead3('HMI_CC03_FULL[1]'); })();
(async ()=> { await plcRead3('HMI_CC03_JAM[0]'); })();
(async ()=> { await plcRead3('HMI_CC03_JAM[1]'); })();
/*--output
{
process: 'DINT',
how: 'plc_read3',
tagName: 'HMI_CC03_FULL[1]',
tagValue: 0,
message: 0,
err: null
}
{
process: 'DINT',
how: 'plc_read3',
tagName: 'HMI_CC03_JAM[0]',
tagValue: 0,
message: 0,
err: null
}
{
process: 'DINT',
how: 'plc_read3',
tagName: 'HMI_CC03_JAM[1]',
tagValue: 0,
message: 0,
err: null
}
*/
On Tue, Oct 19, 2021 at 11:34 AM Gary Argraves ***@***.***>
wrote:
… Your code works properly !
All 3 of my functions plc_read() and plc_read2() and plc_read_3()
always drop the first tag out.
----output
/plc2$ node p6
{
process: 'DINT',
how: 'plc_read3',
tagName: 'HMI_CC03_FULL[0]',
tagValue: 1344,
message: 1344,
err: null
}
{
process: 'DINT',
how: 'plc_read3',
tagName: 'HMI_CC03_FULL[1]',
tagValue: 0,
message: 0,
err: null
}
{
process: 'DINT',
how: 'plc_read3',
tagName: 'HMI_CC03_JAM[0]',
tagValue: 0,
message: 0,
err: null
}
{
process: 'DINT',
how: 'plc_read3',
tagName: 'HMI_CC03_JAM[1]',
tagValue: 0,
message: 0,
err: null
}
{
process: 'DINT',
how: 'plc_read3',
tagName: 'HMI_CC03_PE[0]',
tagValue: 569973439,
message: 569973439,
err: null
}
{
process: 'DINT',
how: 'plc_read3',
tagName: 'HMI_CC03_PE[1]',
tagValue: 67583,
message: 67583,
err: null
}
On Tue, Oct 19, 2021 at 10:07 AM Justin Moser ***@***.***>
wrote:
> @gman8a <https://github.com/gman8a> Regarding issue 1, my guess is you
> are closing the connection before all requests are finished responding. Try
> the following code and see if all tags are read:
>
> const { TCP, CIP } = require('node-drivers');
> const tcpLayer = new TCP('192.168.100.174');const logix5000 = new CIP.Logix5000(tcpLayer);
> function processHandler(data) {
> const processName = data.process;
>
> switch (processName) {
> case 'DINT': {
> console.log(data);
> break;
> }
> default:
> }}
> async function plcRead3(tag) {
> try {
> const value = await logix5000.readTag(tag);
> processHandler({
> process: 'DINT',
> how: 'plc_read3',
> tagName: tag,
> tagValue: value,
> message: value,
> err: null,
> });
> } catch (err) {
> processHandler({
> process: 'DINT',
> how: 'plc_read3',
> tagName: tag,
> tagValue: 0,
> message: 0,
> err: 'promise err: ' + err,
> });
> }}
> const tagList = [
> 'HMI_CC03_FULL[0]',
> 'HMI_CC03_FULL[1]',
> 'HMI_CC03_JAM[0]',
> 'HMI_CC03_JAM[1]',
> 'HMI_CC03_PE[0]',
> 'HMI_CC03_PE[1]',];
> (async () => {
> for (let i = 0; i < tagList.length; i++) {
> await plcRead3(tagList[i]); // way 3, with callback handled in common func. process_handler(); using await low level drive
> }
> await tcpLayer.close();})();
>
> Regarding issue 2, I'm looking into this. I'd like to avoid randomizing
> the connection identifiers as that leaves the connection resources open on
> the target until they timeout. This library should properly clean up
> connections and be able to handle existing connections that didn't clean up
> properly. If I am unable then I will randomize the connections.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#7 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AGNHFF5IC4YFEEKCJML4RNLUHV3SPANCNFSM5GCVYIPA>
> .
> Triage notifications on the go with GitHub Mobile for iOS
> <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
> or Android
> <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
>
>
|
Beta Was this translation helpful? Give feedback.
-
Justin,
Questions
"node-drivers" use to work with a callback in the read Tag call.
Is this not possible any more?
I am not sure what "await" does. Does the node executive loop process other functions while waiting ?
Beta Was this translation helpful? Give feedback.
All reactions