仪器仪表远程控制库(C++&C#)

2 篇文章 0 订阅

工作中需要用到各种仪器仪表的控制,因此自己封装成了库,便于项目开发。有需要的朋友可以拿去。C++库还没有完成测试,C#库是完整的,目前支持罗德与施瓦茨和安捷伦等公司的的频谱仪,信号源,功率计,综测仪、网络分析仪等。支持GPIB和TCP/IP通讯。理论上仪表采用的SCPI可编程仪器标准命令,不同型号的命令大致相同,基本都可以通用,除了一些少数比较老的仪表,指令不一样。

1)C#库:依赖项:Ivi.Visa.Interop.dll 5.11.3422,需要安装安捷伦IO套件:IOLibSuite_18_1_24715

2)C++库:依赖 visa32.dll  需要安装运行环境:NIVISA1800runtime

调用示例:

string addr = "TCPIP0::172.17.200.11::5025::SOCKET";
ISpectrumAnalyzer spectrumAnalyzer = SpectrumAnalyzer.GetInstance(SpectrumAnalyzerType.Agilent_E4407B);
bool ret = spectrumAnalyzer.Connect(addr);

资源地址:https://download.csdn.net/download/whf227/11972858?spm=1001.2014.3001.5503

  • 15
    点赞
  • 66
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 6
    评论
```c++ // 仪器仪表管理系统C++示例 #include <iostream> #include <string> #include <vector> using namespace std; // 仪器仪表类 class Instrument { public: string name; string status; int usageCount; Instrument(string n, string s, int u) : name(n), status(s), usageCount(u) {} void displayInfo() { cout << "仪器名称:" << name << ",状态:" << status << ",使用次数:" << usageCount << endl; } }; // 仪器管理系统类 class InstrumentManagementSystem { private: vector<Instrument> instruments; public: void addInstrument(string name, string status, int usageCount) { Instrument newInstrument(name, status, usageCount); instruments.push_back(newInstrument); } void modifyInstrument(string name, string newStatus, int newUsageCount) { for (Instrument &instrument : instruments) { if (instrument.name == name) { instrument.status = newStatus; instrument.usageCount = newUsageCount; break; } } } void deleteInstrument(string name) { for (auto it = instruments.begin(); it != instruments.end(); ++it) { if (it->name == name) { instruments.erase(it); break; } } } void displayInstruments() { for (Instrument &instrument : instruments) { instrument.displayInfo(); } } }; int main() { InstrumentManagementSystem system; // 添加仪器 system.addInstrument("仪器1", "可借", 10); system.addInstrument("仪器2", "不可借", 5); // 修改仪器信息 system.modifyInstrument("仪器1", "不可借", 15); // 删除仪器 system.deleteInstrument("仪器2"); // 显示所有仪器信息 system.displayInstruments(); return 0; } ```

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

光谷码农

你的鼓励是我创作的最大动力!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值