From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Help sending command packet hex values to serial connection? Piezoelectric element control

I'm trying to control a piezoelectric element that connects to the computer via serial connection. The command set documentation provided by the supplier provides the formats for the command packets that need to be sent to the serial connection, but I'm having trouble figuring out how to do this in labview.

The first command packet I need to send is a set of four hex values, that I bundled with the hope of sending to the Serial Write function, but the wire is broken and the error reading says that the Serial Write input and the cluster output are different types and therefore incompatible.

I've read some other places that I need to use a byte array and then convert that to hex, but I don't really understand this instruction. If this is the solution, can someone please elaborate for me and tell me where in the menu I can find the byte array, and why this is the solution?

Here is a photo of my wiring error: http://imgur.com/3enNZfR

Thanks!

0 Kudos
Message 1 of 5
(3,136 Views)

Just to make sure we are all looking at this correctly, what is the instrument you are trying to communicate with?  I want to verify the command structure before we give any potentionally bad advice.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 5
(3,104 Views)

I'm trying to communicate with a piezoelectrically actuated nozzle from MicroFab: http://microfab.com/electronics

 

The command structure is as follows, for example, and has several inputs (header, # bytes, command, and check sum):

 

Header: ASCII S (53 in hex)

Number of bytes: XXh

Data 1: XXh (a hex value for the data required for a specific command)

Data 2: XXh

Command: XXh

Check Sum: XXh (#bytes+command byte + all of the data bytes)

 

In the photo I uploaded there are four input values: S, 02h, 01h, and 03h. 

 

Thanks!

0 Kudos
Message 3 of 5
(3,101 Views)

Ok, you want to build up an array of U8 and then use the Byte Array To String.

 

Something like this should do it, based on your description.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 5
(3,092 Views)

Thanks for your help! This was super useful. 

0 Kudos
Message 5 of 5
(3,065 Views)