TCP Request Node - Return Options

332 views
Skip to first unread message

J Dudley

unread,
May 24, 2017, 10:44:51 AM5/24/17
to Node-RED
I use a lot of lab devices, such as precision DC power supplies, that are based on the SCPI (Standard Commands for Programmable Instruments) protocol.

It is much faster (more efficient) to send a bunch of queries to one of these devices separated by their designated command end character(s) (often '\n', '\r' or '\r\n') and it will return the query results separated by the designated response end character(s). The way the TCP Request Node is setup there is no way to take advantage of this... but if there was a way to check for a count of the end characters (instead of just a single end character) it would work great.

Is this something that could be considered for a future update to the TCP Request Node?

Dave C-J

unread,
May 24, 2017, 10:49:23 AM5/24/17
to node...@googlegroups.com
Interesting thought. Can the node be set into "keep connection open" mode and then do the split in a following node ?

J Dudley

unread,
May 24, 2017, 10:59:31 AM5/24/17
to Node-RED
Yes, it can certainly be done but a counter built into the TCP Request Node would be a very clean and simple solution.

Dave C-J

unread,
May 24, 2017, 11:04:42 AM5/24/17
to node...@googlegroups.com
then you have to configure the counter....
and the split node can already split on a character :-)

However is it the same as this ? https://www.npmjs.com/package/visa32 - may be a complete wrapper for that into a Node-RED node would actually be better (if is is the correct thing...)

Dave C-J

unread,
May 24, 2017, 11:07:56 AM5/24/17
to node...@googlegroups.com
Ah... though that is Windows only.... uurgh.

J Dudley

unread,
May 24, 2017, 1:44:47 PM5/24/17
to Node-RED
I still think the counter would be a handy, simple & clean option... especially if you would like to close the TCP connection after your queries are complete.

I really appreciate the feedback and the thought process on additional approaches though :)

J Dudley

unread,
May 24, 2017, 1:46:08 PM5/24/17
to Node-RED
That is too bad because NI (National Instruments) offers their VISA SCPI driver for Linux & Mac OS X too.

Dave C-J

unread,
May 24, 2017, 2:13:26 PM5/24/17
to node...@googlegroups.com
Ah - may well be worth a try then... 

Dave C-J

unread,
May 24, 2017, 2:29:13 PM5/24/17
to node...@googlegroups.com
you could also try the timeout option if you know how quick it will respond... - and then split... that would then close the connection as well.

J Dudley

unread,
May 24, 2017, 3:24:39 PM5/24/17
to Node-RED
That is what I was doing but if the device hangs for a moment you can end up getting only partial data... the best solution is to be able to verify a response for each query and also to have a secondary timeout to handle connection issues.
Reply all
Reply to author
Forward
0 new messages