Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

RS232 writing to instrument

I´m workimg with LabVIEW 8.5.1

 

In order to change a parameter in my instrument having RS232, according to the manufacturer, I need to write to the RS232 every time  only one Byte. Thus, if the parameter´s value is 85.6  I should write in Hexadecimal value :

Byte 1     = 05

Byte 2     = 05

Byte 3     = 65

Byte 4     = 30

Byte 5     = 38

Byte 6     = 35

Byte 7     = 2E

Byte 8     = 36 

Byte 9     = 0D

Byte 10   = 73

 

Every time I have to write to the serial port only one Byte, then the next one an so on until having writing all the Bytes 

 

Does any one knows how this can be done ?

 

Simbani 

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

Hi

 

first question why HEX, that is only a way to represent bytes for humans. Probably you need the simple string in Labview to be sent to the instrument.

 Interestingly that you need to send abinary 5 twice, than n A etc.

 

What instrument are you talking to and did you search for an available instrumentdriver ?

greetings from the Netherlands
0 Kudos
Message 2 of 5
(3,126 Views)

Albert,

 

It is a radiation pyrometer from the German manufacturer Keller. They do not have any driver.

 

The format is

 

Byte       Hex-Wert        ASCII

1              0x05                CRTL-E

2              0x05                CRTL-E

3              0x65                 e

4        0x30..0x39            100er Stelle    

5        0x30..0x39             10er Stelle    

6        0x30..0x39               1er Stelle    

7              0x2E                  .

8       0x30..0x39               0,1er Stelle

9              0x0D               Carriage Return

10            0x73                 s

 

I am trying sending Hex values because I do not know how I can send the ASCII CRTL-E

 

Can you make up the string in ASCII, say for instance for the same value?    

 

Simbani

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

Hi

 

You have in LabVIEW 2 functions that help you.

1) "string to array" translates a string into an array of bytes and the values here can be represented as the values (hex or decimal or binary).

so in that case generate an array of u8 and use function 2

2) "array to string" converts this array back to a string.

 

 

just try in an empty vi and you get experienced

greetings from the Netherlands
0 Kudos
Message 4 of 5
(3,121 Views)

Albert,

 

Thanks a lot.

 

It works now

 

Simbani

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