Benchtop Measurement and Test
Distributed Measurement and Control
High-Performance Test
Systems Engineering Software
Perspectives showcases how NI sees what’s next in the world of test and technology.
You can request repair, RMA, schedule calibration, or get technical support. A valid service agreement may be required.
Provides support for NI data acquisition and signal conditioning devices.
Provides support for Ethernet, GPIB, serial, USB, and other types of instruments.
Provides support for NI GPIB controllers and NI embedded controllers with GPIB ports.
修改时间 09-27-2010 07:02 AM
现在遇到一个问题,在串口通讯中,用VISA发送字符串,是一个一个的发吗?例如:我要发一个整数26给单片机,是不是必须转换为字符串26,然后将26字符串发送出去,先发2,再发6,发两个字节,还是26一起发,一个字节发送出去?
已解决! 转到解答。
修改时间 09-27-2010 07:54 PM
可以连续发。26可以一起发。发送的数据格式可以有两种:1.字符串;2.十六进制数。
修改时间 09-27-2010 08:03 PM
VISA发送一个整数26给单片机可以有几种不同的定义。
1. 发送“26”字符串,数据长度2 Bytes;
2. 发送HEX数据 0x1A(其值为26),数据长度1 Byte。
修改时间 09-28-2010 06:00 AM
谢谢啦!我也找到方法了,和你的一样,一个16位的可以先发高8位,在发低8位是吧。发送一个16位的整数先将其转换为4个宽度的十六进制字符串,再分成高8位和低8位,将高低8位组成一个数组,再转换为字符串。是不是这样处理的呢?还有其他的更好方法吗?
修改时间 09-28-2010 07:56 PM
您说的很对!不管是16位的整数还是32位,64位的浮点数,在使用VISA发送时,都需要现将按照内存中的“值”转成对应的字符串。对于这种常见转换,还可以使用 Mathematic >> Numeric >> Data Manipulation >> Flatten to String.vi 来实现这种转换。
What do you need our team of experts to assist you with?
Thanks!
We'll be in touch soon!