Author Topic: T100MD+1616 Communication Issue  (Read 12067 times)

mtiller

  • Newbie
  • Posts: 5
  • I'm a llama!
    • View Profile
T100MD+1616 Communication Issue
« on: August 03, 2006, 12:30:13 PM »
I need help with this EZTouch Touch Panel,EZP-S6C-F, communications issue. I am connecting the T100MD+1616 with the touch panel via RS-232. Com # 11 for Modbus RTU.{ WriteMB2 11,1,1001,DM[1],1 }gives me a checksum error. I am showing connected to the Touchscreen via the touchscreen software. Cable pin out is as recommended. I have addressed 41001 which should correspond to DM[1]. The manuals aren't helping me out. When I write { WriteMB2 11,1,101,DM[1],1} with address 40102 set, I display numeral 6361 on the touch screen.?

SETLCD   0,1,CHR$(1)   ' Clear LCD screen
READMB2  13,2,0,DM[20],1
SETLCD  1,1,str$(DM[20])
WRITEMB2  11,1,101,DM[20],1
READMB2  11,1,101,DM[1],1
SETLCD  2,1,str$(DM[1])

When I execute this code I get a HEX value returned to the LCD display line 1, corresponding to the output of the M-7019R signal condidtioner. I want to convert this to decimal as a first problem. I only get a zero returned to line 2.

Thanks


support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:T100MD+1616 Communication Issue
« Reply #1 on: August 03, 2006, 01:15:29 PM »
If EZTouch is the MODBUS master, then the PLC is the Modbus slave and you SHOULD NOT execute any READMODBUS, WRITEMODBUS,  READMB2 or WRITEMB2 command on channel 11 (comm1 RTU channel) as this will interfere with the EZTouch trying to talk to the PLC via COMM1 RS232 port.

Your PLC program doesn't need to do anything specific in order to use it with a MODBUS master like EZtouch. You just need to define in the EZTouch an object with a Modbus address that map to one of the PLC's internal register.

However, if the EZTouch is to be permanent attached to the PLC, then we recommend that in your PLC program you may like to execute the SETPROTOCOL command once to set COMM1 into Modbus RTU only protocol. This can improve the response to MODBUS command from the EZTouch.

« Last Edit: August 03, 2006, 01:19:33 PM by support »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

mtiller

  • Newbie
  • Posts: 5
  • I'm a llama!
    • View Profile
Re:T100MD+1616 Communication Issue
« Reply #2 on: August 03, 2006, 02:09:29 PM »
I'm trying it now....Thanks for responding so fast.-Mike

mtiller

  • Newbie
  • Posts: 5
  • I'm a llama!
    • View Profile
Re:T100MD+1616 Communication Issue
« Reply #3 on: August 03, 2006, 02:48:20 PM »
You are THE MAN. Now we're working.Now,I need to correct my unit conversion. The LCD reads 5952 HEX. I'm injecting 250*C into the M-7019R and 5952 HEX is 228.66 *C, very close. Just need to adjust Type K thermocouple compensation. The EZTouch reads 1740 BCD. I'm going to change that in the EZTouch if I can. How do I convert the HEX to integer engineering units using MODBUS RTU on the PLC, COM#13, as I am now?

Code now, is as below,  EZTouch register tagname is 41001,
corresponding to DM[1].

SETLCD 0,1,CHR$(1)   ' Clear LCD screen
READMB2 13,2,0,DM[1],1
SETLCD 1,1,str$(DM[1])

May you host Silicon Spin at Embedded Parties everywhere.
Tokens of thanks going ground.<Mike>



support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:T100MD+1616 Communication Issue
« Reply #4 on: August 04, 2006, 06:21:26 AM »
Although TBASIC doesn't support floating point, you can still display numeric with decimal point on the LCD easily.

Can you configure M-7019R to return data in fixed point format? That can save you from doing the conversion yourself.You need a formula to convert the Hex digit into fixed point integer representation of temperature. E.g. say if every unit represent 0.01 degree, then 228.66 degree will be represented as 22866 after your conversion.

To display DM[1] with two decimal places, do the following:

 SETLCD 1,1, STR$(DM[1]/100)+"."+ STR$(DM[1] mod 100)

Email: support@triplc.com
Tel: 1-877-TRI-PLCS

mtiller

  • Newbie
  • Posts: 5
  • I'm a llama!
    • View Profile
Re:T100MD+1616 Communication Issue
« Reply #5 on: August 04, 2006, 10:37:48 AM »
Thanks Exceedingly Much.
-Llama from the emperor's new school.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:T100MD+1616 Communication Issue
« Reply #6 on: August 07, 2006, 03:24:43 PM »
I just ran some test on the M-7018P using the MODBUS protocol. What I found out was that M-7018P only send back data in 2's complement Hex value and it actually represents the 16-bit 2's complement ADC data that is returned from analog module. It is not the temperature data. Hence to convert to temperature you need to check the full scale range of the thermocouple type and convert the ADC readings to temperature.

E.g. I used a K-type thermocouple and got a reading of 650 decimal in DM[1]. On DCON this is shown in Hexadecimal format as 028A.

   The reading = 650/32768 = +0.01984 of Full scale positive.
    Full scale positive for K-type = +1372 degree C
   ==>  0.01984 x 1372 = 27.2 degree C which is the room temperature.

In TBASIC, assuming the M-7018 data is read into DM[1], the conversion formula should be as follow:

   T = DM[1]*1372*100/32768

The above computation will give you the result of up to 0.01 degree C. resolution i.e.  a value of 12345 means temperature = 123.45 degree C.

Hence if EZTouch can do the computation then you can read the data directly from DM[1] and does the conversion on EZ-Touch. If not, then the computation has to be performed by the PLC and only the final result is read by EZ touch.

« Last Edit: August 07, 2006, 03:40:40 PM by support »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

mtiller

  • Newbie
  • Posts: 5
  • I'm a llama!
    • View Profile
Re:T100MD+1616 Communication Issue
« Reply #7 on: August 07, 2006, 04:16:21 PM »
I smile every time I see your ad in Embedded Systems Programming.
Yabb&LeonRRockin!
ThankYou,GentleMen.