Hello,

I am trying to get a digital output from KL2012 (with Buscoupler BK2012). 
Configuration is done without errors. My cyclic task looks as follows:
(similar to the user example)

/**********************************************************************************
ecrt_master_receive(master);
ecrt_domain_process(domain1);

if (counter) {
   counter--;
} else { // do this at 1 Hz
   counter = FREQUENCY;

   check_domain1_state();
   check_master_state();
   check_slave_config_states();

   printf("Nach %d Sekunde; Inhalt Domain1: %d\n", ++i, *(domain1_pd + 
offset[0]));
   *(domain1_pd + offset[0]) ^= 0xff;   //same problem with ...^= 0x1;
}

ecrt_domain_queue(domain1);
ecrt_master_send(master);
getchar();
**********************************************************************************/

Unfortunately the I/O Error LED of the Bouscoupler indicates failure. After
starting the timer in the application, the I/O Error LED switches on for about 
an
half second. After this a short light impulse is emitted by the I/O Run LED.

I suppose thats the impact of another problem: calling 
"ecrt_master_receive(master);"
in the cyclic task causes the setting of the slaves error flag. (from '+' to 
'E')

If necessary, you can find a summary of the configuration below.
Any suggestions are welcome.

Regards
Oliver



// Providing data:
const static ec_pdo_entry_reg_t domain1_regs[] = {
                {0x0000, 0x0000, 0x00000002, 0x04602c22, 0x7000 , 0x01,
                &offset[0], &bit_position[0]},
                {}
};

static ec_pdo_entry_info_t kl2012_channel1[] = {
                {0x7000, 0x0, 8}, // status
                {0x7000, 0x1, 1}  // value
};

static ec_pdo_info_t bk1120_pdos[] = {
                {0x1a00, 2, kl2012_channel1}
};

static ec_sync_info_t bk1120_syncs[] = {
                {2, EC_DIR_OUTPUT, 1, bk1120_pdos},
                {3, EC_DIR_INPUT},
                {0xff}
};


// Functioncalls: (in application all return values indicate success)
master = ecrt_request_master(0);
domain1 = ecrt_master_create_domain(master);
sc = ecrt_master_slave_config(master, 0, 0, 0x00000002, 0x04602c22);
ecrt_slave_config_pdos(sc, 1, bk1120_syncs);
ecrt_domain_reg_pdo_entry_list(domain1, domain1_regs);
ecrt_master_activate(master);
domain1_pd = ecrt_domain_data(domain1);

// the signal/timer source code was taken from user example

IMPORTANT NOTICE - The contents of this email and attachments are confidential. 
If you are not the intended recipient you must not use, copy, distribute or 
rely on this email and should please return it immediately or notify us by 
telephone. While we take every reasonable precaution to screen out computer 
viruses from emails, attachments to this email may contain such viruses. We 
cannot accept liability for loss or damage resulting from such viruses.  The 
integrity of email across the Internet cannot be guaranteed and SEMIKRON will 
not accept liability for any claims arising as a result of the use of this 
medium for transmissions by or to SEMIKRON.
_______________________________________________
etherlab-users mailing list
etherlab-users@etherlab.org
http://lists.etherlab.org/mailman/listinfo/etherlab-users

Reply via email to