01-06-2015 01:42 PM
Here's my code in C#:
// UDP Connection :: Talker ::
Boolean done = false;
Boolean exception_thrown = false;
Socket sending_socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
IPAddress send_to_address = IPAddress.Parse("172.22.11.2");
IPEndPoint sending_end_point = new IPEndPoint(send_to_address, 80);
while (!done)
{
//foreach (Vector3DF[] vector in facePoints3D.GetSlices(n))
foreach (Vector3DF vector in facePoints3D)
{
//arrange
float zvect = vector.Z;
byte[] bytearray = BitConverter.GetBytes(zvect);
//convert value to string
//string bytearray = Convert.ToString(bytearrays);
// Remind the user of where this is going.
/*
Console.WriteLine("sending to address: {0} port: {1}",
sending_end_point.Address,
sending_end_point.Port);
*/
try
{
//sending_socket.SendTo(data, sending_end_point);
sending_socket.SendTo(bytearray, sending_end_point);
}
catch (Exception send_exception)
{
exception_thrown = true;
Console.WriteLine(" Exception {0}", send_exception.Message);
}
if (exception_thrown == false)
{
Console.WriteLine("Message has been sent to the broadcast address");
}
else
{
exception_thrown = false;
Console.WriteLine("The exception indicates the message was not sent.");
}
} //ends foreach statement
} //ends while(!done) statement
// ends udp talker
And I am doing the following in LabVIEW,
01-06-2015 01:51 PM
Please also see the cross-post to LAVA: https://lavag.org/topic/18732-handling-endianness-in-between-labview-and-windows-intel-processor-ach...