[etherlab-users] CIFX50RE PDO
Henry Bausley
hbausley at deltatau.com
Tue Nov 9 18:34:28 CET 2010
Check if your device has notLRW set.
If so you are going to need to have a separate domain for input and
output.
On Tue, 2010-11-09 at 10:39 +0100, Wilfried Holzke wrote:
> Hi,
>
> I trying to transfer process data to and from a CIFX50RE pci card from
> Hilscher. With Twincat software it works. I am able to read and write
> data to the CIFX50RE card.
>
> If I use the IgH EtherCAT Master, I am only able to write data to the
> outputs. For my tests I use the rtai example of the ethercat master.
>
> If I only add the entry for data out to domain1_reg then it works.
> The working counter changes to 1/1. And a can read for example 06 on the
> slave.
>
> But if I add the entry for data input, I get working counter 0/3
> (ethercat domain -v) and no change.
>
> If I only add the entry for data input, I get working counter 0/1
> and no change.
>
> I made the following modifications to the example code:
>
> ----------------------------------------------------------------------
> // process data
> static uint8_t *domain1_pd; // process data memory
>
> #define DataIoSlavePos 0, 0
>
> #define CIFX_RE_ECS 0xE0000044, 0x00000001
>
> static unsigned int off_data_out; // offsets for PDO entries
> static unsigned int off_data_in; // offsets for PDO entries
>
> const static ec_pdo_entry_reg_t domain1_regs[] = {
> // { DataIoSlavePos , CIFX_RE_ECS, 0x3000 , 1 , &off_data_in },
> { DataIoSlavePos , CIFX_RE_ECS, 0x2000 , 1 , &off_data_out },
> {}
> };
>
> static unsigned int counter = 0;
> static unsigned int blink = 0;
>
> /*****************************************************************************/
>
> /* Master 0, Slave 0, "CIFX RE/ECS"
> * Vendor ID: 0xE0000044
> * Product code: 0x00000001
> * Revision number: 0x00000002
> */
>
> ec_pdo_entry_info_t slave_0_pdo_entries[] = {
> {0x2000, 0x01, 8}, /* 1 Byte Out (0) */
> ...
> {0x2000, 0xc8, 8}, /* 1 Byte Out (199) */
> {0x3000, 0x01, 8}, /* 1 Byte In (0) */
> ...
> {0x3000, 0xc8, 8}, /* 1 Byte In (199) */
> };
>
> ec_pdo_info_t slave_0_pdos[] = {
> {0x1600, 200, slave_0_pdo_entries + 0}, /* 1. RxPDO */
> {0x1A00, 200, slave_0_pdo_entries + 200}, /* 1. TxPDO */
> };
>
> ec_sync_info_t slave_0_syncs[] = {
> {0, EC_DIR_OUTPUT, 0, NULL, EC_WD_DISABLE},
> {1, EC_DIR_INPUT, 0, NULL, EC_WD_DISABLE},
> {2, EC_DIR_OUTPUT, 1, slave_0_pdos + 0, EC_WD_ENABLE},
> {3, EC_DIR_INPUT, 1, slave_0_pdos + 1, EC_WD_DEFAULT},
> {0xff}
> };
> ----------------------------------------------------------------------
>
> Further on I removed the configuration for the second slave (sc).
>
> I tried "etherlab upload 0x3000 1" and I get the value which I have
> written from the slave.
>
> Do I miss something in my configuration?
> Thanks for hints.
>
> regards
>
> W. Holzke
> _______________________________________________
> etherlab-users mailing list
> etherlab-users at etherlab.org
> http://lists.etherlab.org/mailman/listinfo/etherlab-users
**********************************************************
Outbound scan for Spam or Virus by Barracuda at Delta Tau
**********************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20101109/08cc0fd8/attachment-0004.htm>
More information about the Etherlab-users
mailing list