Host Engineering Forum
General Category => Ethernet SDK => Topic started by: keith 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
-
Did you run this "simplified" code ONLY? The code you've eliminated could be the bottle neck (e.g. database access)???
-
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
-
Cool! 8)