kingno
2025-03-31 f5bd202c943df54f160d3ae2dd44e8ef150a8b7a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using Bro.Common.Base;
using Bro.Common.Helper;
 
namespace Bro.Device.PointLaser_Omron
{
    [Device("PointLaser_Omron", "欧姆龙点激光", EnumHelper.DeviceAttributeType.Device)]
    public class PointLaser_OmronDriver : TcpClientWrapBase
    {
        public bool TriggerOnce(out double result, out string msg)
        {
            result = -999;
            msg = "";
 
            if (WriteAndRead("MS\r\n", out msg, out string reply, true))
            {
                if (double.TryParse(reply, out result))
                {
                    result = result * (InitialConfig as PointLaser_OmronInitialConfig).DataRatio;
                    return true;
                }
 
                return false;
            }
            else
            {
                return false;
            }
        }
    }
}