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

Problems with sending data to serial

Hi!

This may be a stupid question. 

But i try to ask it, however...

 

I'm trying to communicate with a motor throu rs-232. 

The manual says that the commands should have the following form: (an example)

 SXWT <0H><0H><0H><32H> <88H><cr>

 

Where <0H><0H><0H><32H> is the data in a four byte long integer. <88H> is a checksum, that is easy to calculate.

 

My problem is how do I send the hex. data in a string(combined with the ascii-string in the beginning)?

 

 

 

 

0 项奖励
1 条消息(共 4 条)
2,664 次查看
In such cases I prefer to start with a byte array. Before you send the data use the Byte array to string function.


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 项奖励
2 条消息(共 4 条)
2,661 次查看

Hard to say because it depends on whether the instrument wants that information as ASCII characters or as raw hex values.  It could be one of these:

 

or something else.  What does the manual say?

Message Edited by smercurio_fc on 06-14-2009 12:01 PM
0 项奖励
3 条消息(共 4 条)
2,654 次查看
Also have in mind how the motor want to receive the integer. Labview uses Big Endian. If the motor want the integer in Little Endian you must use byte swapping


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 项奖励
4 条消息(共 4 条)
2,648 次查看