LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RS-232 DATA SEND TO Iinstrument

Solved!
Go to solution

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?

 

 

 

0 Kudos
Message 1 of 14
(248 Views)
Solution
Accepted by topic author Fredo123Danzel

(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?

0 Kudos
Message 2 of 14
(231 Views)

Fredo123Danzel_0-1737756982441.png

 

0 Kudos
Message 3 of 14
(218 Views)

My all data :  01111008011F400BB80000000F04

module address: 0x01

order :0x11 

function : 0x10

data size:0x 08

data : 011F400BB80000000F04

 

Fredo123Danzel_0-1737758163905.png

 

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

0 Kudos
Message 4 of 14
(214 Views)

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.

Rolf Kalbermatter
My Blog
0 Kudos
Message 5 of 14
(180 Views)

Hi, 

 

it's in hex. 

0 Kudos
Message 6 of 14
(176 Views)

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.

Fredo123Danzel_1-1737815750425.png

 

 

Programming manual that I found and which allowed me to control this instrument with another software.

 

Fredo123Danzel_2-1737815865563.png

 

 

 

0 Kudos
Message 7 of 14
(169 Views)

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.

Rolf Kalbermatter
My Blog
0 Kudos
Message 8 of 14
(160 Views)

@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.

 

altenbach_0-1737821164947.png

 

0 Kudos
Message 9 of 14
(151 Views)

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?

 

Fredo123Danzel_0-1737825879663.png

Fredo123Danzel_1-1737826308070.png

 

 

0 Kudos
Message 10 of 14
(140 Views)