Communication Protocols
Copyright IXXAT Automation GmbH
103
IEM Manual, 1.5
host application has to evaluate the event and reset the IEM. In case of a reset
1 service request the application has to load the factory defaults and restart
the IEM (see DemoMain()). In case of a reset 0 only a restart of the IEM is
necessary.
5.2.4.2 Remote Access
Accessing the object model of a remote device via EMI API services requires
the specification of the target IP address. The application has to call
to open an unconnected explicit message con-
nection to the remote device (see Figure 5 8). Several remote connections can
be open in parallel.
COM_t_BOARD_REF td_brdRef = ...
COM_e_ERROR e_ret;
COM_t_SERVICE_DATA s_request;
COM_t_REQUEST_REF s_reqRef;
COM_t_SERVICE_HEADER *ps_h =(COM_t_SERVICE_HEADER*)&s_request.ab_comData[0];
COM_t_REMOTE_OPEN s_service;
COM_t_SERVICE_DATA *ps_response;
memset(&s_request, 0x00, sizeof(COM_t_SERVICE_DATA));
memset(&s_service,0x00,sizeof(COM_t_REMOTE_OPEN));
ps_h->pb_data = (UINT8*)&s_service; // link to service command
ps_h->dw_size = sizeof(COM_t_REMOTE_OPEN);
// specify target IP address
s_service.s_target.s_eip.dw_remoteAddress = TARGET_IP_ADDRESS;
// enqueue service request
e_ret = EMI_srvRemoteConnOpen(td_brdRef, &s_request, &s_reqRef);
// send request and wait for response (signalled via callback)
while (!received) // global variable received is set in callback
{
e_ret = EMI_srvServiceHandle(td_brdRef);
}
// read connection reference
e_ret = EMI_srvrespQuery(&s_conRef, s_reqRef, NULL, &ps_response);
// deallocate dynamic memory of response
e_ret = EMI_srvrespServiceCompleted(s_reqRef);
Figure 5-15: Opening a remote connection
5.2.5 States and events
State changes of the EtherNet/IP protocol are forwarded to the host and can
be read by the application using
. The current state is
available by masking the lowest 16 bits of the MSM state.