FieldPoint Family

cancel
Showing results for 
Search instead for 
Did you mean: 

cFP2120 - serial port problem

Hi,
 
I've already sent this question on the instrument control forum but KC suggested me to send it on a different forum.
 
So here's my application and the problem :
 
I want to communicate with a temperature calibrator through a RS232 interface, using Labview 8 (with the Real Time module) and a Compact Fieldpoint cFP2120 controller.
 
The communication tasks are : send a temperature setpoint - read back the temperature setpoint - read the calibrator temperature. 
 
I've built (to debug) a very simple VI in which I just write a command and read the answer of the calibrator.
 
The VI works perfectly (write and read) when I use the PC serial port. The problem is when I use the cfP2120 serial port.
 
The write commands seem to be correctly sent by the cFP and received by the calibrator but the results of the read commands are random and most of the time not correct.
 
Using the PC serial port, I receive a 9 bytes word each time I write a command. With the Fieldpoint serial port I receive from 0 to 9 bytes and the bytes are not the correct ones !!

So, is there something different between the PC serial port and the Fieldpoint one ???
 
I checked the configuration of the serial port, the time issues, I've read many post on this subject on the different forums but I have no more ideas to solve this problem.
 
Thanks in advance,
 
Fabien
0 Kudos
Message 1 of 9
(5,262 Views)
Hi Fabien,
   since I've LabVIEW 7.0, R-T, and not LabVIEW 8.0, I can't read your Vi, so it would be useful to post the vi in a back-compatible format (save it for LabVIEW 7, if you can).

   Anyway, in my cFP-2020, in general, I can run the same applications I run on my PC, caring only about different VISa names, eventually...

   What I suggest, is to try to use a communication protocol over  RS232 between your  PC  and cFP2120, building both client and server program in LabVIEW (I know you can debuug 2 applications at the same time in LV 8.0, even for different target).  If this doesn't work, check VISA driver of cFP module, wires....

   Since I couldn't open your VI, what are the communication settings (data bit, flow control, etc...)?

   Please, let me know! Greetings!

graziano
Message 2 of 9
(5,244 Views)

cyco-miko,

I do this all the time without any problems.  I have found no differences between the two. 

This sounds more like a connection issue.  Are you using the same serial cable to connect the pc and the cFP to the instrument?  If not look at the cable. 

 

centerbolt

0 Kudos
Message 3 of 9
(5,207 Views)
 
Hi Graziano, Hi Centerbolt,
 
You'll find my VI in the Labview 7.1 version.
 
The communication settings are :
9600 bauds ; 8 data bits ; No parity ; One stop Bit ; No end character
 
Graziano,
 
I don't really know how to apply your suggestion, could you please explain me a litlle more what should I do ?
 
About the VISA driver of the cFP module I don't really know what to check so I've just put in the cFP all the latest versions found on the NI website. Anyway with the latest drivers the results are the same, no problem of writing but random readings.
 
Centerbolt, concerning the cable, I use the same serial cable to connect the instrument to the PC or the cFP. The only possible solution I see is a difference between the PC and the cFP serial port, but I can I check that ???
 
Thanks for your help,
 
Fabien
0 Kudos
Message 4 of 9
(5,173 Views)
Hi Fabien,
   I'm still having problems to open your VI with my LabVIEW 7.1... It seems like you saved it for LV 8.0.

   Anyway, my suggestion was to develop an application for PC, by the means of which you write characters on the serial port, and to develop another application for cFP, by which you read characters written by the PC.  It's simple, it should work. It can train you with serial communication.

   I don't actually have simple application for doing that, but I'll check....

graziano
0 Kudos
Message 5 of 9
(5,162 Views)
Hi Fabien,
 
You said:
"concerning the cable, I use the same serial cable to connect the instrument to the PC or the cFP. The only possible solution I see is a difference between the PC and the cFP serial port, but I can I check that ???"
 
I had a similar problem connecting my serial device to the computer vs. connecting to cFP-2020.  I found that the "normal" computer cable switches pins 2 (RXD) and 3 (TXD) from one side to the other so that when you connect the TXD signal on your serial device to pin 3 of the cable, it's actuall pin 2 at the computer.  Not quite sure of the reason but PCs are configured this way so it's OK.  But according to the cFP manual (cFP-20xx, Table 3-2) it seems like it wants TXD at pin 3, in other words no switching of TXD/RXD.  To keep the pins in their same place at both ends of the cable I believe you need what's called a Null modem cable.  You can test your cable with an ohmmeter - see if pin 3 at one end is connected pin 3 at the other.
 
I'm working on a similar project, I'd like to see your code to see how you did it.  But Graziano is right, it's still in 8.0.
 
Hosehead
0 Kudos
Message 6 of 9
(5,108 Views)

Fabien,

Just got back from a little R&R.  Went back and revisited my serial projects.  I have successfully done this 2 different ways.  I have used the same  cable to talk both from the PC and cFP to the instrument.  I have also used one cable when talking from the pc to my instrument & a NI 10 position modular cable with the RJ connector when talking from my cFP to the Instrument.  In my case the instruments are DTE devices and require a custom null-modem (crossover ) cables.

The 9 pin serial port on the cFP is a DTE type just like the port on the PC.  Pinouts are identical.

You can look in the manual for your instrument to determine if it is a DTE or DCE device. 

Use a modem ( straight-thru ) cable to connect a DTE device to a DCE device.  Use a null-modem (crossover cable ) to connect a DTE device to another DTE device.  Be aware that there are many variations of crossover cables and the you need to find right one for your instrument if it is indeed a DTE device.

Can you give me the name and model # of the instrument you are using?  I'd be interested in reading the spec on its serial port.

I really don't think that your problem is pinouts.  This still sounds like a handshaking problem.

centerbolt

0 Kudos
Message 7 of 9
(5,089 Views)

Hi everybody,

As I also come back from holydays I make a global answer to your messages !!

Graziano, I try once again to save my Vi for LB7, hope it will be OK this time.
I've applied your suggestion so I built two VIs to send character from the PC and read it from the cFP and vice versa (like a client server application). The result is perfect. The number of character is determined by the "bytes at port" property (and the result is OK) and I exactly read what I've sent. No problem.

Hosehead and Centerbolt, I've checked the cable and it seems that I use the right one, a straight thru cable.
The instrument is (as far as I understood the DTE and DCE specifications) a DCE as the the Db-9 pin descriptions are :
Pin 2 : TXD
Pin 3 : RXD
Pin 5 : Ground
There's nothing more on the instrument manual.

So it should work well with a straight thru cable as the cFP DB-9 pins are :
Pin 2 : RXD
Pin 3 : TXD
Pin 5 : Ground

Moreover I insist on the fact that the writing from the cFP to the instrument works perfectly and that only the reading is random.

The instrument I'm trying to command is a temperature calibrator TC 150 from Tek Know (distributed by Scan Sense). The description of the serial interface is quite "light".

I tried to check all points you suggested but without success until now...

Thanks again for you help,

Fabien

0 Kudos
Message 8 of 9
(5,069 Views)

Fabien,

You are correct, the manual is very "light" on technical content.  No mention of any handshaking requirements at all.  Might see if the manufacturer has any more technical info on the RS-232 port.

The only difference between the PC and cFP should be some minor differences in speed of execution and maybe the default state of some of the handshaking lines on the serial port.  I suppose that you could also have a damaged RS-232 port on the cFP.

Do you have an oscillosope available?  It might be faster to remove your while loop, write a single command and watch what the instrument sends back to the cFP.

centerbolt

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