News:

  • May 01, 2026, 05:51:11 PM

Login with username, password and session length

Author Topic: H2ECOM throughput when used with SDK  (Read 25588 times)

keith

  • Full Member
  • ***
  • Posts: 21
H2ECOM throughput when used with SDK
« on: June 20, 2007, 02:26:27 PM »
I am using a H2ECOM with the SDK.  I am talking to a system with a D2-250-1 CPU.  I read a 28 word block of vmemory and write a 18 word block of vmemory in a continuous update cycle from a PC.

I do the read with HEICCMRequest a single read, followed by a single write:
[simplified code with error handling and other details removed]
  for ( ; ; )
    {
    s = HEICCMRequest (&device, FALSE, 0x31, rstart + 1, 2 * nr, (BYTE *) rblock);
    s = HEICCMRequest (&device, TRUE, 0x31, wstart + 1, 2 * nw, (BYTE *) wblock);
    [there is also code to check the return value s on each call,  not included here]
    SleepEx for 100 MS
    }

[I also tried sleeping 50Ms between the 2 HEICCMRequest calls]

My reads & writes don't fail, but my update rate is slow.  It takes 1 - 3 seconds for the
PLC to see the data changes.  I would like to see the data in 100 to 500 miliseconds. 

I am not using the card for any other purpose at the same time (I.E. there is no I/O to it in my  ladder).

Is there a better way to get a faster update cycle ?
What kind of throughput can I expect from the H2ECOM ?
whold a H2ECOM100 give me more throughput ?
Is there some luckey number of words the card transfers per PLC scan ?
Which is better, K-Sequence or DirectNet ?

I also want to know about throughput when using a 06 PLC with a H0-ECOM.
[some of my smaller systems use this configuration]

Keith
« Last Edit: June 20, 2007, 02:33:30 PM by keith »

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3806
    • Host Engineering
Re: H2ECOM throughput when used with SDK
« Reply #1 on: June 20, 2007, 02:33:47 PM »
Did you run this "simplified" code ONLY?  The code you've eliminated could be the bottle neck (e.g. database access)???

keith

  • Full Member
  • ***
  • Posts: 21
Re: H2ECOM throughput when used with SDK
« Reply #2 on: July 02, 2007, 12:31:21 AM »
Sure enough, I was doing somthing else in the same thread which was slowing it down.  Restructured the threads in my program, and everything works great.

I actually wrote a test program to transfer 18 words in and 28 words out once
every 25 miliseconds.  In the block I increment a count, and in my test ladder logic, I check for missing counts.  It can run all day and never generate a missed count.  (in other words, whenever the ladder logic sees the value change, it is
always in a increment of 1)

I also put a GetTickCount () call in the C program, to monitor for the longest time between
update loops.

works better than I could have dreamed it would work.

Thanks
Keith
« Last Edit: July 02, 2007, 12:48:46 AM by keith »

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3806
    • Host Engineering
Re: H2ECOM throughput when used with SDK
« Reply #3 on: July 02, 2007, 10:06:37 AM »
Cool!    8)