Comet system forum

Discussion forum about Comet system products

Temperature, Humdity,

Pressure Transmitters

and Data Loggers

You are not logged in.

#1 11-06-2009 01:20:22

paulei
Member
From: Portugal
Registered: 11-06-2009
Posts: 6

temperatura transmiter T0410 modbus help?

I.

I have 2 T0410 communicating with a PC (WinXP) through a ELO E06D (232 - 485).
I already program each transmiter (9600, addr 1 & addr 2; ModBus).
I'm programing a routine in VBExpress 2008.
Serial port parameters:
baudrate = 9600
databits = 8
parity = none
stopbits =2
handshake = XOnXOff

  I have downloaded your pdf file "Description of communication protocols of Txxxx series", where an example to read temperature is:
>Reading of temperature, address 0x0031
>Modbus command:
>device address: 01
>reading 16-bit registers 03
>initial address Hi 00
>initial address Lo 31
>number read registers Hi 00
>number read registers Lo 01
>Via link is physically sent: 01 03 00 30 00 01 84 05

sending "01 03 00 30 00 01 84 05" i have no response from transmiter.

questions:
   which are the corrects registers addresses?
   Is this pdf not udpated!?
   I just need to send the reading command?
   After command, i have to wait for reading serialport?

Thank you...

Offline

 

#2 11-06-2009 09:45:19

MichalV
Administrator
Registered: 18-06-2007
Posts: 132

Re: temperatura transmiter T0410 modbus help?

Hello,

first change handshake setting to Off.

How do you send data to serial port? Each of example commnad number is hexadecimal.
If you use serial port directly, use write command for request and then use read command to get answer.
Somethink like this pseudocode :

Code:

Command = 01 03 00 30 00 01 84 05 //this is array of bytes, not string like this "01 03 00 30 00 01 84 05"
MySerialPort->Open
MySerialPort->WriteBuffer( Command )
WaitSomeSmallTime
MySerialPort->ReadBuffer( Answer )
MySerialPort->Close

Try capture data from serial port - use e.g. ComSpy utility. You can see what data are physicaly transferred through serial port.

Did it help you?

Have a nice day

Mike

Offline

 

#3 11-06-2009 10:31:58

paulei
Member
From: Portugal
Registered: 11-06-2009
Posts: 6

Re: temperatura transmiter T0410 modbus help?

I.

I change handshack, it work im waiting time for probe responce.

I'm sending 01 03 00 30 00 01 84 05 in hex chars, no responce from probe.
Sendind 01 03 00 31 00 03 54 04, probe send 1 3 6 D8 F1 D8 F1 D8 F1 BE AF.
this contain 1st reading temp, afther power on probes and i think te maximum value!?
I cant get real time reading...

I try a comspy.

the configuration program for the probes (sensor setup utility) reads the real time tempereture.
in the comspy, the utlility is sending repeted comand "01 03 00 30 00 04 44 06"...

Question:
   hwo can i get the real time temp reding?

tanks

Offline

 

#4 11-06-2009 10:38:10

paulei
Member
From: Portugal
Registered: 11-06-2009
Posts: 6

Re: temperatura transmiter T0410 modbus help?

sorry, wrond command.
the utility is sending 02 03 00 08 00 02 45 FA

Offline

 

#5 11-06-2009 12:37:43

MichalV
Administrator
Registered: 18-06-2007
Posts: 132

Re: temperatura transmiter T0410 modbus help?

Yes, have a look at what sensor setup utility sending is great idea. But utility use some different addresses. This addresses are not public, because returned values are MSP float values (Texas Instrument) and have more complicated conversion to normal value. Finally it's possible send you information about this.

I think your steps are right, but something is wrong. Please, connect one of your devices only, set it's address to 1 and try communicate.

About your command 01 03 00 31 00 03 54 04:
01 -- device address
03 -- function code (read holding registers)
0031 -- starting register address
0003 -- number of registers for read (3 registers here)
5404 -- CRC
It means: Read 3 registers from holding registers starting at address 31 from device 1.
The answer was 3 times error value (D8F1 = -9999) because your device has no relative humidity probe, no computed values and no barometric pressure probe.

For temperature reading use command from example. If doesn't work, check serial port setting and/or your RS485/RS232 converter (some flow control problems).

don't forget: register 0x31 is physically sent as value 0x30, 0x32 as 0x31… (zero based addressing)

Offline

 

#6 11-06-2009 17:15:56

paulei
Member
From: Portugal
Registered: 11-06-2009
Posts: 6

Re: temperatura transmiter T0410 modbus help?

Not working...

it's strange that i have response from probe to the other commands and "01 03 00 30 00 01 84 05" not works...
I even correct the 485 terminator that my supplyer send me (bad conected), and nothing...
my version of probes fiemware is 2.34

If there is any possibility to guide how to decode the response to "01 03 00 08 00 02 45 C9" I can get reading. if de utility program can do it, i have to get it to...

this are the only commands send by the utility program (reading always 64 registers)
01 03 10 00 00 40 40 FA - Serial number
01 03 20 00 00 40 4F FA - Address of device / communictaction speed
01 03 30 00 00 40 4B 3A - Firmware version

then repet this command

01 03 00 08 00 02 45 C9 - values ??????

its vary fast and with few communicating faults...

tanks

Offline

 

#7 12-06-2009 09:33:51

MichalV
Administrator
Registered: 18-06-2007
Posts: 132

Re: temperatura transmiter T0410 modbus help?

You can read measured values at MSP Float format (Texas Instruments format). Each value is represented as 4 Bytes (you must read 2 Words for each).
Value                         Register
Temperature               0x0009
Relative humidity         0x000B
Computed value          0x000D
Pressure                     0x000F
Don't forget, register value is physically by 1 less (0x0008,0x000A,0x000C,0x000E).

Some information about MSP float are here.


Could you give me assistance to discover why common command don't work on your side?
Please, download this utility, run it and try communicate with your sensor (especially from address 0x0031).
Is there any problem?
Thanks for your help.

Mike

Offline

 

#8 12-06-2009 18:52:24

paulei
Member
From: Portugal
Registered: 11-06-2009
Posts: 6

Re: temperatura transmiter T0410 modbus help?

I.
Thank you very much.
Now i can get it...

1st, i studie de MSP floating formulas.
Then i try the utility program you post-me.

I put the addr h0030 and read it. its works...
then i go to my aplication i say to my self, "my have to work too".
Until i found that i'm not sending the correct hex char (whit comspy).
I was working with a wrong ascii enconding table.
Some VB web search, i found the correct one (just for the record, encoding 1252 is the full ascii).

One last question.
wen reading negative, for ex -10.2 the minus is represented whith hFF on MSB and h9A LSB

Formula
(MSB xor LBS + carry) = result1
convert result1 to decimal and multiply whit -1^carry
Divide by 10.

example:
(hFF XOR h9A + h01) = h66
h66 => 102
102*-1^1=-102
-102/10 = -10.2ºC
------------------------------------------------------------------

Thank you for the time Mike.

Regards,
Paulei

Offline

 

#9 17-06-2009 08:00:00

MichalV
Administrator
Registered: 18-06-2007
Posts: 132

Re: temperatura transmiter T0410 modbus help?

Read 16b number. Get the highest bit that represents the sign. If this bit is 1, negate the number and increment by 1. Convert result to decimal and multiply with -1. Finally convert number to real dividing it by 10.

--------------------------------------------------
Example:
Read hFF9A (1111111110011010)
GetHightestBit = 1
(hFF9A xor hFFFF) + h0001 = h0066
h0066 ~ 102
102*-1 = -102
-102 / 10 = -10.2
-------------------------------------------------

Mike

Offline

 

#10 21-06-2009 23:49:59

paulei
Member
From: Portugal
Registered: 11-06-2009
Posts: 6

Re: temperatura transmiter T0410 modbus help?

I Mike.

i was got-it.

Tanks for helping-me.

regards,
Paulei

Offline

 

Board footer

Powered by PunBB | CZ / SK
© Copyright 2002–2005 Rickard Andersson