Author Topic: Connecting two T100MD's together?  (Read 8968 times)

skj1402

  • Newbie
  • Posts: 28
  • The Innovator!
    • View Profile
Connecting two T100MD's together?
« on: April 19, 2007, 11:25:47 AM »
I'm running a program of around 6.5Kb on my T100MD which takes in a rapid pulse train and operates a number of outputs also in a rapid fashion.
Unfortunately counts are being missed due to the relatively long scan time for this program (using the HSC is not an option as this just triggers CusF's and my requirement is too rapid for these to execute in the time available), so I was wondering if sharing the program between a Master T100MD and a Slave T100MD would be an option.
I would use the Master to run the main control program, while the slave would service the high speed counting of the pulse train, and the high speed operation of the outputs.
I have three questions:
1) Can I simply connect them together via the digital connectors (as you would do with a 4040 board), and have direct access to both eeproms, so that I can upload 1 program of say 5kb's into the Master and one of 1.5kbs into the Slave, thuse reducing the scan time on both? Or will I need to connect them together using the RS485 method?
2) Would this arrangement allow me to easily control the Slave from the Master, and to pass data to and from each of them?
3) Would this arrangement be more straightforward to do, rather than using an E10 as the slave (can this acquire a high speed pulse train too?). ::)

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Connecting two T100MD's together?
« Reply #1 on: April 19, 2007, 02:18:59 PM »
What do you need to do with the pulse train? Is it to count the number of pulses or to perform frequency measurement?

Did you try using the Interrupt inputs to execute custom function every time the input transition from off to on or on to off?

You can't connect the expansion connector between two PLCs. You have to use RS485 to communicate between them. The slave PLC can have only a smalll program to handle the high speed input locally but the master controller can start/stop the slave controller to configure it to do what it wants.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

skj1402

  • Newbie
  • Posts: 28
  • The Innovator!
    • View Profile
Re:Connecting two T100MD's together?
« Reply #2 on: April 20, 2007, 05:04:30 AM »
The pulse train, which has a max frequency of approx 300Hz (3.3 ms/cycle, but could be half that speed), is used to measure distances and operate external devices over preset distances via the outputs down to a resolution of 1 cycle i.e. one on/off cycle = 3.3 to 6.6 ms.

I have tried using interupts, but I still have the same problem i.e missing counts when the pulse speed exceeds a certain rate. I can only assume that the CPU gets too busy servicing the ever increasing interupt rate! The interupts are also integral to Cusf's and these in turn still need to issue SETIO/CLRIO commands to drive the outputs, and so scan time again becomes an issue.

My train of thought is to have the slave service the high pulse rate input and drive the high rate output too, providing I can keep the size of the program relatively small so that the scan cycle captures every pulse cycle, and services every output command. Do you agree?

 :-\

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Connecting two T100MD's together?
« Reply #3 on: April 20, 2007, 07:27:04 AM »
When you use the SETIO/CLRIO command did you follow with a REFRESH command? The REFRESH command takes up to 2ms to updates all physical I/O (which automatically perform input debouncing) and can affect your scan time badly if executed repeatedly. If you only have no more than 2 outputs that you want to control rapidly, try using the SETPWM command to drive the PWM1 and PWM2 outputs to 100% (ON) or 0% (OFF) which changes the output immediately upon execution and does not need REFRESH or wait for ladder logic end to update the physical I/O. That may keep the CPU scan time to below your minimum cycle time.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

skj1402

  • Newbie
  • Posts: 28
  • The Innovator!
    • View Profile
Re:Connecting two T100MD's together?
« Reply #4 on: April 24, 2007, 12:19:58 PM »
I've used the routine both with and without REFRESH but I still lost counts.
I have since utilized another T100MD as a slave unit and have six counters incorporated in a small routine. Tests using the conventional I/O input to each of them now seems to confirm that all counts are now being recognised. The interupt method i.e. INTRDEF 1,4,1 where Cusf #4 contained CtrPV[1]=CtrPV[1]+1, so as to increment the counts, didn't appear to work, as counts were still being lost.

I have in fact 3 outputs to change rapidly so will your suggestion of " try using the SETPWM command to drive the PWM1 and PWM2 outputs to 100% (ON) or 0% (OFF) " still work?

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Connecting two T100MD's together?
« Reply #5 on: April 24, 2007, 12:58:15 PM »
If everything is done sequentially in ladder program then letting the standard end of scan refresh to do the output update is limited by the I/O scan time of about 2ms. SETPWM method is to avoid using the REFRESH command in TBASIC so it is still faster if you need to change an output repeatedly inside a custom function since you don't need to execute the REFRESH command to update the physical output.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS