02-07-2017 03:33 PM
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!
02-07-2017 04:40 PM
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.
02-07-2017 04:50 PM
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!
02-07-2017 07:03 PM - edited 02-07-2017 07:03 PM
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.
02-08-2017 10:59 AM
Thanks for your help! This was super useful.