LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial read and write comunication

Hi
excuse for my english!
However, i have a 16 channels NIM module (amplifier and rise time measurer) which, till now, was controlled via a RS232 serial port using Minicom under Linux.
Minicom setting is 9600 8N1 and hardware flow control.
On minicom typing

n0(enter)

we receive a string such as

n0 Cth=  10  Str = 20  P/Z = 1 ....................Stren


We don't know the (variable) bytes lenght of  this string  and its termination character (we suppose \n  or \n\r)!
Minicom works correctly!

We tried to use LV 7  examples (basic serial read and write., advanced serial read and write,....) to communicate and control the module, but they  never worked right
we have always no error in VisaWrite; in VisaRead we obtain or a  Timeout error or we read 0 bytes with no error.
However VisaWrite is not able to change module setting (we don't see the requested change in module output)!

We have verified that we have set rightly  read and write permission of serial port.
We have changed delay between read and write from 0 to 5000 ms.
We have enabled termination character ( \n  or \n\r) or disabled it.
Loopback test (pin 2 and 3 of RS232 connected) works properly.
Minicom works without error.

Have you got any suggestions.
Thanks in advance!

 
0 Kudos
Message 1 of 12
(4,177 Views)
Do the examples you tried allow you to configure the hardware handshaking? If not, you may need to add property nodes to set it up. I did not look at the LV 7 examples, so I am conmmenting generally, not on specific knowledge. Certainly LV can work with hardware hadnshaking if it is supported by your OS and comuter hardware.

Lynn
0 Kudos
Message 2 of 12
(4,135 Views)
0 Kudos
Message 3 of 12
(4,122 Views)
Hi
The examples I used allowed me to configure the hardware handshaking!
This module has no documentation, the manifacturer is not able to give other information apart that remote control using minicom works right. This module is a prototype!
Here is a Minicom view

Allego la schermata di minicom:

h1 (*****sent command****)
INFN MI compact electronic for pulse shape
Module 0
CH 0 CFth= 10 STRth= 5 P/Z= 5 FG=127 SH=3 CG=2 CGT=3 PIn STRen
CH 1 CFth= 10 STRth= 5 P/Z= 5 FG=127 SH=3 CG=3 CGT=3 PIn STRen
CH 2 CFth= 10 STRth= 5 P/Z= 5 FG=127 SH=3 CG=3 CGT=3 PIn STRen
CH 3 CFth= 10 STRth= 5 P/Z= 5 FG=122 SH=3 CG=3 CGT=3 PIn STRen
CH 4 CFth= 12 STRth= 5 P/Z= 5 FG=127 SH=3 CG=3 CGT=3 PIn STRen
CH 5 CFth= 12 STRth= 5 P/Z= 5 FG=127 SH=3 CG=3 CGT=3 PIn STRen
CH 6 CFth= 10 STRth= 5 P/Z= 5 FG=127 SH=3 CG=3 CGT=3 PIn STRen
CH 7 CFth= 12 STRth= 5 P/Z= 5 FG=127 SH=3 CG=3 CGT=3 PIn STRen
CH 8 CFth= 10 STRth= 5 P/Z= 5 FG=127 SH=3 CG=3 CGT=3 PIn STRen
CH 9 CFth= 12 STRth= 5 P/Z= 5 FG=127 SH=3 CG=3 CGT=3 PIn STRen
CH10 CFth= 10 STRth= 5 P/Z= 5 FG=127 SH=3 CG=3 CGT=3 PIn STRen
CH11 CFth= 12 STRth= 5 P/Z= 5 FG=127 SH=3 CG=3 CGT=3 PIn STRen
CH12 CFth= 10 STRth= 5 P/Z= 5 FG=127 SH=3 CG=3 CGT=3 PIn STRen
CH13 CFth= 10 STRth= 5 P/Z= 5 FG=127 SH=2 CG=3 CGT=3 PIn STRen
CH14 CFth= 10 STRth= 5 P/Z= 5 FG=127 SH=3 CG=3 CGT=3 PIn STRen
CH15 CFth= 10 STRth= 5 P/Z= 5 FG=127 SH=3 CG=3 CGT=3 PIn STRen
Mod=M CHsel=N CFDthr=C
STRthr=R P/Zadj=P FineG=g
CoarsG=G Mod=M
CHsel=N
CFDthr=C
STRthr=R
P/Z=P
FG=g
CG=G
Corse Gain Timing (0-3) Tx
Shaping time (0-3) Sx
Input Pol. (1 pos) Ix
STR_EN (1 enab) Ex
Help H1

n0
(*****sent command****)
CH 0 CFth= 10 STRth= 5 P/Z= 5 FG=127 SH=3 CG=2 CGT=3 PIn STRen

S0
(*****sent command****)
CH 0 CFth= 10 STRth= 5 P/Z= 5 FG=127 SH=0 CG=2 CGT=3 PIn STRen
i
You see, under Minicom all is right; but next months we will have about 10 modules with 16 channels (160 channels) and we need autoamtic procedure!
Help me!
Thanks

 
0 Kudos
Message 4 of 12
(4,113 Views)
I noticed this in your original post: "We have enabled termination character ( \n or \n\r) or disabled it."

Did you try \r ?

Lynn
0 Kudos
Message 5 of 12
(4,104 Views)
Yes we tired also \r!!!!
thanks
0 Kudos
Message 6 of 12
(4,105 Views)
Do you know that enabling the termination character with the VISA Configure Serial Port does nothing for terminating the write string and that the advanced example only allows for automatic sending of a single termination character. Are you sending a \r, \n, or both in your command string? Is the command string set for '\' Codes Display?
0 Kudos
Message 7 of 12
(4,096 Views)
I think you need to try unclebump's suggestion of looking at the data stream with some hardware device. Even a storage oscilloscope can be used. The trick is to adjust the triggering so that the last two or three characters can be captured. I have found baud rate, stop bit, and parity problems by looking at the bit patterns on a scope as well as identifying the characters sent.

Lynn
0 Kudos
Message 8 of 12
(4,092 Views)
Hi,
 I tried  options you suggested! They failed.
However when on Minicom I send an incorrect string, I get the answer

errore ????

Using LV i don't see this error even if i send a strange string!
What to do!
Thanks
0 Kudos
Message 9 of 12
(4,090 Views)

Here is some linux software that might help.

http://www.ibiblio.org/pub/Linux/system/serial/!INDEX.html

I haven't used any of these programs.

0 Kudos
Message 10 of 12
(4,066 Views)