NI LabVIEW,CVI,数据采集等产品讨论区

取消
显示结果 
搜索替代 
您的意思是: 

VISA Read.vi中byte count与return count不一样为什么?

        我使用VISA Read.vi读取串口中的数据,将byte count设置为1024,但是return count返回的数值变化很大,而且在不停的跳变。这两个数为什么会不一样呢?
        我怎样做才能使实际输出的字节数就是我设置的要采集的字节数呢?
        谢谢!
        大家能不能留一下自己的QQ号,方便讨论问题啊!我的QQ号是:7030151    验证码:虚拟仪器
 
0 项奖励
1 条消息(共 6 条)
4,912 次查看
不觉得这个有必要啊,实际读回来的应该很难讲吧,比如发送 *IDN?命令,不同的仪器返回的字节数是不一样的阿。
我一半多设一点的。赫赫
0 项奖励
2 条消息(共 6 条)
4,905 次查看
       我使用串口采集数据,因为采集的点数不一样,所以做出波形的频谱也不一样,我就是想固定采样点数,好使每次做出的频谱都一样啊!
        使用属性的节点是不是可以控制啊?可是我不会用,请哪位高手指点一下,谢谢!
0 项奖励
3 条消息(共 6 条)
4,895 次查看
       我使用串口采集数据,因为采集的点数不一样,所以做出波形的频谱也不一样,我就是想固定采样点数,好使每次做出的频谱都一样啊!
        使用属性的节点是不是可以控制啊?可是我不会用,请哪位高手指点一下,谢谢!
0 项奖励
4 条消息(共 6 条)
4,895 次查看
我想到一个投机取巧的办法,我做了一个case结构,当实际接收的字节数小于100时,接收到的数据不做分析。只有当接收到字节数大于100时,才对接收到的数据进行分析。这样做出来的频谱图好看多了,但是治标不治本。
0 项奖励
5 条消息(共 6 条)
4,850 次查看
what's your setting when opening the port? if you have the termination enabled, then there might be your problem, the read vi will always return either by timeout, or there is a termination character in the stirng. since you are retuning data stream which can be anything (including the termination character), the read vi will read that properly.

i'd suggest:
1. disable the termination character
2. set the timeout input to the VISA read to a reasonable value for reading 1024 characters, however, this may slow down your application's responsiveness. Your approach is actually the right one, but you should always read the port, append the data to your previous reading and analyze it when it reaches to a desired length.


-Joe
0 项奖励
6 条消息(共 6 条)
4,833 次查看