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

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

如何将数值转为时间类型?

已解决!
转到解答
现在我通过单片机向LV发送时间和数据,在LV中,准备用时间为X轴,另一数据为Y轴。单片机通过串口发送,时间格式为0x10,0x03,0x22,0x22,0x06,0x11(表示为2010年3月22日22 时06分11秒)。中LV中,我如何将这数据组合并转化为LV中的时间格式(timestamp),且在Y轴上显示呢?
0 项奖励
1 条消息(共 6 条)
4,753 次查看
That's very odd.  Are you sure 0x11 = 11 sec, not 17 sec?
George Zou
2 条消息(共 6 条)
4,741 次查看

zou wrote:
That's very odd.  Are you sure 0x11 = 11 sec, not 17 sec?
Same thought as Zou...
For your question, you may try Date/Time to Seconds 

 

Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
0 项奖励
3 条消息(共 6 条)
4,731 次查看

That's the BCD code. Read from the chip DS1302. That's easy to convert 0x11 to 11. My question is how to compose them to be a timestamp.

You know converting them to seconds elapsed since 1904 is not an easy thing.

0 项奖励
4 条消息(共 6 条)
4,726 次查看
解答
已被主题作者 电子牛牛 接受

电子牛牛 wrote:

That's the BCD code. Read from the chip DS1302. That's easy to convert 0x11 to 11. My question is how to compose them to be a timestamp.

You know converting them to seconds elapsed since 1904 is not an easy thing.


date time to seconds.GIF 

 

Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
5 条消息(共 6 条)
4,719 次查看

嗯,解决了,感谢楼上的朋友们!

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