请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
您好!
我正在开发一个小型软件、用于自动读取和写入器件 BQ20Z45R1... 软件现在运行正常、但我无法找到正确的通信...
测试规格要求:
读取电压、我认为 MSbus 命令为0x09
读取\写入串行数字
阅读所有内容以保存在 gg 文件中...
是否存在有关该内容的任何文档?
谢谢!!!
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
您好!
我正在开发一个小型软件、用于自动读取和写入器件 BQ20Z45R1... 软件现在运行正常、但我无法找到正确的通信...
测试规格要求:
读取电压、我认为 MSbus 命令为0x09
读取\写入串行数字
阅读所有内容以保存在 gg 文件中...
是否存在有关该内容的任何文档?
谢谢!!!
这可能对其他用户有所帮助:
C# WPF 应用+ BQEV2300
使用系统;
使用 System.Collections.Generic;
使用 System.Linq;
使用 System.Text;
使用 System.Threading.Tasks;
使用 System.Windows;
使用 System.Windows.Controls;
使用 System.Windows.Data;
使用 System.Windows.Documents;
使用 System.Windows.Input;
使用 System.Windows.Media;
使用 System.Windows.Media.Imaging;
使用 System.Windows.Navigation;
使用 System.Windows.Shapes;
使用 System.Configuration;
使用 System.Collections.Specialized;
命名空间 BQEV23K
{
公共部分类主窗口:窗口
{
AxBQ80XRWLib.AxBq80xRW EV23K;
公共主窗口()
{
InitializeComponent();
标题="BQEV23000;
WindowStyle = WindowStyle.None;
ShowInTaskbar =错误;
高度= 0;
宽度= 0;
此.loaded+= window_loaded;
}
公共 int BQConnect (Out int BrdsNumber、Out string BrdsName)
{
请尝试
{
BRdsNumber = 0;
BrdsName ="";
System.Windows.FormsHost 主机= new System.Windows.FormsHost.Integration.WindowsFormsHost();
EV23K =新的 AxBQ80XRWLib.AxBq80xRW();
host.Child = EV23K;
GD_Main.Children.Add(主机);
EV23k.GetFreeBoards (1、参考文献编号、参考文献编号);
IF (BrdsNumber <= 0)
返回-1;
BrdsName = BrdsName.Substring (0、BrdsName.Length - 1);
if (EV23k.OpenDevice (ref BrdsName)!= 0)
返回-1;
返回0;
}
catch (异常除外)
{
抛出新的 ArgumentException (Ex.Message);
}
}
专用 int ReadSMBus (string SMBusCmd、Out string SMBusWord)
{
请尝试
{
SMBusWord ="";
SMBCmd 短整型= short.parse (SMBusCmd、System.Globalization.NumberStys.HexNumber);
短整型 nWord = 0;
if (EV23K.ReadSMBusWord (SMBCmd、参考 nWord、0x17)!= 0)
返回-1;
SMBusWord = nWord.ToString ("X4");
返回0;
}
catch (异常除外)
{
抛出新的 ArgumentException (Ex.Message);
}
}
private void window_loaded (对象发件人、RoutedEventArgs e)
{
请尝试
{
int BrdsNumber = 0;
字符串 BrdsName ="";
if (BQConnect (Out BrdsNumber、Out BrdsName)!= 0)
抛出新的 ArgumentException (“错误!!!……EV23000没有发现。”);
console.WriteLine ("EV23000已连接...");
console.WriteLine (BrdsName);
NameValueCollection SMBusCmd =(NameValueCollection) ConfigurationSettings.getconfig ("MSBusCMDS");
object[] SMBusKeys = SMBusCmd.AllKeys;
foreach (SMBusKeys 中的字符串 SMBusKey)
{
字符串值= SMBusCmd[SMBusKey];
字符串 SMBusWord ="";
if (ReadSMBus (value、out SMBusWord)!= 0)
抛出新的 ArgumentException (“错误!!!!-。 SMBusCmd "+ value +" can not be readed.");
字符串段= SMBusKey.Replace ("、");
console.WriteLine (SMBusKey +"、"+ SMBusWord);
}
console.ReadKey();
this.close();
}
catch (异常除外)
{
console.WriteLine (ex.Message);
console.ReadKey();
this.close();
}
}
}