Ok, I don't to VB.NET, so this is going to be in C#, but it should at least be close enough to get you going.
There are two ways to use OutGauge, by itself or via InSim.
To use it by itself, you need to configure it in the cfg file, such as:
OutGauge Mode 2
OutGauge Delay 100
OutGauge IP 127.0.0.1
OutGauge Port 30001
OutGauge ID 0
And then the setup code in C# would be
OutGaugeHandler handler = new OutGaugeHandler(30001);
handler.Updated += new OutGaugeHandler.GaugeEvent(outGauge_Updated);
Console.WriteLine("created handler");
while (true)
{
//clearly you'll want to handle this loop some other way,
//or in the case of Windows.Forms, don't even need to
//worry about a loop like this.
//The point is, after you start the handler, your OutGauge events
//are received by another thread, so do whatever you need with
//thread that started the handler
}
If you are getting OutGauge via InSim, start lfs with /insim=30000 and the consuming code in C# would be
handler = new InSimHandler(false, false);
Configuration config = handler.Configuration;
config.LFSHost = "127.0.0.1";
config.LFSHostPort = 30000;
config.ReplyPort = 30001;
config.UseKeepAlives = true;
config.UseSplitMessages = true;
config.GuaranteedDelivery = true;
handler.Initialize();
Console.WriteLine("LFS info:");
Console.WriteLine(" Product: {0}", handler.Version.Product);
Console.WriteLine(" Version: {0}", handler.Version.Version);
Console.WriteLine(" Serial: {0}", handler.Version.Serial);
handler.GaugeUpdated += new OutGaugeHandler.GaugeEvent(outGauge_Updated);
handler.StartOutGauge(100);
while (true)
{
// same story with this loop as in the above case
}
How you just need to create the event handler that receives the OutGauge events, which is the same in both scenarios:
void outGauge_Updated(object sender,
FullMotion.LiveForSpeed.OutGauge.Events.Gauge gauge)
{
Console.WriteLine("OutGauge -----------------------");
Console.WriteLine("Time: {0}", gauge.Time);
Console.WriteLine("ID: {0}", gauge.Id);
Console.WriteLine("Car: {0}", gauge.Car);
Console.WriteLine("RPM: {0}", gauge.RPM);
Console.WriteLine("Speed: {0}", gauge.Speed);
Console.WriteLine("Message1: {0}", gauge.DisplayMessage1);
Console.WriteLine("Message2: {0}", gauge.DisplayMessage2);
}
Hope that helps,
sdether