Your example code there looks okay to me.
To successfully generate a machine alarm, the API must have the licensed feature UserAlarm
.
(Okuma.Lathe.UserAlarm in the okuma.api.lic license file).
You can confirm that a machine has this option by using the SCOUT library:
UserAlarmLathe = Okuma.Scout.LicenseChecker.License_UserAlarm_L;
if (UserAlarmLathe.Status == Enums.LicenseStatus.Valid)
{
// ...
}
Additionally, the machine on which the API resides must also have the THiNC ALARM
option.
If your machine does not have the option, it can be ordered by contacting your Okuma Distributor and asking for option code " :911-0010 - THiNC ALARM "
The presence of this option can be confirmed by checking the Lathe Spec Code NC-B No. 4, Bit 3
. You can check this spec code in your application using either THINC API or SCOUT.
Using THINC API:
Okuma.CLDATAPI.DataAPI.CSpec SpecCodeClass = new Okuma.CLDATAPI.DataAPI.CSpec();
bool THiNK_ALARM = SpecCodeClass.GetBSpecCode(4, 3);
if (THiNK_ALARM)
{
// ...
}
Using SCOUT:
if (Okuma.Scout.SpecCode.NCB.MachineSpecCodeFileExists)
{
if (Okuma.Scout.SpecCode.NCB.SpecFileIsValid)
{
bool THiNK_ALARM = Okuma.Scout.SpecCode.NCB.Bit(
Okuma.Scout.Enums.NCBSpecGroup.NCB1MG, 4, 3);
if (THiNK_ALARM)
{
// ...
}
}
}