Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

RS 232 Communication Initialization

Hello Friends, 
 I have a pump system, LAMBDA Fracrional Pump. The communicatoin appendix is attached here. I am trying to initialize a serial write/read connection but I can not read any byte from port.

 

{{

RS communication protocol for LAMBDA OMNICOLL fraction collector-sampler

11.1.1 Format of data sent by the PC to the fraction collector and back

Data sent by the PC: #ss mm a xxxx qs c
Data sent back by the pump: <mm ss a xxxx qs c
where,  
# is the first sign of a command sent by PC
< is the first sign of a message sent by fraction collector
ss is the address of the fraction collector (slave)
mm is the address of the PC (master)
A is the command (see section 11.1.2)
x is the data value (4 ASCII numbers from 0 to 9; sent from the highest order digit to the lowest order digit)
Qs is the control sum in HEX format (2 ASCII characters of the type 0…9ABCDEF)
C is the end sign cr (carriage return) The collector will fulfil the task and block any manual command on the front panel.

11.1.2 Commands

# ss mm r qs c start (run)
# ss mm e qs c activates remote control of the collector (front panel deactivated)
# ss mm g qs c activates local mode (front panel activated)
# ss mm s qs c stopp
# ss mm f qs c step forward
# ss mm b qs c step back
# ss mm w qs c step in actual moving direction (depending on LINE or MEAN setting) [corresponds to pressing the STEP button]
# ss mm l qs c step to next line
# ss mm h qs c “high” mode
# ss mm u qs c “normal” mode
# ss mm m qs c “MEAN” collection mode (meander or zigzag collection mode)
# ss mm v qs c “LINE” collection mode (collects fractions always from left to right)
# ss mm i qs c “ROW” collection mode, the collector moves only from row to row
# ss mm d qs c unit setting – 0.1 minute step time setting (XXX.X)
# ss mm j qs c unit setting – minute step time setting (XXXX)
# ss mm o qs c open valve
# ss mm c qs c close valve
# ss mm a qs c division coefficient setting “1”
# ss mm k qs c division coefficient setting “1/60”
# ss mm p xxxx qs c number of pulses from pump or drop counter
# ss mm t xxx.x qs c collection time (in 0.1 minute steps)
# ss mm t xxxx qs c collection time (in minute steps)
# ss mm q xxx.x qs c pause time between two fractions (in 0.1 minute steps) (fraction collector automatically enters “high” mode)
# ss mm q xxxx qs c pause time between two fractions (in minute steps) (fraction collector automatically enters “high” mode)
# ss mm n xxxx qs c number of fractions (fraction collector automatically enters “high” mode)
# ss mm G x qs c to request the fraction collector to send data to the PC

where x is a number from 0-3:

0: collection time setting (TIME)

1: pulse setting (COUNT)

2: pause time setting (PAUSE)

3: number of fractions setting (NUMBER)

The answer of the OMNICOLL fraction collector-sampler is the following:

< mm ss B xxx.x qs c time xxx.x in 0.1 minute steps (collector is in stand-by mode)
< mm ss B xxxx qs c time xxxx in minute steps resp. number of pulses or fractions (collector is in stand-by mode)
< mm ss R xxx.x qs c time xxx.x in 0.1 minute steps (collector is in operation)
< mm ss R xxxx qs c time xxxx in minute steps resp. number of pulses or fractions (collector is in operation)

11.1.3 Checksum control

The following examples show , how the checksum is calculated

mm = 01 [PC address (master) is set to 01]

ss = 02 [Device address (slave) is set to 02]

The PC sends: #0201g4Dcr

The control addition (checksum) is made in the following way (only the last byte (2 ASCII characters of the type 0…9ABCDEF) is taken):

# 0 2 0 1 g 4D (last byte) cr
23h +30h +32h +30h +31h +67h =14Dh 0Dh
The PC sends: #0201t102320cr

The control addition (checksum) is made in the following way (only the last byte (2 ASCII characters of the type 0…9ABCDEF) is taken):

# 0 2 0 1 t 1 0 2 3 20 (last byte) cr
23h +30h +32h +30h +31h +74h +31h 30h +32h +33h = 220h 0dh

11.1.4 Format of the data transmission

Speed: 2400 Bd (Baud)
8 data bits, odd parity, 1 stop bit

 

11.2 How to set the OMNICOLL Fraction Collector-Sampler address?

When the LAMBDA OMNICOLL fraction collector and sampler has been equipped with the optional RS-232 interface, it can be controlled digitally, e.g. from a PC.

Disconnect the fraction collector-sampler from the mains. While keeping the direction button STEP pressed connect the fraction collector to the mains again. The message “A” and two numbers will appear on the display. This number from 00 to 99 is the current address of the fraction collector. To change the address press the buttons Λ Λ Λ Λ under the display until the desired number is obtained. Confirm your choice by pressing the button SET.

11.3 RS-connection scheme

The 5-pole DIN connector “REMOTE” of the communication module (Art. No. 6911 or 6929) is used for the remote control and RS connection.

When the optional RS-232 interface is available the pins are used as follows:

No. Colour Description
1 blue Input remote control +3-12 V
2 white RS-232 TTTL (TXD)
3 black Ground (GND)
4    
5 yellow RS-232 RTTL (RXD)

 

}}

 

As you can see we have slave and master address in command string line. I am confused I appreciate any help to get the ball rolling. 

 

Thanks

0 Kudos
Message 1 of 9
(5,279 Views)

MaziEOR,

 

Have you installed an RS-232 to TTL adapter between pc and pump?  Section 13.3 includes 'TTL' in description of RX and TX pins on communications interface. This usually means 0-5V signal levels out of the instrument.  These are not compatible with signal levels of serial port on PC.

0 Kudos
Message 2 of 9
(5,218 Views)

Hi ,
Thanks for your reply, the device itself has a connecting canle which is the adaptor, I belive. Because one side is RS-232 and he other is TTL. 

0 Kudos
Message 3 of 9
(5,184 Views)

here is a quick test vi

it calc the check sum (maybe the turn to U16 is not needed but hey.... )

and offers the option to assert some control lines (just in case you need to set them to activate the serial control pin 1 on your connector and it's tied to one of them)

 

Do you know the adress of your device?

 

serial test 02.png

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 4 of 9
(5,159 Views)

hi i have evlution copy i cannot see and devices and drivers and i have not any drivers so please could you suggest me how can activat virtually serial port.

 

0 Kudos
Message 5 of 9
(5,114 Views)
You need a Windows driver from the vendor to create a virtual serial port and you need NI-VISA to use the port in LabVIEW.

http://www.ni.com/download/ni-visa-14.0.1/5023/en/
0 Kudos
Message 6 of 9
(5,104 Views)

Dear Friend 
 Problem solved. Thanks for your kind help.  Actually the issue was because of the format of string ! for example in manual the command for step forwarding was (#ssmmfqsc) : 

 I was sending this normal string (#0101fqsc) but couldn't get back a response. Finally I found a sample .exe file compatible with our pump. Then figured out the equivalent string which was being sent to pump is  
#0101f4B<CR>
then I copied the command in new format and sent to pump, it worked ! I am not sure what is the new format for command string. now I will appreciate all you have done till now. I will be completely finished here if I can find a logical converter vi to convert normal command  ( example : #0101fqsc ) to new format ( #0101f4B<CR>) . 
0 Kudos
Message 7 of 9
(5,080 Views)
The manual does not say to use qs or c. It says to send the actual checksum and a carriage return. You have to calculate the checksum and the correct character for s carriage return. I would suggest you create an array of U8 (use your ASCII lookup table), calculate the checksum, and append that and the cr character to the array. The Byte Array to String or typecast function would create the string for the VISA Write.
0 Kudos
Message 8 of 9
(5,077 Views)

The program I attached in my previous post should do the job 😉

Simply enter the command without control bytes and <CR>

 

Just realized you didn't mention Labview ,  ....

 

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 9 of 9
(5,040 Views)