udpport
Create a UDP port.
Attention: Valid only with Altair Communication Extension.
Syntax
uobj = udpport()
uobj = udpport([Name, value])
Inputs
- Name, value
- Name
Outputs
- uobj
- UDP port object.
- property, values
- Type: string
- Function Name, Syntax
- Type: string
Examples
read/write string data
sobj=udpport();
cobj=udpport();
cobj.write('Hello Server','string',sobj.LocalHost, sobj.LocalPort);
sobj.read()
sobj.write('Hello Client','string',cobj.LocalHost, cobj.LocalPort);
cobj.read()
sobj.close();
cobj.close();
ans = Hello Server
ans = Hello Client
read/write numeric data
sobj=udpport();
cobj=udpport();
data=[1,2,3,4];
cobj.write(data,'double',sobj.LocalHost, sobj.LocalPort);
clientdata=sobj.read(4,'double')
data=99;
sobj.write(data,'int32',cobj.LocalHost, cobj.LocalPort);
serverdata=cobj.read(1,'int32')
sobj.close();
cobj.close();
clientdata = [Matrix] 1 x 4
1 2 3 4
serverdata = 99