News:

  • April 16, 2024, 03:39:53 AM

Login with username, password and session length

Author Topic: How use "Host Ethernet SDK" for ECOM  (Read 4028 times)

NitraMa

  • Newbie
  • *
  • Posts: 4
How use "Host Ethernet SDK" for ECOM
« on: June 05, 2007, 11:38:29 AM »
Hi, I use for the first time the directLogic product so my questions are:

I download "Host_Ethernet_SDK.zip" and I look the demo code "EtherIO" in c++ and it seem to be code for EBC...   Here is what is in the readme file :
   The samples found in DEMOCODE\. The samples included are ...
      ...EQ which demos the basic query and interrogate of all ether products, ...
         (OK is the EtherQry folder)          
      ...ETHERIO which demos logical address resolution ...
         (Error, it's probably the EtherOI folder but in the ETHERIO.CPP file, is the code for EBC (see line 1159@1164) )
      ...and a non-blocking CCM transaction to an Hx-ECOM, ...
         (OK, is the EtherCCM folder)
      ...ETHERIO which demos logical address resolution and an IO read operation on an EBC.
         (Error, it'S probably the EbcIO folder)       

So can I have a code example for communication with ECOM protocol read and write into some "V" register.   And by the way, I need some precision about the HEICCMRequest. 
   - This fonciton use for the CCM protocol...  but my PLC is configure with the ECOM protocol.  Is this fonction while work.
   - the param DataType... I see the table, but which value must I write here? Probably 31 mean 1...
   - the param address... this param is in HEX ?

int HEICCMRequest
(
HEIDevice *pDevice,    // Device to perform request on
BOOL bWrite,       // if TRUE, we are writing data
         // if FALSE, we are reading data
BYTE DataType,    // Type of data to read / write
         // (see table below and DirectNET manual)
WORD Address,    // Address of data to read / write
         // (see table below and DirectNET manual)
WORD DataLen,    // Length of data to read / write
         // (see table below and DirectNET manual)
BYTE *pData       // Buffer for read / write data
         // (see table below and DirectNET manual)
);

Thank you

MikeS

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 254
    • Host Engineering, Inc.
Re: How use "Host Ethernet SDK" for ECOM
« Reply #1 on: June 05, 2007, 03:16:01 PM »
"CCM" & DirectNET are the same protocol, CCM is the old GE/TI name, DirectNET is the AutomationDirect.com name.

ECOM protocol is not a true protocol, it's a protocol that only DirectSOFT uses, it's purpose is to take full advantage of the ECOM's speed. It uses DirectNET protocol for everything that it can, and it uses K-Sequence only for the things it has to (for example writing to single bits and performing some of the diagnostic and management functions).

1. the API HEI_CCMRequest() is the function you'll use to read and write the PLC v-memory and I/O.
2. there's a file on our web called CCMDetails.pdf that details the parameters for this function call, the DataType, Offset, Ranges and Lengths.
3. the address are in hex. one thing to watch out for is the PLC addresses are in octal, and they are 0-based, each memory type starts numbering with 0 (x0, y0, v0); CCM addresses are in hex and are 1-based. the conversion formula is (convert V-address to octal) then add 1.

I hope this helps.
Good design costs a lot. Bad design costs even more.