I'm iitializing and reading weight from OPOS scales (digiscales). In case scales are for some reason ejected (cable) and connected again, reading weight starts returning always 0. How can I catch this event (possible checking health) to close and re-initialize scales?
Have tried to catch any error in check health (passing different parameters to checkhealth) - it still doesn't throw error on eject:
{
_scale.CheckHealth(0);
_scale.CheckHealth(1);
_scale.CheckHealth(2);
}
catch (Exception ex)
{
_logger.LogInformation($"OPOS scales: health check failed with message: {ex.Message} {ex.InnerException.Message}");
CloseScale();
return 0;
}