01-24-2025 02:42 PM
Hi,
I need to send data frame to configure and start an instrument. I use RS-232 communication.
My data frame is long ( 01111008011F400BB80000000F04 ). It contains several pieces of information. I tried to use the examples contained in the labview library but it does not work.
Is it possible to get some advice please?
Solved! Go to Solution.
01-24-2025 03:38 PM - edited 01-24-2025 03:42 PM
(sorry, cannot look at your VI)
Is this a 28 character string (normal display) or a 14 character string (hex display)?
Are you supposed to add a termination character?
Do you have the manual for the instrument?
Maybe start with this excellent presentation....
@Fredo123Danzel wrote:
I tried to use the examples contained in the labview library but it does not work.
Which example and in what way doesn't it work? Any error messages?
01-24-2025 04:16 PM
01-24-2025 04:41 PM
My all data : 01111008011F400BB80000000F04
module address: 0x01
order :0x11
function : 0x10
data size:0x 08
data : 011F400BB80000000F04
I use a drum simulator. the module ASD-906B https://www.asundar.com/product.php?cid=34&id=28
I can manage to drive in another software with this frame and I would like to deploy it under Labview
01-25-2025 07:55 AM - edited 01-25-2025 07:59 AM
You still haven't explained if the data you describe is in ASCII hex or binary hex. ASCII hex is what you try to send in the VI (plus some +I prefix and ?\n postfix).
Where do these prefix and postfix come from?
The site being entirely in Chinese doesn't help at all for me. The only manual I can find seems to be just a User Manual and does not seem to say anything about the remote control protocol that this device supports. And the site being in Chinese doesn't allow me to search for a seperate Programmer Reference Manual which would generally document such things.
01-25-2025 07:59 AM
Hi,
it's in hex.
01-25-2025 08:39 AM
Hello,
I can send frame data in hexadecimal to this instrument to adjust the voltage and current.
Currently, i would lik to use LabView to send this data frame in hexadecimal to this instrument. The example I found in the LabView library, I modified to write to the buffer of the Visa Write block but it does not work even if I do not have error messages.
Programming manual that I found and which allowed me to control this instrument with another software.
01-25-2025 09:32 AM
But your string is ASCII hex, not binary hex as indicated by your documents. In that document it clearly says that those 0x01 0x11 0x04 ... are 8 bit values. You send them as ASCII resulting in two 8-bit values being send for each of them. Then wrap it also in some *I and ?\n, probably based on some other posts you found somewhere talking about normal instrument communication that usually happens through ASCII string commands.
Try to change your string constant to Hex Display Mode instead and enter that string again. Alternatively you could create an array of U8 values, change the Radix to hex and enter those values in there, then use a Byte Array To String conversion to get the binary string that the VISA Write expects.
01-25-2025 10:06 AM
@rolfk wrote:
Then wrap it also in some *I and ?\n, probably based on some other posts you found somewhere talking about normal instrument communication that usually happens through ASCII string commands.
.
The string seems to be in \-codes. As a first step I would recommend to change the string to hex display and re-enter the data.
01-25-2025 11:32 AM
Hi ROLF,
I changed the radex of the block control to hexadecimal output and I put this data frame in a U8 array. Then i converted to hexadecimal. Should i put these bytes one by one please?