<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi Mr Wilhelm,<br>
<br>
I managed to read necessary objects and construct cstruct output
myself. <br>
It looks OK when I compare it with the cstruct output.<br>
<br>
But still I can't access IO. <br>
<br>
For test, I tried to write to a 8 channel digital output device (AKD
DT 004, But twincat reads it as KL2408)<br>
I get the pdo entry offset using <b>ecrt_slave_config_reg_pdo_entry</b>
function.<br>
I pass the first channel object index and subindex (which is for
this case 0x7000:01) as parameters. Result seems OK. <br>
For only one device attached to coupler I get "2". I guess first two
bytes are reserved for the control word of the coupler.<br>
But nothing happens when I write to this domain data.<br>
<br>
I couldn't find any information about control word of the coupler.
Should I set something?<br>
Also I couldn't find any information about terminal tables too. How
should I set them?<br>
<br>
If you can send me a link of some documents I'd be very grateful.<br>
<br>
Best regards,<br>
Oguz.<br>
<br>
<div class="moz-cite-prefix">09.09.2014 22:02 tarihinde, Bilko AS,
Oguz Dilmac yazdı:<br>
</div>
<blockquote cite="mid:540F4ED8.80706@bilko-automation.com"
type="cite">Hi,
<br>
<br>
Infact we are using kollmorgen ECT 000 bus coupler. I examined the
device documents more carefully.
<br>
Thank you for the tips. I think I understand it now.
<br>
<br>
Best regards,
<br>
Oguz.
<br>
<br>
04.09.2014 11:35 tarihinde, Dr.-Ing. Wilhelm Hagemeister yazdı:
<br>
<blockquote type="cite">Hello,
<br>
<br>
<br>
"ethercat cstruct" tells you the meaning of the mapping (see
comments
<br>
after the pdo-entries):
<br>
<br>
Example:
<br>
<br>
/* Master 0, Slave 0
<br>
* Vendor ID: 0x00000002
<br>
* Product code: 0x04602c22
<br>
* Revision number: 0x00000000
<br>
*/
<br>
<br>
ec_pdo_entry_info_t slave_0_pdo_entries[] = {
<br>
{0xf100, 0x01, 16}, /* CouplerState */
<br>
{0x6020, 0x01, 8}, /* Channel 1 Status */
<br>
{0x0000, 0x00, 8}, /* Gap */
<br>
{0x6020, 0x03, 16}, /* Channel 1 Data */
<br>
{0x6020, 0x04, 8}, /* Channel 2 Status */
<br>
{0x0000, 0x00, 8}, /* Gap */
<br>
{0x6020, 0x06, 16}, /* Channel 2 Data */
<br>
{0x6020, 0x07, 8}, /* Channel 3 Status */
<br>
{0x0000, 0x00, 8}, /* Gap */
<br>
{0x6020, 0x09, 16}, /* Channel 3 Data */
<br>
{0x6020, 0x0a, 8}, /* Channel 4 Status */
<br>
{0x0000, 0x00, 8}, /* Gap */
<br>
{0x6020, 0x0c, 16}, /* Channel 4 Data */
<br>
{0x6030, 0x01, 8}, /* Channel 1 Status */
<br>
{0x0000, 0x00, 8}, /* Gap */
<br>
<br>
...
<br>
<br>
{0x6050, 0x04, 8}, /* Channel 2 Status */
<br>
{0x0000, 0x00, 8}, /* Gap */
<br>
{0x6050, 0x06, 16}, /* Channel 2 Data */
<br>
{0x6000, 0x01, 1}, /* Channel 1 */
<br>
{0x6000, 0x02, 1}, /* Channel 2 */
<br>
{0x6000, 0x03, 1}, /* Channel 3 */
<br>
{0x6000, 0x04, 1}, /* Channel 4 */
<br>
{0x6070, 0x01, 1}, /* Channel 1 */
<br>
{0x6070, 0x02, 1}, /* Channel 2 */
<br>
{0x0000, 0x00, 10}, /* Gap */
<br>
};
<br>
<br>
ec_pdo_info_t slave_0_pdos[] = {
<br>
{0x1aff, 1, slave_0_pdo_entries + 0}, /* Status PDO */
<br>
{0x1a02, 12, slave_0_pdo_entries + 1}, /* TxPDO Mapping
Terminal 003 */
<br>
{0x1a03, 12, slave_0_pdo_entries + 13}, /* TxPDO Mapping
Terminal 004 */
<br>
{0x1a04, 12, slave_0_pdo_entries + 25}, /* TxPDO Mapping
Terminal 005 */
<br>
{0x1a05, 6, slave_0_pdo_entries + 37}, /* TxPDO Mapping
Terminal 006 */
<br>
{0x1a00, 4, slave_0_pdo_entries + 43}, /* TxPDO Mapping
Terminal 001 */
<br>
{0x1a07, 2, slave_0_pdo_entries + 47}, /* TxPDO Mapping
Terminal 008 */
<br>
{0x1b01, 1, slave_0_pdo_entries + 49}, /* TxPDO Digital
Align */
<br>
};
<br>
<br>
ec_sync_info_t slave_0_syncs[] = {
<br>
{0, EC_DIR_OUTPUT, 0, NULL, EC_WD_DISABLE},
<br>
{1, EC_DIR_INPUT, 0, NULL, EC_WD_DISABLE},
<br>
{2, EC_DIR_OUTPUT, 0, NULL, EC_WD_DISABLE},
<br>
{3, EC_DIR_INPUT, 8, slave_0_pdos + 0, EC_WD_DISABLE},
<br>
{0xff}
<br>
};
<br>
<br>
<br>
End of example.
<br>
<br>
Usually analog-IO is mapped with a status + a fill byte before
the value
<br>
word. All analog or "complex" IO-Terminals are mapped first and
aligned
<br>
to 16bit. At the end the digital IO-termials with bit-mapping
follow
<br>
without gaps of fill bits.
<br>
<br>
The mapping of a single K-Bus slave is good documented in the
Beckhoff
<br>
documents for the terminal.
<br>
<br>
Also TwinCat can be used to find out the mapping.
<br>
<br>
Regards Wilhelm.
<br>
<br>
Am 04.09.2014 09:15, schrieb Bilko AS, Oguz Dilmac:
<br>
<blockquote type="cite">Hello
<br>
<br>
We have a problem with configuring BK1120. We made EK1100 run
without a
<br>
problem.
<br>
<br>
We found out that they are using different protocols to
communicate the
<br>
modules (BK1120 K-Bus, and EK110 E-Bus).
<br>
We searched for information on how to create the cstruct for
BK1120 and
<br>
how to map the connected I/0 modules but we couldnt find an
answer that
<br>
exactly answers our question.
<br>
<br>
Until now we ran "ethercat cstruct" and copy that into our
code and it
<br>
goes to run state, fine, but we need an example or explanation
of how
<br>
the connected modules match the entries in cstruct, where to
read or
<br>
write to the I/O.
<br>
<br>
Thanks
<br>
<br>
</blockquote>
<br>
<br>
</blockquote>
<br>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Oguz Dilmac
ARGE Bolumu
Bilko AS, R&D Department
====================================
Perpa Ticaret Merkezi B Blok Kat 13 Nr. 2568
TR-34384 Okmeydani Istanbul Turkey
Tel : +90 212 220 07 40 Fax : +90 212 210 47 01
e-mail : <a class="moz-txt-link-abbreviated" href="mailto:odilmac@bilko-automation.com">odilmac@bilko-automation.com</a>
web site : <a class="moz-txt-link-freetext" href="http://www.bilko-automation.com">http://www.bilko-automation.com</a></pre>
</body>
</html>