Tjiny
2025-07-02 dfaa7178c3321fab0c7d95c28900e983aaa0a752
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using System.Web.Http;
using HH.WCS.Mobox3.RiDong.device;
using static HH.WCS.Mobox3.RiDong.util.ApiModel;
using static HH.WCS.Mobox3.RiDong.device.S7Helper;
 
namespace HH.WCS.Mobox3.RiDong.api;
 
/// <summary>
/// 设备测试控制器
/// </summary>
[RoutePrefix("api")]
public class EquipmentTextController : ApiController
{
    /// <summary>
    /// 写入Int类型
    /// </summary>
    /// <param name="model"></param>
    /// <returns></returns>
    [HttpPost]
    [Route("s7SetInt")]
    public SimpleResult s7SetInt(DBWModel model)
    {
        S7Helper.s7SetInt(model);
        return new SimpleResult();
    }
 
    /// <summary>
    /// 写入Bit类型
    /// </summary>
    /// <param name="model"></param>
    /// <returns></returns>
    [HttpPost]
    [Route("s7SetBit")]
    public SimpleResult s7SetBit(DBXModel model)
    {
        S7Helper.s7SetBit(model);
        return new SimpleResult();
    }
 
        
    /// <summary>
    /// 写入String类型
    /// </summary>
    /// <param name="model"></param>
    /// <returns></returns>
    [HttpPost]
    [Route("s7SetString")]
    public SimpleResult s7SetString(DBBModel model)
    {
        s7SetStr(model);
        return new SimpleResult();
    }
}