using IND245;
static void Main(string[] args)
{
string PORTNAME = "COM3";
int BAUDRATE = 9600;
int TESTNUM = 3;
double weight = 0;
string weightUnit = string.Empty;
ind245 i245 = new ind245();
//打开
if (i245.SerialOpen(PORTNAME, BAUDRATE).Equals(0))
{
//读取
while (TESTNUM-- > 0)
{
weight = i245.SerialRead(out weightUnit);
Console.WriteLine("getData:" + weight);
Thread.Sleep(1000);
}
}
//关闭
i245.SerialClose();
Console.WriteLine("funtion end");
Console.ReadKey();
}
PS:地秤,挂称通用
1