CogIOStreamMessageEventArgs DecodedMessage Property Cognex VisionPro 9.21 SR1
The unicode string was produced by feeding the bytes through the associated stream device’s specified decoding scheme (e.g. UTF16, UTF8, ASCII, or RAW8BIT).

Namespace: Cognex.VisionPro.QuickBuild
Assembly: Cognex.VisionPro.QuickBuild.IO (in Cognex.VisionPro.QuickBuild.IO.dll) Version: 85.1.0.0 (85.1.0.0)
Syntax

public string DecodedMessage { get; }

Property Value

Type: String
Remarks

Use this property in the message event handler.
Examples

See the sample code in %VPRO_ROOT%\Samples\Programming\TCPIP\QBInputSample,

public Form1()
{
    InitializeComponent();
    cogJobManagerEdit1.Subject = CogSerializer.LoadObjectFromFile(Environment.GetEnvironmentVariable("VPRO_ROOT") + @"\samples\programming\tcpip\QBInputSample.vpp") as CogJobManager;
    cogJobManagerEdit1.Subject.IOEnable = true;
    QBdevice = cogJobManagerEdit1.Subject.StreamInput(Dns.GetHostName(), 5001, false);
    QBdevice.MessageReceived += new CogIOStreamMessageEventHandler(QBdevice_MessageReceived);
}


void QBdevice_MessageReceived(object sender, CogIOStreamMessageEventArgs eventArgs)
{
    String msg = eventArgs.DecodedMessage;
    if (msg == "RunOnce")
        cogJobManagerEdit1.Subject.Run();
}
See Also