Author Topic: MD-HMI code with T100MD2424 and EXP16R  (Read 12519 times)

cch1955

  • Full Member
  • Posts: 198
  • Automated Machine Systems Designer
    • View Profile
MD-HMI code with T100MD2424 and EXP16R
« on: November 08, 2006, 03:11:07 PM »
Great one:
Do you have a routine for this combination as you do for the others? it would save some time
in having to modify the drivers included with the MD-HMI module. It appears
this combination has not been included with the downloads.
Thanks

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:MD-HMI code with T100MD2424 and EXP16R
« Reply #1 on: November 08, 2006, 03:30:04 PM »
T100MD2424 plus one EXP1616R would means that MD-HMI I/Os starts from 41 to 56. This is not included in the sample files.

The changes to be made are very simple. You can start off from the supplied file "HMI25to40.PC5". Shift the I/O table to move the keys to 41 to 56 (right click and select shift down). Then the only changes you need to make is in function 255

DM[3900] = INPUT[3]  ' Get data from input #33-48
DM[3901] = INPUT[4]  ' Get data from input #49-64

The rest of the programs are the same! Give it a try. That will show you how you can modify the program if you have other combinations of PLC + EXPs.

Below is the full text of the function 255 if it helps. If you still have a problem, email to support@tri-plc.com and we can email you the file we modified.

' This function handles the keypad scanning and make sure that a key must be
' pressed and released before the next key can accepted. It reserves the use
' of the Z$ string variable so you should avoid modifying Z$ in other part of
' the program.
'============================================================================

DM[3900] = INPUT[3]  ' Get data from input #33-48
DM[3901] = INPUT[4]  ' Get data from input #49-64

FOR I = 1 TO 8       ' shift right by 8 bit for DM[3901],DM[3900]
  RSHIFT DM[3900],2  
NEXT


IF DM[3900]=0   ' Now DM[3900] contains input #41-56
   Z = -1       ' no key pressed
   RETURN
ENDIF
IF Z >= 0       ' previous key has been pressed.
   IF TESTBIT(DM[3900],Z) RETURN  ' previous key not yet released
   ENDIF
ENDIF

FOR Z = 0 to 11   ' scan 0 to 9 and <- key
  IF TESTBIT(DM[3900],Z) GOTO @10: ENDIF
NEXT

@10 IF Z = 10     ' <Del> key has been pressed.
       IF LEN(Z$)>0
         Z$ = MID$(Z$,1,LEN(Z$)-1)
       ENDIF
    ELSE          ' Check if numeric keys 0-9 has been pressed.
       IF Z < 10 AND LEN(Z$) < 10   ' not more than 10 digits
         Z$ = Z$+STR$(Z)
       ENDIF
    ENDIF










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

cch1955

  • Full Member
  • Posts: 198
  • Automated Machine Systems Designer
    • View Profile
Re:MD-HMI code with T100MD2424 and EXP16R
« Reply #2 on: November 08, 2006, 04:20:34 PM »
Worked great ! thanks for the quick response. Another victory for
the small nimble company, nice work !