从Excel到串口的数据 [英] Data from Excel to Serial port

查看:481
本文介绍了从Excel到串口的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我需要知道如何将Excel中的数据发送到串口?

我的目的是在Seven Segment上显示Excel数据。 />
我知道它涉及MCU编程。

任何人都可以指导我或建议我任何其他方法吗?



谢谢和问候,

M. Mohsin

Hi everyone,
I need to know how can we send data form Excel to serial port?
My purpose is to display Excel data on Seven Segment.
I know it involves MCU programming.
Can anybody guide me or suggest me any other method?

Thanks and regards,
M. Mohsin

推荐答案

这个问题无法回答,因为我们不知道Excel数据是什么,也不知道你想要什么显示它。您(可能)需要做的第一件事就是学习如何读取Excel数据。请查看 Microsoft.Office.Interop.Excel [ ^ ]和使用OLEDB读取和编写Excel [ ^ ],对于一些想法。至于显示您的数据,您需要获取设备的文档并进行研究。
This question is impossible to answer as we have no idea what the Excel data is nor how you want to display it. The first thing you (probably) need to do is to learn how to read your Excel data. Take a look at Microsoft.Office.Interop.Excel[^], and Reading and Writing Excel using OLEDB[^], for some ideas. As to displaying your data, you will need to get the documentation for your device and study that.


一个简单的解决方案是将Excel工作表导出为CSV文件并编写一个程序读取CSV文件并逐个单元地将文本内容写入串口(例如,根据显示器的大小,在单元或行之间有一些延迟)。



Excel自动化(通过其他应用程序控制Excel)或使用第三方Excel库迭代单元格也可以执行相同的任务。



如果没有想法如何连接显示器,我建议以一种简单的方式实现它,其中发送的文本块包含可由显示器显示的相同数量的字符。因此,您可以通过PC软件实现滚动和延迟,而不是通过MCU实现。
A simple solution would be to export the Excel sheet to a CSV file and write a program that reads the CSV file and writes the text content cell by cell to the serial port (e.g. with some delay between cells or lines according to the size of the display).

The same task can be also performed by Excel automation (controlling Excel by other applications) or using a third party Excel library to iterate through the cells.

If you have no idea yet how to connect the display, I suggest to implement it in a simple way where text blocks are send that contain the same number of characters that can be shown by the display. So you can implement scrolling and delays by PC software rather than doing it with the MCU.


这篇关于从Excel到串口的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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