5
« on: June 02, 2018, 01:35:21 PM »
I Tried
using System.Speech.Synthesis;
using System.Speech;
private void AlarmList_ValueChanged(object sender, MfgControl.AdvancedHMI.Controls.ValueChangedEventArgs e)
{
SpeechSynthesizer speechSynthesizer1 = new SpeechSynthesizer();
speechSynthesizer1.Volume = 100;
speechSynthesizer1.Rate = 2;
speechSynthesizer1.SpeakAsync(AlarmList.Text);
}
But she read EVERYTHING. Including the value, settings and time date stamp
so I opted for
private void dataSubscriber21_DataChanged(object sender, MfgControl.AdvancedHMI.Drivers.Common.PlcComEventArgs e)
{
string data = "";
data = e.Values[0];
string plcAddress = "";
plcAddress = e.PlcAddress;
//C3
switch (plcAddress)
{
case "N170:30"://C3
switch (data)
{
case "1":
C3.ValueSelect2 = true;
C3.ValueSelect1 = false;
C3.ValueSelect3 = false;
break;
case "2":
C3.ValueSelect3 = true;
C3.ValueSelect1 = false;
C3.ValueSelect2 = false;
break;
case "5":
C3.ValueSelect1 = true;
C3.ValueSelect2 = false;
C3.ValueSelect3 = false;
AlarmList.Value = 1; SpeechSynthesizer speechSynthesizer1 = new SpeechSynthesizer();
speechSynthesizer1.Volume = 100;
speechSynthesizer1.Rate = 2;
speechSynthesizer1.SpeakAsync("Conveyor 3 Fault");
break;
default:
break;
}
break;
You may be able to help me further, as I have to type this code for every fault, and there's about 100