Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

Using TCP Client Connection settings in CRBasic.


mjb Mar 23, 2011 09:20 PM

Hi,

In the CRBasic Help file, at the foot of the TCPOpen page, there is this:

The datalogger has a PakBus/TCP Client Connection setting, which can be used in lieu of the TCPOpen function, to specify up to four outgoing TCP/IP connections that the datalogger should attempt to maintain.

How do you actually access and use these connections that are held open? i.e., with SendVariables() or similar.

Cheers,
Mike.


IslandMan Mar 24, 2011 10:30 AM

Could you please be a little more specific about what you are trying to accomplish with the TCP connections?


aps Mar 24, 2011 02:31 PM

Normally the Pakbus/TCP client connections are used to allow servers to connect back to the logger, and this feature is often used to overcome issues with the logger having a dynamic IP address.

However, you can instigate calls outgoing from the logger using the "magic" of Pakbus routing. This works because when the client connection is made the logger will discover which remote Pakbus devices it can connect to and add the route to those Pakbus devices to its internal routing table (this works for hardware or IP connected devices).

In instructions like SendVariables, if you set the Neighbour address to -1 this tells the logger to find the Pakbus device using the information in its routing table. That information will override the COMPort setting so the traffic should be sent out via the correct socket which, hopefully, the logger is still holding open.


mjb Mar 24, 2011 07:45 PM

Aha, thanks aps.

So, if I understand correctly, a call like this:

SendVariables(RXResponse,0,-1,1,0,0,"Public","PTemp",PTemp,1)

Would send the value of PTemp to the datalogger with PakBus ID of 1 over a TCP connection being maintained by the logger? (assuming that TCP connection connects to the IP address of the NL115 on the logger with PakBus ID 1, on port 6785?)

Or does the ComPort parameter require a valid value even though it's overridden as you suggest?

Oh - I assume that the connection being held open is for PakBus communication, not Serial I/O?

* Last updated by: mjb on 3/24/2011 @ 1:50 PM *

Log in or register to post/reply in the forum.