forked from rossmann-engineering/EasyModbusTCP.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAdvancedModbusClient.cs
32 lines (28 loc) · 1.05 KB
/
AdvancedModbusClient.cs
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
using System;
using System.Collections.Generic;
using System.Text;
namespace EasyModbus
{
public partial class ModbusClient
{
/*
public enum DataType { Short = 0, UShort = 1, Long = 2, ULong = 3, Float = 4, Double = 5 };
public object[] ReadHoldingRegisters(int startingAddress, int quantity, DataType dataType, RegisterOrder registerOrder)
{
int quantityToRead = quantity;
if (dataType == DataType.Long | dataType == DataType.ULong | dataType == DataType.Float)
quantityToRead = quantity * 2;
if (dataType == DataType.Float)
quantityToRead = quantity * 4;
int[] response = this.ReadHoldingRegisters(startingAddress, quantityToRead);
switch (dataType)
{
case DataType.Short: return response.Cast<object>().ToArray();
break;
default: return response.Cast<object>().ToArray();
break;
}
}
*/
}
}