Hi Beno,
Thanks for the reply.
I need to create two sockets on the same port (5026) for a single client. Does that mean I need two communication handles?
I am not able to connect the hardware to a controller yet, but I will be doing it soon and want to build some charts to test it using the TCP server example as a foundation.
I have an example of how to open the experiment file and start it running:
Create two sockets using the application program interface (API) with the client is being created.
Socket #1: -xStatus –d15
This requests the current status of the active MSIU. If this is available then we can
proceed.
Socket #1: -f” C:\Data\Hiden Analytical\MASsoft7\Templates\filename.exp”
Socket #2: -f” C:\Data\Hiden Analytical\MASsoft7\Templates\filename.exp”
Open the specified file on both sockets. Remember that only one instance of the file will be opened by MASsoft. MASsoft will only create an association between the socket and the experiment file.
Socket #2: -lStatus –v1
This creates a status hotlink in order to monitor the experiment file state changes. As we have successfully issued a link command this means that this is now a listening Socket only. We can no longer send any more commands to MASsoft via this socket.
Socket #1: -xGo –Odt
This command will start the experiment file running with the data being stored in an
experiment file consisting of the current time stored within a date subdirectory.
C:\Data\Hiden Analytical\MASsoft7\Templates<date subdirectory><time>.exp
Socket #1 will receive a “1” result string indicating it has successfully started running Socket #2 will also receive a string stating ScanningActive.
Note
If using MASsoft version v7.23 onwards there will be two status changes received. StartingActive followed by ScanningActive.
Monitor the socket #2 and when the experiment file has stopped running it will change status to StoppedShutdown. When this occurs the socket can be closed.
Socket #1: -xClose –d15
If successful the experiment file will close. When MASsoft closes an experiment file it will terminate ALL connections associated with it.
Destroy both sockets using the appropriate API of the language with which the client was created.
I also need to obtain “scan” data through the socket, so I need to run another command for that, “-lData”. There may be some additional commands required for data formatting. This command creates a “hot link” which prevents further commands from being sent, so we need the second socket again to report the status of the RC interface whenever it changes.
So I guess I am wondering what I need to do to open two “sockets” on the same port. If it is just multiple comm handles, how do I assign the comm handles to a socket?