Summary: This module introduces inter-VI data transfer using datasockets
Content actionsDatasockets can be used in many different ways; they can be used with the hyper text transfer protocol (http), the file transfer protocol (ftp) and basically any protocol that utilizes the Transmission Control Protocol (TCP) in some form.
To use datasockets to transfer data between VIs across a network it is necessary to set up the Datasockets Server. This is a program that runs on one of the machines in the network and acts as an intermediary, transferring data between computers that are connected to it. Once the server is running, a specific variable (temporary or permanent) can be created on the server to which multiple clients can read/write data. The data transfer uses the Datasocket Transfer Protocol (DSTP).
The Advantage:
- Can work with multiple network protocols
- Front Panel objects can be bound to a datasocket variable on the server to make the setup less complicated
The Disadvantage:
- Requires a server (this could be any of the communicating computers however)
- No buffering of information, the datasocket variable holds only one value at a time.
This method is similar to Network Published Shared Variables, generally they are good for the transfer of data that doesn’t change too often due to the lack of a buffer. The reader and writer must be synchronized to prevent loss of messages.
Implementation:
Once the Datasockets Server (listed in the Windows Start Menu for National Instruments) has been started, a sample as shown in the diagram can be set up. Alternatively to bind to a datasocket location the Databinding property of a front panel object can be used. Right-click on the object and click on Databind.
Datasockets |
---|
No comments:
Post a Comment