Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - taufiqsunar

Pages: [1]
1
Technical support / Re:Tech Tip & Sample Codes
« on: April 03, 2012, 02:33:31 AM »
I am sorry, maybe it is basic and fundamental, but because I am a newbie to this protocol, I want to ask a question.

Whether in the Modbus ASCII there are also functions like function 3,4,6,16, etc?

2
Technical support / Upload Feature on Internet Trilogi Software
« on: March 22, 2012, 05:03:11 AM »
Im sorry, I have another question.

Are there any upload feature on Internet Trilogi Software to backup the program from PLC to PC?

Currently Im using FMD1616-10 and Internet Trilogi 6.1

Thank you very much and regards!

3
Technical support / RS485 Modbus RTU Communicating with Autonics
« on: March 13, 2012, 12:52:42 AM »
Im a new user on Super PLC. Currently Im using FMD1616-10  to controlling slave device Autonics Temperature Controller TK4M with RS485.

The slave device can communicating with Modbus RTU Protocol.

The slave device ID is 1.

Im trying to access temperature value in that device. The address of present value is 03E8H, with function 04.

Im using the hard code from an example in this forum.

this is my code

Function first_set

Code: [Select]
SETPROTOCOL 3,1

Function read_autonics

Code: [Select]
A = &H03
B = &HE8
N = &H0A

FOR I = 0 TO 1
Z = INCOMM(3)
NEXT

call read_modbus

Function read_modbus

Code: [Select]
'  This function implements MODBUS RTU function 04 using the INCOMM and
'  OUTCOMM commands.
'  The address to be read is in A
'  The number of channel to be read is in N
'  The data are returned in DM[201] to DM[201+N]
'  DM[101] to DM[200] are used by this function

DM[101] = &H01     ' node address of slave
DM[102] = &H04     ' function 04
DM[103] = A    ' upper 8 bit of address
DM[104] = B ' lower 8 bit of address
DM[105] = &H00        ' upper 8 bit of count
DM[106] = N        ' lower 8 bit of count
X = CRC16 (DM[101],6) & &HFFFF  ' compute the CRC16 of DM[101] to DM[106]
DM[107] = X / 256    ' upper 8 bit of CRC16
DM[108] = X & &HFF ' lower 8 bit of CRC16

FOR I = 1 to 8          ' send out the MODBUS RTU command in binary
  OUTCOMM 3, DM[100+I]
NEXT
delay (10)  ' delay for a while to wait for response
DM[111] = 0
TIMERPV[1] = 10         ' if the timer counts down, the loop is exited
WHILE DM[111] <> &H01   ' wait for response and store first byte
 DM[111] = INCOMM (3)
 IF TIMERPV[1] = 0
  SETLCD 4,1, "NO RESPONSE         "
  RETURN
 ENDIF
ENDWHILE

FOR I = 1 to N          ' assuming small number of read data
  DM[111+I] = INCOMM (3)
  IF DM[111+I] < 0 GOTO @5: ENDIF
NEXT

@5 FOR I = 1 to N          ' convert two bytes into one 16-bit word.
  DM[200+I] = DM[112+I*2]*256+DM[113+I*2]
NEXT


in ladder diagram, on first row, there is a normally open button that can be executed once on starting the system, that activating function first_set

on second row, there is clock that triggering read_autonics every 1 second.

but that doesnt work at all. i checked the system with on-line monitoring and DM[111] just contain -1 in decimal and FFFFFFFF in hex.

any suggestion would be accepted! many thanks and regards

Taufiq Sunar
 ???

Pages: [1]