ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

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 Kudos
Message 1 of 4
(2,575 Views)
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 Kudos
Message 2 of 4
(2,572 Views)

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 Kudos
Message 3 of 4
(2,565 Views)
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 Kudos
Message 4 of 4
(2,559 Views)