Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Turtle ph-meter serial interface

Hi, I'm trying to interface some ph-meters with labview 8.2. I did my job easily with the model Seven-easy from Mettler. It is  enough that you query the instrument and you get back the reading. So easy so good. I have another one : Turtle from Hanna Instruments model HI9815. The tool is quite nice, small and cheap very good for tiny jobs. It comes with a OEM software that reads the measure through a RS232C interface. Unfortunately, any satisfactory document is enclosed. I asked to the producer but no answer at all.
So I tried to use the "VISA Interactive controll" and with the standard settings I sent the query  *IDN\r and I got back the same answer. So it seems that the communication is open.
Then I monitored the communication with Portmon from the ph-meter and the OEM software and I collected the enclosed file. I was expecting to see some commands sent and  see data returned. However, even though  the OEM software was collecting data,  any  information seems  to be monitored by Portmon.  My opinion is that all the game is played with DTR settings.It is clear that I have no experience with this kind of communication.  Anyone can give me suggestions ?
Thanks in advance.
Gianmarco
0 Kudos
Message 1 of 12
(6,758 Views)

Greetings Gianmarco,

 

Thank for contacting National Instruments. So it looks like you are trying to communicate with an instrument that has limited documentation on the commands that it supports? It’s definitely a great start to use Portmon to see what commands and settings are being used by the 3rd party program for communication.

 

Unfortunately, I also don’t see anything in the zip file saying what commands were written out to the device or what data was received. Furthermore, I also have a concern about your *IDN\r query. You should never get back the same answer unless it was some kind of loop back test.

 

I’m sorry I don’t have any experience with that 3rd party instrument, but I would recommend looking on Google for any programmers manuals for that model or a similar one.

 

Let me know if you make any head way and good luck!

Jordan Randall
National Instruments Italy
0 Kudos
Message 2 of 12
(6,726 Views)
Hi

Instead of portmon you also can use NI-Spy to see what happens.

greetings from the Netherlands
0 Kudos
Message 3 of 12
(6,720 Views)
Sorry if I'm late in the answer but I had to verify something.
 
To Jordan: yes I suppose you are right, it is a loop back test. Whatever you write you get the same answer back. It is probably done to check if the instrument is connected to the PC. After that nothing happens.
To Albert : Ni spy to my knowledge is used to see call to Windows API. However it should work only with Ni software not with other producer. Am I wrong?
 
Some news about my problem. I opened the instrument and using a multimeter (the only tool I have) I identified the 6 wires going into the serial port.
The following table shows per each wire the meaning and the voltage when the instrument is connect but not reading (start) e when is reading (measure). All the voltages are vs the GND.
                                       start (Volts)            measure (Volts) 
wire 5-GND
wire 4-DSR\DTR             -6.26                     waving
wire 3-TXD-RXD             -7.70                     -7.5 fix
wire 3'-RXD-TXD            -7.70                     -7.5 fix
wire 2-DTR\DSR            -7.94                      waving
wire 1-CTS\RTS             -7.96                      waving
 
(wire 3 and 3' are joined together in the instrument but go in two different poles on the port). This makes me very confused. It is clear that DTR and RTS are setted high (more than 3 v). However, what it is surprising is that during reading  TXD/RXD are fixed and DTR\DSR and CTS\RTS seem to send data to the software, that actually makes the right reading. Waves for the three poles are apparently in-phase and they have the same amplitude.This goes too far from my limited knowledge of serial comm ! Any suggestions?
Regards
Gianmarco
PS the produced I finally contacted, he's not very keen to support the tool anymore. It is a pitty because the ph-meter is reasonably cheap and simple. Anyway no manual available.
0 Kudos
Message 4 of 12
(6,699 Views)

Gianmarco,

 

In the 3rd party program all you see is a loop back (i.e. the data you send out is the same as you get back)? Is that all the program does? That would be strange if the instrument shorted the send and receive lines for a functionality test. Does it actually get data back when using the 3rd party program with the instrument?

 

Also, NI-Spy is used to capture NI driver calls, such as NI-VISA, NI-488.2, NI-CAN, IVI calls, etc. Unless your third party program uses VISA, you will not be able to capture commands from it. You would have to continue using Portmon.

 

Well, good luck and Merry Christmas,

Jordan Randall
National Instruments Italy
0 Kudos
Message 5 of 12
(6,686 Views)
Hi Gianmarco
Sorry about the NI-spy, I did not read your message good enough.

But are you describing the pc- 9pole connector?
Or the pin numbers on the turtle side?

greetings from the Netherlands
0 Kudos
Message 6 of 12
(6,677 Views)
Thanks for your interest. Let me give an update. What I described in my previuos post is what I see from the PC side.  So it isn't surprising I get a loop back because wire 3 and 3'(joined together) go to pin 2 and 3 (TXD/RXD). So what's the meaning of that ? I'm working on the following idea :
 
1) the instrument is self powered. The sensor, the pH-probe connected to, needs a small amount of current to make the measure.
2) I suppose the current is taken from the serial interface (maybe from pin 6 or 4 or most probably pin 7)
3) pin 2 and 3 are loopback because the software makes an initial check that the instrument is there and that 's all.
4) the answer comes back through DTR (pin 4 and 6).
 
If this is true, there isn't actually a serial comm (that's why I cannot see bytes transfer during the reading in Portmon).Actually, it seems a simple way to make a data acquisition from the serial port (consider the tool was projected in 98). Now, the problem is to understand how the OEM software deals what is coming back and transforms it in the right measure.
 
As far as I know DSR/DTR pin should be only used as a switch (high/low). Is it allowed read bytes from this line through some window APIs ? I'm not aware of that.
If DTR/DSR is only a switch, information may come by the number of time it changes voltage (I saw a lot of changes of DTR in Portmon and I monitored a  change of potential by the multimeter). So the software may implement a counter that after calibration transform it in pH reading.
Does this make sense ? This tool is very strange !
Regards
Gianmarco
0 Kudos
Message 7 of 12
(6,668 Views)
Further information. I measured the Voltage trend during reading (reading starts approximately after point 20) see file enclosed. I measured all the pins refering to the ground GND(pin 5).
It comes clear that:
1) reading starts when CTS/RTS jumps from low to high and stays there.
2) bytes do not transit in lines TXD/RXD
3) all the game is played with the two wires DSR/DTR (pin 4 and 6)
 
Unfortunately, with my multimeter I can record just  a voltage per time, the graph is made collecting 4 independent measures. In all the cases however the pH-meter shows a pH : 8.3-8.4 so a stable value.  I have the same problem: what you can get from DTR/DSR ? How can the software transform the signal in a value ? Interesting for me .... maybe well know for some electronic engineer.
Gianmarco
0 Kudos
Message 8 of 12
(6,665 Views)
Hi

It almost looks as if DSR/DTr is a kind of answer for the clock on cts/rts
could it be i2c that does the communication?
i2c is not time critical, but most of the time mplemented via the parallel port.

try to find an oscilloscope and really measure this.
greetings from the Netherlands
0 Kudos
Message 9 of 12
(6,656 Views)
Hi Albert, it isn't the i2c protocol. However, your suggestion gave me the idea to open the instruments and see what are the ICs. There are only two: one is a standard amplifier ICL7612DCPA with no comm properties. The other is a Texas Instrument IC : TLC549. The datasheet is free for download from the site of the producer so I can enclose it. I haven't study it yet but I understood that it may convert the input in a train of picks, so the OEM software may count them as I was expecting. It'll be a good reading for the coming hollyday....
My warmest wishes for a nice Christmas!
Gianmarco
0 Kudos
Message 10 of 12
(6,652 Views)