[etherlab-users] Userspace application.

Shiva V M C shivamachnalle at gmail.com
Wed Feb 13 12:58:51 CET 2019


Hi all,
I have done with my user space application and I m able to run the
application too.
Now I want to perform 2 exercise i.e.,
1.ecrt_reg_request_write();
2.ecrt_reg_request_read();
I m able to read the particular register,but couldn't able to write on any
of the register.
So,could any one help me whats happening?.

This is my code snippet.
 #define DigInSlavePos  0, 0
#define Beckhoff_EL1240 0x00000002, 0x02312862

I m doing this before activating master,

if(!(sc_dig_in =
ecrt_master_slave_config(master,DigInSlavePos,Beckhoff_EL1240)))
{
fprintf(stderr, "Failed to configure BeckHoff  Salve.\n");
        return -1;
 }
regis=ecrt_slave_config_create_reg_request(sc_dig_in,127);

Then called cyclic_task as below
void cyclic_task()
  {
  ec_reg_request *regis;
  ecrt_master_receive(master);
   ecrt_domain_process(domain1);
   check_domain1_state(); //optional
   if (counter) counter--;
   else
    {   counter = FREQUENCY;
         blink = !blink;
         check_master_state(); //optional
         check_slave_config_states(); //optional;
         ecrt_reg_request_write(regis,0xf80, 64);
         sleep(1);
         ecrt_reg_request_read(regis,0xf80, 64);
        // send process data
         ecrt_domain_queue(domain1);
         ecrt_master_send(master);
      }
}


-- 

*Thanks & Regards*

*Shiva V M C09880153358*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20190213/bb51be5e/attachment.html>


More information about the etherlab-users mailing list