You should configure the udp object to match your instrument's communication configuration, which you typically set with its front panel.
RemoteHost
Specify the remote host IP address or name that the udp object will connect to.
RemotePort
Specify the remote port that the udp object will connect to.
LocalHost
Specify the local host IP address or name that the udp object will connect from. If you specify LocalHost as empty the system's default will be used.
LocalPort
Specify the local port that the udp object will connect from. If LocalPortMode is auto, the port used will be determined by the system.
LocalPortMode
Select the mode used to determine the LocalPort that the object will use.
Terminator
Select the character(s) used to terminate commands written to or read from the instrument. You can configure Terminator to an integer value ranging from 0 to 127, to the equivalent ASCII character, or to empty (''). Some common terminators include:
Additionally, you can set Terminator to a 1-by-2 cell array. The first element of the cell is the read terminator and the second element of the cell array is the write terminator.
When performing a formatted write operation, all occurrences of \n are replaced with the terminator. When performing a formatted read operation, one of the ways the operation completes is when the terminator is read. You can also use the terminator to generate a bytes-available event when the BytesAvailableFcnMode parameter is set to terminator.