主题:机械振动二进制数据文件的读取和处理,求助
康斯丹公爵
[专家分:0] 发布于 2011-06-12 14:49:00
有一个传感器收集到得机械振动的.dat文件,需要编写一个处理该数据的程序,需要文件读取模块、时域分析模块和频域分析模块。
读文件我是这样写的,但是读出来的是乱码,是不是不用管,已经可以处理了?
Private Sub Command1_Click()
Dim DAT() As Byte
Dim FileSize As Long '文件长度
FileSize = FileLen("d:\9c1氢压机A7.dat") '获取文件长度
ReDim DAT(FileSize - 1) As Byte
Open "d:\9c1氢压机A7.dat" For Binary As #1
Get #1, , DAT
Debug.Print DAT()
Close
End Sub
还有时域分析和频域分析,没有一点头绪。。。
求高人指点
最后更新于:2011-06-12 21:26:00
回复列表 (共8个回复)
沙发
康斯丹公爵 [专家分:0] 发布于 2011-06-12 19:07:00
连个回复也没有?还是因为我没分?
好吧。。。。
板凳
老大徒伤悲 [专家分:29120] 发布于 2011-06-12 19:53:00
关键在于.dat文件内的数据结构。
3 楼
康斯丹公爵 [专家分:0] 发布于 2011-06-12 21:31:00
多谢老大关注,我已经上传了.dat文件的压缩包。至于里面的数据结构,说实话我也不太懂,有人用CBuilder编的程序读出来好像就是一个个数,相互之间也没什么关系。
另外还有个问题,我发现按照我前面写的程序,读出来的数字都是0~255之间的,跟正确的数据不一样,不知道是怎么回事,望指点,多谢!!
4 楼
康斯丹公爵 [专家分:0] 发布于 2011-06-12 21:53:00
问了下别人,说最开始的47位是头文件信息,其余数据是一个个的离散数据
5 楼
一江秋水 [专家分:9680] 发布于 2011-06-13 06:09:00
看了一下你上传的附件,前面至少有60个字节不是你所说的离散数据,所以,你首先要搞清从什么位置读起;第二,要弄清这些数据的字长,也就是说,数据类型是什么:字节型、整型、长整型、单精度、双精度?你的代码是用字节型数组读,当然数值不会超过255了。
6 楼
cxxcomp [专家分:2370] 发布于 2011-07-04 01:38:00
QQ1285305730
联系详谈,解决过类似的东西。或许可以帮你。
7 楼
guolibin [专家分:0] 发布于 2011-07-06 15:07:00
The MBT purchase [url=http://www.brandshoes-shop.com/]Mbt Shoes Clearance[/url] is manner and comfort. The minimal cost MBT sneakers will almost although be delighted you. So make good you need to do not [url=http://www.brandshoes-shop.com/]Mbt Shoes[/url] skip MBT shoes on purchase at the internet.on challenging, washboard surfaces.MBT shoes own a thick, [url=http://www.brandshoes-shop.com/mbt-shoes-clearance-women-c-3.html]Mbt Shoes Clearance Women[/url] curved single that mimics barefoot strolling. created with a Swiss [url=http://www.brandshoes-shop.com/mbt-shoes-clearance-men-c-1.html]MBT Shoes Clearance Men[/url] engineer, MBT means Masai Barefoot Technologies; the sneakers are constructed to alleviate the combined and muscle muscle serious pain you may come around jogging on intricate surfaces and pavement that does not “give” [url=http://www.brandshoes-shop.com/]MBT[/url] under your feet.
8 楼
guolibin [专家分:0] 发布于 2011-07-06 15:13:00
Acknowledge a [url=http://www.mygucci-outlet.com/]Gucci Bags[/url] yellowish striped textile lining with additional smooth bank balance inside. It Evaluates about 22.9 in complete and 9.4 inches in width, which must [url=http://www.mygucci-outlet.com/gucci-wallets-c-23.html]Gucci Wallets[/url] certainly current you a a lot place for the individual essentials.The method Hobo Roses [url=http://www.mygucci-outlet.com/]Gucci Outlet[/url] Speedy 41 costs usd2,421 and is also of course an adaptable ladies handbag to protect you hunting attractive, urbane and womanly for numerous [url=http://www.mygucci-outlet.com/]Gucci Bag[/url] seasons.It’s a excellent indisputable certainty that as opposed to over, now-a-days several people currently program to goal for [url=http://www.mygucci-outlet.com/]Gucci Handbags[/url] modern day main things.
我来回复