我有一个温度传感器,我想知道如何在visual basic 2010中控制它 [英] I have a temperature sensor and I want to know how to control it in visual basic 2010

查看:111
本文介绍了我有一个温度传感器,我想知道如何在visual basic 2010中控制它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如您所假设的,我是VB的初学者。



我的目标是创建一个基本程序来测量按下按钮时的温度。



我需要采取哪些步骤来实现目标?



重定向通知 [ ^ ]



(传感器通过USB而不是mi连接到我的电脑crocontroller。我安装了软件,允许我查看温度变化图。)

As you would have assumed, I am a beginner to VB.

My objective is to create a rudimentary program to measure the temperature when you press a button.

What steps do I need to take in order to achieve my goal?

Redirect Notice[^]

(The sensor is connected to my computer via USB not through a microcontroller. I've installed the software allowing me to view a plot of the temperature change.)

推荐答案

通常你没有( PC 不直接与温度传感器通信。 微控制器用于从传感器获取数据,然后将测量值转发到 PC (例如,使用串行通信)。 br />
当然这完全取决于你使用的'传感器'。



[更新]
显然你的高温计使用串行通信。

所以你需要的只是 SerialPort Class(System.IO.Ports) [ ^ ]并且对设备协议有很好的理解(文档很有前途:提供了示例)。

[/ Update]
Usually you don't (the PC doesn't) communicate directly with the temperature sensor. A microcontroller is used to get data from the sensor and then to forward the measure to the PC (using, for instance, serial communication).
Of course it all depends on the 'sensor' you are using.

[Update]
Apparently your pyrometer uses serial communication.
Hence all you need is the SerialPort Class (System.IO.Ports)[^] and a good understanding of the device protocol (the documentation looks promising: examples are provided).
[/Update]


第一步:

- 找到制造商和传感器型号。

- 向制造商询问手册,可能是SDK ,和/或代码样本来读取温度。

- 如果你没有得到可用的东西,请搜索客户论坛以获得帮助。
First steps:
- Find the maker and sensor model.
- Ask the maker for manual, may be an SDK, and/or code samples to read temperature.
- if you don't get something usable, search for a forum of customers to get help.


First ,温度传感器(通常是热电偶)不受控制,可以读取。它是一个传感器,因此它会响应一个变化的信号,在某种程度上可能与它所响应的信号有关。



照片 - 例如,细胞可以对光强度做出反应;一个baratron,压力。



必须进行某种转换才能将设备的输出转换为数值。例如,热电偶可能具有与温度成比例的电压;光电池的电流与光强成正比。在一些现代设备上,它们的转换电路可能已经内置在传感器中,作为最好被描述为传感设备的一部分。



按照之前的评论/答案但是,您需要获取制造商有关如何转换的信息,可能包括校准曲线,方法,SDK,代码示例。



如果不是 - 你'我需要测量传感器的电压 [模拟信号] (通过合适的电阻并连接到A / D转换器)。然后,使用已知的温度值,建立自己的校准曲线,以便将信号从电压转换为温度。
First, a temperature sensor (typically a thermocouple) is not controlled, it's read. It's a sensor and it thus responds with a changing signal that in some way may be related back to a measurement of what it is that it responds to.

A photo-cell, for example, could respond to light intensity; a baratron, to pressure.

It is necessary to have a conversion of some sort to translate the output of the device to a numerical value. A thermocouple, for example, might have voltage that is proportional to temperature; a photocell would have current proportional to light intensity. On some modern devices, they conversion circuitry may already be built into the sensor as part of what would better be described as a sensing device.

As per previous comments/answers, however, you will need to get the manufacturer's information for how to convert, perhaps including calibration curves, methods, an SDK, code examples.

IF NOT - you'll need to measure the voltage of your sensor [an analog signal] (across a suitable resistor and connected to an A/D converter). Then, using known temperature values, build your own calibration curve so you can covert the signal from voltage to temperature.


这篇关于我有一个温度传感器,我想知道如何在visual basic 2010中控制它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆