iCub-main
Loading...
Searching...
No Matches
opcManager_cfg4pc104.c
Go to the documentation of this file.
1/*
2 * Copyright (C) 2013 iCub Facility - Istituto Italiano di Tecnologia
3 * Author: Valentina Gaggero
4 * email: valentina.gaggero@iit.it
5 * website: www.robotcub.org
6 * Permission is granted to copy, distribute, and/or modify this program
7 * under the terms of the GNU General Public License, version 2 or any
8 * later version published by the Free Software Foundation.
9 *
10 * A copy of the license can be found at
11 * http://www.robotcub.org/icub/license/gpl.txt
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
16 * Public License for more details
17*/
18
19// --------------------------------------------------------------------------------------------------------------------
20// - external dependencies
21// --------------------------------------------------------------------------------------------------------------------
22
23
24#include "stdio.h"
25#include "stdlib.h"
26#include "string.h"
27#include "EoCommon.h"
28#include "EoDiagnostics.h"
29#include "OPCprotocolManager.h"
30#include "OPCprotocolManager_Cfg.h"
31
32
33// --------------------------------------------------------------------------------------------------------------------
34// - declaration of extern public interface
35// --------------------------------------------------------------------------------------------------------------------
36
37
38
39// --------------------------------------------------------------------------------------------------------------------
40// - declaration of extern hidden interface
41// --------------------------------------------------------------------------------------------------------------------
42
43
44
45// --------------------------------------------------------------------------------------------------------------------
46// - #define with internal scope
47// --------------------------------------------------------------------------------------------------------------------
48
49
50
51// --------------------------------------------------------------------------------------------------------------------
52// - definition (and initialisation) of extern variables, but better using _get(), _set()
53// --------------------------------------------------------------------------------------------------------------------
54extern eOdgn_commands_t dgnCommands;
55extern uint32_t cmdena_rxsetPointCheck;
56extern uint8_t board;
57
58// --------------------------------------------------------------------------------------------------------------------
59// - typedef with internal scope
60// --------------------------------------------------------------------------------------------------------------------
61typedef struct
62{
63 uint32_t sum;
65
66
67
68// --------------------------------------------------------------------------------------------------------------------
69// - declaration of static functions
70// --------------------------------------------------------------------------------------------------------------------
71static void s_print_emsperiph_candata(eOdgn_canstatus_t *canst_ptr);
72static void on_rec_emsperiph(opcprotman_opc_t opc, opcprotman_var_map_t* map, void* recdata);
73
74static void on_rec_emsapplcommon(opcprotman_opc_t opc, opcprotman_var_map_t* map, void* recdata);
75static void s_print_emsapplcomm_core(eOdgn_coreapplication_t *appcore_ptr);
76static void s_print_emsapplcomm_ipnet(eOdgn_ipnet_t *appipnet_ptr);
77static void s_print_emsapplcomm_transceiver(eOdgn_embObjtransceiver_t *apptrans_ptr);
78
79static void on_rec_emsapplmc(opcprotman_opc_t opc, opcprotman_var_map_t* map, void* recdata);
80static void s_print_emsapplmc_encoderserror(eOdgn_encoderreads_t *encreads);
81
82static void on_rec_motorstflags(opcprotman_opc_t opc, opcprotman_var_map_t* map, void* recdata);
83static void on_rec_errorLog(opcprotman_opc_t opc, opcprotman_var_map_t* map, void* recdata);
84
85static void on_rec_canQueueStatistics(opcprotman_opc_t opc, opcprotman_var_map_t* map, void* recdata);
86static void on_rec_rxcheckSetpoints(opcprotman_opc_t opc, opcprotman_var_map_t* map, void* recdata);
87
88
89/*
90extern void on_rec_runner_debug(opcprotman_opc_t opc, opcprotman_var_map_t* map, void* recdata)
91{ // for the host
92
93 EOMtheEMSrunnerDEBUG_t* data = (EOMtheEMSrunnerDEBUG_t*)recdata;
94
95 switch(opc)
96 {
97
98 default:
99 case opcprotman_opc_set:
100 { // nobody can order that to us
101 // we just dont do it ...
102 } break;
103
104 case opcprotman_opc_say: // someboby has replied to a ask we sent
105 case opcprotman_opc_sig: // someboby has spontaneously sent some data
106 {
107
108 printf("\n\n-----received data of runner---\n");
109
110 printf("numberofperiods=%lld\n ", data->numberofperiods);
111 printf("cumulativeabsoluteerrorinperiod=%lld\n ", data->cumulativeabsoluteerrorinperiod);
112 printf("meanofabsoluteerrorinperiod=%d\n ", data->meanofabsoluteerrorinperiod);
113
114 printf("movingmeanofabsoluteerrorinperiod=%d\n ", data->movingmeanofabsoluteerrorinperiod);
115 printf("maxabsoluteerrorinperiod=%d\n ", data->maxabsoluteerrorinperiod);
116 printf("minabsoluteerrorinperiod=%d\n ", data->minabsoluteerrorinperiod);
117
118 printf("executionoverflows[0]=%d\n ", data->executionoverflows[0]);
119 printf("executionoverflows[1]=%d\n ", data->executionoverflows[1]);
120 printf("executionoverflows[2]=%d\n ", data->executionoverflows[2]);
121 printf("datagrams_failed_to_go_in_txsocket=%d\n ", data->datagrams_failed_to_go_in_txsocket);
122
123 } break;
124 }
125
126}
127*/
128
129
130
131
132// --------------------------------------------------------------------------------------------------------------------
133// - definition (and initialisation) of static variables
134// --------------------------------------------------------------------------------------------------------------------
135static eOdgn_emsapplication_emswithmc_t s_emswithmc_data;
136static ethCounters_total ethCounterBoards[9][3] = {{0}}; //9= num of boards; 3 is num of eth links
137
138// --------------------------------------------------------------------------------------------------------------------
139// - definition of extern public functions
140// --------------------------------------------------------------------------------------------------------------------
141
142extern opcprotman_res_t opcprotman_personalize_database(OPCprotocolManager *p)
143{
144 opcprotman_res_t res = opcprotman_OK;
145
146/* personalize eodgn_nvidbdoor_cmd */
147 res = opcprotman_personalize_var( p,
148 eodgn_nvidbdoor_cmds,
149 (void*)&dgnCommands,
150 NULL); //here I'm not interested in callback func on received, becose ems never will send me it
151
152 if(opcprotman_OK != res)
153 {
154 return(res);
155 }
156/* personalize eodgn_nvidbdoor_errorlog */
157 res = opcprotman_personalize_var( p,
158 eodgn_nvidbdoor_errorlog,
159 NULL,//use NULL because i'd like print received data and not store them!!
160 //pay attention: see NOTE 1 at the end of this function!!!
162
163 if(opcprotman_OK != res)
164 {
165 return(res);
166 }
167/*personalize eodgn_nvidbdoor_emsperiph var*/
168 res = opcprotman_personalize_var( p,
169 eodgn_nvidbdoor_emsperiph,
170 NULL, //use NULL because i'd like print received data and not store them!!
171 //pay attention: see NOTE 1 at the end of this function!!!
173
174 if(opcprotman_OK != res)
175 {
176 return(res);
177 }
178
179
180/*personalize eodgn_nvidbdoor_emsapplcommon var*/
181 res = opcprotman_personalize_var( p,
182 eodgn_nvidbdoor_emsapplcommon,
183 NULL, //use NULL because i'd like print received data and not store them!!
184 //pay attention: see NOTE 1 at the end of this function!!!
186
187 if(opcprotman_OK != res)
188 {
189 return(res);
190 }
191
192
193/*personalize eodgn_nvidbdoor_emsapplmc var*/
194 res = opcprotman_personalize_var( p,
195 eodgn_nvidbdoor_emsapplmc,
196 (void*)&s_emswithmc_data,
198
199 if(opcprotman_OK != res)
200 {
201 return(res);
202 }
203
204
205/*personalize eodgn_nvidbdoor_motorstatus var*/
206 res = opcprotman_personalize_var( p,
207 eodgn_nvidbdoor_motorstatus,
208 NULL, //use NULL because i'd like print received data and not store them!!
209 //pay attention: see NOTE 1 at the end of this function!!!
211
212 if(opcprotman_OK != res)
213 {
214 return(res);
215 }
216
217 /*personalize eodgn_nvidbdoor_jointsStateCmd var*/
218 res = opcprotman_personalize_var( p,
219 eodgn_nvidbdoor_canQueueStatistics,
220 NULL,
222
223 if(opcprotman_OK != res)
224 {
225 return(res);
226 }
227 /*personalize eodgn_nvidbdoor_rxcheckSetpoints var */
228 res = opcprotman_personalize_var( p,
229 eodgn_nvidbdoor_rxcheckSetpoints,
230 NULL,
232
233 if(opcprotman_OK != res)
234 {
235 return(res);
236 }
237
238 return(res);
239
240 /* NOTE 1:
241 * if ems doesn't send ask, that needs a reply, it is possible use NULL like data pointer.
242 * in case of replay the opcprotman object replay by coping data pointed by var_ram param to the message response automatically,
243 * so if var_ram is null the application will not send the response.
244 * Moreover you can use NULL pointer even you are not interested in storing received data, but only check or print them.
245 * */
246}
247
248// --------------------------------------------------------------------------------------------------------------------
249// - definition of extern hidden functions
250// --------------------------------------------------------------------------------------------------------------------
251
252
253
254
255// --------------------------------------------------------------------------------------------------------------------
256// - definition of static functions
257// --------------------------------------------------------------------------------------------------------------------
258static void s_print_emsperiph_candata(eOdgn_canstatus_t *canst_ptr)
259{
260 printf("\t\twarning=%d passive=%d busoff=%d\n", canst_ptr->hw.warning, canst_ptr->hw.passive, canst_ptr->hw.busoff);
261 printf("\t\thw_rx_queue_is_full=%d\n", canst_ptr->hw.rxqueueisfull);
262 printf("\t\tsw_rx_queue_is_full=%d sw_tx_queue_is_full=%d dummy=0x%x\n", canst_ptr->sw.rxqueueisfull, canst_ptr->sw.txqueueisfull, canst_ptr->sw.dummy);
263}
264
265static void on_rec_emsperiph(opcprotman_opc_t opc, opcprotman_var_map_t* map, void* recdata)
266{
267 eOdgn_emsperipheralstatus_t* data = (eOdgn_emsperipheralstatus_t*)recdata;
268 uint8_t i;
269 uint8_t myboard;
270
271 switch(opc)
272 {
273
274 default:
275 case opcprotman_opc_set:
276 { // nobody can order that to us
277 // we just dont do it ...
278 } break;
279
280 case opcprotman_opc_say: // someboby has replied to a ask we sent
281 case opcprotman_opc_sig: // someboby has spontaneously sent some data
282 {
283
284 printf("-----EMS periph data---\n");
285 printf("\t CAN 1:\n");
286 s_print_emsperiph_candata(&data->can_dev[0]);
287 printf("\t CAN 2:\n");
288 s_print_emsperiph_candata(&data->can_dev[1]);
289 printf("\t ETH MASK: 0x%x\n", data->eth_dev.linksmask);
290 for(i=0; i<3; i++)
291 {
292 if(((data->eth_dev.crcErrorCnt_validVal & (1<<i)) == (1<<i)))
293 {
294 int overflow=0;
295 if(((data->eth_dev.crcErrorCnt_overflow & (1<<i)) == (1<<i)))
296 {
297 overflow =1;
298 }
299 printf("\t CRC_error phy-port %d: %d overflow=%d", i, data->eth_dev.crcErrorCnt[i], overflow);
300 if(board>9)
301 {
302 //in case i use board on desk with addr 99
303 myboard = 0;
304 }
305 else
306 {
307 myboard = board-1;
308 }
309 ethCounterBoards[myboard][i].sum += data->eth_dev.crcErrorCnt[i];
310 printf(" Sum=%d", ethCounterBoards[myboard][i].sum);
311 }
312 else
313 {
314 printf("\t CRC_error phy-port %d: INVALID VALUE", i);
315 }
316
317 }
318 printf("\n");
319 for(i=0; i<3; i++)
320 {
321 printf("\t i2cError %d on phy-port %d", data->eth_dev.i2c_error[i], i);
322 }
323 printf("\n");
324 fflush(stdout);
325
326 } break;
327 }
328
329
330}
331
332static void on_rec_emsapplcommon(opcprotman_opc_t opc, opcprotman_var_map_t* map, void* recdata)
333{
334
335 eOdgn_emsapplication_common_t* data = (eOdgn_emsapplication_common_t*)recdata;
336
337 switch(opc)
338 {
339
340 default:
341 case opcprotman_opc_set:
342 { // nobody can order that to us
343 // we just dont do it ...
344 } break;
345
346 case opcprotman_opc_say: // someboby has replied to a ask we sent
347 case opcprotman_opc_sig: // someboby has spontaneously sent some data
348 {
349
350 printf("-----EMS appl common---\n");
351
355
356 fflush(stdout);
357 } break;
358 }
359}
360
361static void s_print_emsapplcomm_core(eOdgn_coreapplication_t *appcore_ptr)
362{
363 printf("\tRUNNING ST\n");
364 printf("\t\tnumberofperiods=%ld\n ", appcore_ptr->runst.numberofperiods);
365 printf("\t\tcumulativeabsoluteerrorinperiod=%ld\n ", appcore_ptr->runst.cumulativeabsoluteerrorinperiod);
366 printf("\t\tmeanofabsoluteerrorinperiod=%d\n ", appcore_ptr->runst.meanofabsoluteerrorinperiod);
367
368 printf("\t\tmovingmeanofabsoluteerrorinperiod=%d\n ", appcore_ptr->runst.movingmeanofabsoluteerrorinperiod);
369 printf("\t\tmaxabsoluteerrorinperiod=%d\n ", appcore_ptr->runst.maxabsoluteerrorinperiod);
370 printf("\t\tminabsoluteerrorinperiod=%d\n ", appcore_ptr->runst.minabsoluteerrorinperiod);
371
372 printf("\t\texecutionoverflows[0]=%d\n ", appcore_ptr->runst.executionoverflows[0]);
373 printf("\t\texecutionoverflows[1]=%d\n ", appcore_ptr->runst.executionoverflows[1]);
374 printf("\t\texecutionoverflows[2]=%d\n ", appcore_ptr->runst.executionoverflows[2]);
375 printf("\t\tdatagrams_failed_to_go_in_txsocket=%d\n ", appcore_ptr->runst.datagrams_failed_to_go_in_txsocket);
376 printf("\t\tcantxfailuretimeoutsemaphore=%d\n ", appcore_ptr->runst.cantxfailuretimeoutsemaphore);
377
378 printf("\tCONFIG ST\n");
379 printf("\t\tcantxfailuretimeoutsemaphore=%d\n ", appcore_ptr->cfgst.cantxfailuretimeoutsemaphore);
380}
381static void s_print_emsapplcomm_ipnet(eOdgn_ipnet_t *appipnet_ptr)
382{
383 printf("\tIPNET INFO\n");
384 printf("\t\tdatagrams_failed_to_go_in_rxfifo=%d\n ", appipnet_ptr->datagrams_failed_to_go_in_rxfifo);
385 printf("\t\tdatagrams_failed_to_go_in_txosalqueue=%d\n ", appipnet_ptr->datagrams_failed_to_go_in_txosalqueue);
386 printf("\t\tdatagrams_failed_to_be_retrieved_from_txfifo=%d\n ", appipnet_ptr->datagrams_failed_to_be_retrieved_from_txfifo);
387 printf("\t\tdatagrams_failed_to_be_sent_by_ipal=%d\n ", appipnet_ptr->datagrams_failed_to_be_sent_by_ipal);
388}
389static void s_print_emsapplcomm_transceiver(eOdgn_embObjtransceiver_t *apptrans_ptr)
390{
391
392 printf("\tTRANSCEIVER INFO\n");
393 printf("\t\trxinvalidropframes=%d\n ", apptrans_ptr->rxinvalidropframes);
394 printf("\t\trxseqnumwrong=%d\n ", apptrans_ptr->rxseqnumwrong);
395 printf("\t\tlostreplies=%d\n ", apptrans_ptr->lostreplies);
396 printf("\t\tfailuresinloadofreplyropframe=%d\n ", apptrans_ptr->failuresinloadofreplyropframe);
397 printf("\t\ttxropframeistoobigforthepacket=%d\n ", apptrans_ptr->txropframeistoobigforthepacket);
398 printf("\t\tcannotloadropinregulars=%d\n ", apptrans_ptr->cannotloadropinregulars);
399 printf("\t\tcannotloadropinoccasionals=%d\n ", apptrans_ptr->cannotloadropinoccasionals);
400
401
402}
403
404
405static void on_rec_emsapplmc(opcprotman_opc_t opc, opcprotman_var_map_t* map, void* recdata)
406{
407
408 eOdgn_emsapplication_emswithmc_t* data = (eOdgn_emsapplication_emswithmc_t*)recdata;
409
410 switch(opc)
411 {
412
413 default:
414 case opcprotman_opc_set:
415 { // nobody can order that to us
416 // we just dont do it ...
417 } break;
418
419 case opcprotman_opc_say: // someboby has replied to a ask we sent
420 case opcprotman_opc_sig: // someboby has spontaneously sent some data
421 {
422
423 printf("-----EMS appl mc---\n");
424
425
426// s_print_emsapplmc_encoderserror(&(data->encreads));
427//
428//
429// printf("Limited current mask: 0x%x\n", data->encreads.dummy);
430//
431// fflush(stdout);
432// memcpy(&s_emswithmc_data, data, sizeof(eOdgn_emsapplication_emswithmc_t));
433
434
435
436 if(memcmp(&data->encreads.encList[0], &s_emswithmc_data.encreads.encList[0], eOdgn_emsmaxnumofencoders*sizeof(eOappEncReader_error_t)) != 0)
437 {
438 //if i received new data about encoders' error
440 }
441 fflush(stdout);
442 memcpy(&s_emswithmc_data, data, sizeof(eOdgn_emsapplication_emswithmc_t));
443
444 } break;
445 }
446
447}
448
449static void s_print_emsapplmc_encoderserror(eOdgn_encoderreads_t *encreads)
450{
451 uint32_t i;
452 for(i=0; i<6; i++)
453 {
454 printf("Encoder num %d\t", i);
455 printf("\t err_onReadFromSpi=%d ", encreads->encList[i].err_onReadFromSpi);
456 printf("err_onParityError=%d ", encreads->encList[i].err_onParityError);
457 printf("err_onInvalidValue=%d \n", encreads->encList[i].err_onInvalidValue);
458 }
459 printf("\tcount=%d\n", encreads->count);
460}
461
462static void on_rec_motorstflags(opcprotman_opc_t opc, opcprotman_var_map_t* map, void* recdata)
463{
464 eOdgn_motorstatusflags_t* data = (eOdgn_motorstatusflags_t*)recdata;
465 uint8_t i;
466 char stroutput[300];
467
468 switch(opc)
469 {
470
471 default:
472 case opcprotman_opc_set:
473 { // nobody can order that to us
474 // we just dont do it ...
475 } break;
476
477 case opcprotman_opc_say: // someboby has replied to a ask we sent
478 case opcprotman_opc_sig: // someboby has spontaneously sent some data
479 {
480
481 printf("-----motor status flag---\n");
482
483 for(i=0; i<12; i++)
484 {
485 if(data->motorlist[i] != 0)
486 {
487 sprintf(stroutput, "motor %d with err flags=0x%x: ", i, data->motorlist[i]);
488 if((data->motorlist[i] & DGN_MOTOR_FAULT_UNDERVOLTAGE) == DGN_MOTOR_FAULT_UNDERVOLTAGE)
489 strcat(stroutput, "UNDERVOLTAGE, ");
490 if((data->motorlist[i] & DGN_MOTOR_FAULT_OVERVOLTAGE) == DGN_MOTOR_FAULT_OVERVOLTAGE)
491 strcat(stroutput, "OVERVOLTAGE, ");
492 if((data->motorlist[i] & DGN_MOTOR_FAULT_EXTERNAL) == DGN_MOTOR_FAULT_EXTERNAL)
493 strcat(stroutput, "EXTERNAL, ");
494 if((data->motorlist[i] & DGN_MOTOR_FAULT_OVERCURRENT) == DGN_MOTOR_FAULT_OVERCURRENT)
495 strcat(stroutput, "OVERCURRENT, ");
496 if((data->motorlist[i] & DGN_MOTOR_FAULT_I2TFAILURE) == DGN_MOTOR_FAULT_I2TFAILURE)
497 strcat(stroutput, "I2TFAILURE, ");
498 if((data->motorlist[i] & DGN_MOTOR_FAULT_CANRECWARNING) == DGN_MOTOR_FAULT_CANRECWARNING)
499 strcat(stroutput, "CANRECWARNING, ");
500 if((data->motorlist[i] & DGN_MOTOR_FAULT_CANRECERROR) == DGN_MOTOR_FAULT_CANRECERROR)
501 strcat(stroutput, "CANRECERROR, ");
502 if((data->motorlist[i] & DGN_MOTOR_FAULT_CANRECHWOVERRUN) == DGN_MOTOR_FAULT_CANRECHWOVERRUN)
503 strcat(stroutput, "CANRECHWOVERRUN ");
504 printf("%s\n", stroutput);
505 }
506 }
507
508
509 fflush(stdout);
510 } break;
511 }
512
513}
514
515
516static void on_rec_errorLog(opcprotman_opc_t opc, opcprotman_var_map_t* map, void* recdata)
517{
518 eOdgn_errorlog_t *data = (eOdgn_errorlog_t *)recdata;
519
520 printf("----- switch to error state because... \n");
521 printf("\t%s\n", data->errorstate_str);
522}
523
524static void on_rec_canQueueStatistics(opcprotman_opc_t opc, opcprotman_var_map_t* map, void* recdata)
525{
526 eOdgn_can_statistics_t* data = (eOdgn_can_statistics_t*)recdata;
527 uint8_t i;
528
529 switch(opc)
530 {
531
532 default:
533 case opcprotman_opc_set:
534 { // nobody can order that to us
535 // we just dont do it ...
536 } break;
537
538 case opcprotman_opc_say: // someboby has replied to a ask we sent
539 case opcprotman_opc_sig: // someboby has spontaneously sent some data
540 {
541
542 printf("-----can queue statistics ---\n");
543
544 printf("Config_mode: ");
545 for(i=0; i<2; i++)
546 {
547 printf("\t port %d ==> rx.min=%d, rx.max=%d, tx.min=%d, tx.max=%d\n\t",i, data->config_mode.stat[i].info_rx.min, data->config_mode.stat[i].info_rx.max,
548 data->config_mode.stat[i].info_tx.min, data->config_mode.stat[i].info_tx.max);
549 }
550 printf("\nRun_mode: ");
551 for(i=0; i<2; i++)
552 {
553 printf("\t port %d ==> rx.min=%d, rx.max=%d, tx.min=%d, tx.max=%d\n\t",i, data->run_mode.stat[i].info_rx.min, data->run_mode.stat[i].info_rx.max,
554 data->run_mode.stat[i].info_tx.min, data->run_mode.stat[i].info_tx.max);
555 }
556 fflush(stdout);
557 } break;
558 }
559
560
561}
562//static void on_rec_jointsStateCmd(opcprotman_opc_t opc, opcprotman_var_map_t* map, void* recdata)
563//{
564// eOdgn_jointsStateCmd_t* data = (eOdgn_jointsStateCmd_t*)recdata;
565// uint8_t i;
566//
567// switch(opc)
568// {
569//
570// default:
571// case opcprotman_opc_set:
572// { // nobody can order that to us
573// // we just dont do it ...
574// } break;
575//
576// case opcprotman_opc_say: // someboby has replied to a ask we sent
577// case opcprotman_opc_sig: // someboby has spontaneously sent some data
578// {
579//
580// printf("-----joints last received cmd---\n");
581//
582// for(i=0; i<12; i++)
583// {
584//
585// printf("j %d cmd=0x%x last_two_are_equal=%d\n", i, data->jLastRecCmd[i], data->lastTwoEqual[i]);
586// }
587//
588//
589// fflush(stdout);
590// } break;
591// }
592//
593//}
594
595
596
597
598static void on_rec_rxcheckSetpoints(opcprotman_opc_t opc, opcprotman_var_map_t* map, void* recdata)
599{
600
601 eOdgn_rxCheckSetpoints_t* data = (eOdgn_rxCheckSetpoints_t*)recdata;
602 uint8_t i;
603
605 {
606 return;
607 }
608
609
610 switch(opc)
611 {
612
613 default:
614 case opcprotman_opc_set:
615 { // nobody can order that to us
616 // we just dont do it ...
617 } break;
618
619 case opcprotman_opc_say: // someboby has replied to a ask we sent
620 case opcprotman_opc_sig: // someboby has spontaneously sent some data
621 {
622
623 printf("\n\n-----rx check setpoints---\n");
624
625 for(i=0; i<4; i++)
626 {
627 //printf("\tj %d: pos-deltaprognum 0x%x pos-deltarxtime0x%x imp-deltaprognum 0x%x imp-deltarxtime0x%x\n", i, data->position[i].deltaprognumber, data->position[i].deltarxtime, data->impedence[i].deltaprognumber, data->impedence[i].deltarxtime);
628 printf("\tj %d: pos-deltaprognum =", i );
629 if(data->position[i].deltaprognumber == INT32_MAX)
630 {
631 printf(" __ ");
632 }
633 else
634 {
635 printf(" %d ", data->position[i].deltaprognumber);
636 }
637
638 printf(" pos-deltarxtime =");
639 if(data->position[i].deltarxtime == UINT32_MAX)
640 {
641 printf(" __ ");
642 }
643 else
644 {
645 printf(" %d ", data->position[i].deltarxtime);
646 }
647
648 printf(" imp-deltaprognum =");
649
650 if(data->impedence[i].deltaprognumber == INT32_MAX)
651 {
652 printf(" __ ");
653 }
654 else
655 {
656 printf(" %d ", data->impedence[i].deltaprognumber);
657 }
658
659
660 printf(" imp-deltarxtime=");
661
662 if(data->impedence[i].deltarxtime == UINT32_MAX)
663 {
664 printf(" __ \n");
665 }
666 else
667 {
668 printf(" %d \n", data->impedence[i].deltarxtime);
669 }
670
671 }
672
673
674 fflush(stdout);
675 } break;
676 }
677
678
679}
680// --------------------------------------------------------------------------------------------------------------------
681// - end-of-file (leave a blank line after)
682// --------------------------------------------------------------------------------------------------------------------
683
684
685
686
687
@ data
opcprotman_res_t opcprotman_personalize_database(OPCprotocolManager *p)
static void on_rec_emsapplcommon(opcprotman_opc_t opc, opcprotman_var_map_t *map, void *recdata)
static void on_rec_emsperiph(opcprotman_opc_t opc, opcprotman_var_map_t *map, void *recdata)
uint8_t board
static void on_rec_rxcheckSetpoints(opcprotman_opc_t opc, opcprotman_var_map_t *map, void *recdata)
static eOdgn_emsapplication_emswithmc_t s_emswithmc_data
static void on_rec_canQueueStatistics(opcprotman_opc_t opc, opcprotman_var_map_t *map, void *recdata)
static void on_rec_emsapplmc(opcprotman_opc_t opc, opcprotman_var_map_t *map, void *recdata)
static void on_rec_errorLog(opcprotman_opc_t opc, opcprotman_var_map_t *map, void *recdata)
static void on_rec_motorstflags(opcprotman_opc_t opc, opcprotman_var_map_t *map, void *recdata)
static void s_print_emsapplcomm_ipnet(eOdgn_ipnet_t *appipnet_ptr)
eOdgn_commands_t dgnCommands
static void s_print_emsperiph_candata(eOdgn_canstatus_t *canst_ptr)
static ethCounters_total ethCounterBoards[9][3]
static void s_print_emsapplmc_encoderserror(eOdgn_encoderreads_t *encreads)
static void s_print_emsapplcomm_core(eOdgn_coreapplication_t *appcore_ptr)
uint32_t cmdena_rxsetPointCheck
static void s_print_emsapplcomm_transceiver(eOdgn_embObjtransceiver_t *apptrans_ptr)