1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
/*      File: clipx.h
 *       This file is part of the program ethercatcpp-clipx
 *       Program description : EtherCAT driver libraries for HMB ClipX
 *       Copyright (C) 2018-2022 -  Robin Passama (CNRS/LIRMM) Arnaud Meline
 * (CNRS/LIRMM). All Right reserved.
 *
 *       This software is free software: you can redistribute it and/or modify
 *       it under the terms of the CeCILL-C license as published by
 *       the CEA CNRS INRIA, either version 1
 *       of the License, or (at your option) any later version.
 *       This software is distributed in the hope that it will be useful,
 *       but WITHOUT ANY WARRANTY without even the implied warranty of
 *       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 *       CeCILL-C License for more details.
 *
 *       You should have received a copy of the CeCILL-C License
 *       along with this software. If not, it can be found on the official
 * website of the CeCILL licenses family (http://www.cecill.info/index.en.html).
 */
/**
 * @defgroup ethercatcpp-clipx ethercatcpp-clipx: HMB clipx driver
 *
 * This library provides a ethercatcpp driver for the HMB clipx device, a device
 * used for force sensor acquisition.
 *
 */
/**
 * @file clipx.h
 * @author Robin Passama (maintenace)
 * @author Arnaud Meline (original author)
 * @brief EtherCAT driver for HMB ClipX device.
 * @date October 2018 12.
 * @ingroup ethercatcpp-clipx
 * @example clipx_example.cpp
 */
#pragma once

#include <ethercatcpp/core.h>

/*! \namespace ethercatcpp
 *
 */
namespace ethercatcpp {
/**
 *   @brief EtherCAT driver for HMB ClipX device
 *   @details It allows to communicate with a "HMB ClipX" through an ehtercat
 * bus using the ethercatcpp framework.
 */
class ClipX : public SlaveDevice {
public:
  //! This enum define all fieldbus flags we can use
  enum fieldbus_flag_t : std::uint16_t {
    fieldbus_flag_1 = 0,   //!< Define fieldbus flag number 1
    fieldbus_flag_2 = 1,   //!< Define fieldbus flag number 2
    fieldbus_flag_3 = 2,   //!< Define fieldbus flag number 3
    fieldbus_flag_4 = 3,   //!< Define fieldbus flag number 4
    fieldbus_flag_5 = 4,   //!< Define fieldbus flag number 5
    fieldbus_flag_6 = 5,   //!< Define fieldbus flag number 6
    fieldbus_flag_7 = 6,   //!< Define fieldbus flag number 7
    fieldbus_flag_8 = 7,   //!< Define fieldbus flag number 8
    fieldbus_flag_9 = 8,   //!< Define fieldbus flag number 9
    fieldbus_flag_10 = 9,  //!< Define fieldbus flag number 10
    fieldbus_flag_11 = 10, //!< Define fieldbus flag number 11
    fieldbus_flag_12 = 11, //!< Define fieldbus flag number 12
    fieldbus_flag_13 = 12, //!< Define fieldbus flag number 13
    fieldbus_flag_14 = 13, //!< Define fieldbus flag number 14
    fieldbus_flag_15 = 14, //!< Define fieldbus flag number 15
    fieldbus_flag_16 = 15  //!< Define fieldbus flag number 16
  };

  //! This enum define all flags we can use to get I/O status
  enum io_status_t {
    digital_input_1 = 0,
    digital_input_2 = 1,
    digital_input_1_debounced = 2,
    digital_input_2_debounced = 3,
    digital_output_1 = 4,
    digital_output_2 = 5,
    digital_output_1_delayed = 6,
    digital_output_2_delayed = 7,
    result_limit_value_switch_1 = 8,
    result_limit_value_switch_2 = 9,
    result_limit_value_switch_3 = 10,
    result_limit_value_switch_4 = 11,
    calculated_channel_flag_1 = 12,
    calculated_channel_flag_2 = 13,
    calculated_channel_flag_3 = 14,
    calculated_channel_flag_4 = 15,
    calculated_channel_flag_5 = 16,
    calculated_channel_flag_6 = 17,
    calculated_channel_flag_7 = 18,
    calculated_channel_flag_8 = 19,
    fieldbus_flag_status_1 = 32,
    fieldbus_flag_status_2 = 33,
    fieldbus_flag_status_3 = 34,
    fieldbus_flag_status_4 = 35,
    fieldbus_flag_status_5 = 36,
    fieldbus_flag_status_6 = 37,
    fieldbus_flag_status_7 = 38,
    fieldbus_flag_status_8 = 39,
    fieldbus_flag_status_9 = 40,
    fieldbus_flag_status_10 = 41,
    fieldbus_flag_status_11 = 42,
    fieldbus_flag_status_12 = 43,
    fieldbus_flag_status_13 = 44,
    fieldbus_flag_status_14 = 45,
    fieldbus_flag_status_15 = 46,
    fieldbus_flag_status_16 = 47,
    ethernet_api_flag_1 = 48,
    ethernet_api_flag_2 = 49,
    ethernet_api_flag_3 = 50,
    ethernet_api_flag_4 = 51,
    ethernet_api_flag_5 = 52,
    ethernet_api_flag_6 = 53,
    ethernet_api_flag_7 = 54,
    ethernet_api_flag_8 = 55,
    ethernet_api_flag_9 = 56,
    ethernet_api_flag_10 = 57,
    ethernet_api_flag_11 = 58,
    ethernet_api_flag_12 = 59,
    ethernet_api_flag_13 = 60,
    ethernet_api_flag_14 = 61,
    ethernet_api_flag_15 = 62,
    ethernet_api_flag_16 = 63
  };

  //! This enum define all flags we can use to get system status
  enum system_status_t {
    device_ready = 0,      //!< Defined flag to get "device ready" status
    sync_as_CF_master = 1, //!< Defined flag to get "sync as CF master" status
    sync_as_CF_slave = 2,  //!< Defined flag to get "sync as CF slave" status
    sync_as_CF_slave_no_signal =
        3, //!< Defined flag to get "sync as CF slave no signal" status
    parameter_set_switching =
        4, //!< Defined flag to get "parameter set swtiching" status
    error_parameter_set =
        5,                 //!< Defined flag to get "error parameter set" status
    error_file_system = 6, //!< Defined flag to get "error file system" status
    error_ADC_com = 7,     //!< Defined flag to get "error ADC com" status
    error_ADC_IRQ = 8,     //!< Defined flag to get "error ADC IRQ" status
    error_ADC_stuck = 9,   //!< Defined flag to get "error ADC stuck" status
    error_ADC_DMA = 10,    //!< Defined flag to get "error ADC DMA" status
    error_DAC_com = 11,    //!< Defined flag to get "error DAC com" status
    error_1_wire_com = 12, //!< Defined flag to get "error one wire com" status
    error_clipx_bus = 13,  //!< Defined flag to get "error clipx bus" status
    error_external_ram =
        14, //!< Defined flag to get "error external RAM" status
    error_sensor_excitation =
        15, //!< Defined flag to get "error sensor excitation" status
    cyclic_com_fieldbus =
        16, //!< Defined flag to get "cyclic communication fieldbus" status
    fieldbus_controller_defective =
        17, //!< Defined flag to get "fieldbus controller defective" status
    error_factory_calibration =
        18, //!< Defined flag to get "error factory calibration"status
    reading_TEDS = 29, //!< Defined flag to get "reading TEDS" status
    error_external_TEDS_RAM =
        30,        //!< Defined flag to get "error external TEDS RAM" status
    heartbeat = 31 //!< Defined flag to get "heartbeat" status
  };

  //! This enum define all flags we can use to check mesured value validity
  enum mesured_value_t {
    adc_value = 0, //!< Defined flag to get "ADC value" validity
    adc_filtered_value =
        1,           //!< Defined flag to get "ADC filtered value" validity
    field_value = 2, //!< Defined flag to get "Field value" validity
    gross_value = 3, //!< Defined flag to get "Gross value" validity
    net_value = 4,   //!< Defined flag to get "net value" validity
    min_value = 5,   //!< Defined flag to get "min value" validity
    max_value = 6,   //!< Defined flag to get "max value" validity
    peak_to_peak_value =
        7,                //!< Defined flag to get "peak to peak value" validity
    captured_value_1 = 8, //!< Defined flag to get "captured value 1" validity
    captured_value_2 = 9, //!< Defined flag to get "captured value 2" validity
    neighbor_value_1 = 10, //!< Defined flag to get "neighbor value 1" validity
    neighbor_value_2 = 11, //!< Defined flag to get "neighbor value 2" validity
    neighbor_value_3 = 12, //!< Defined flag to get "neighbor value 3" validity
    neighbor_value_4 = 13, //!< Defined flag to get "neighbor value 4" validity
    neighbor_value_5 = 14, //!< Defined flag to get "neighbor value 5" validity
    neighbor_value_6 = 15, //!< Defined flag to get "neighbor value 6" validity
    calculated_value_1 =
        21, //!< Defined flag to get "calculated value 1" validity
    calculated_value_2 =
        22, //!< Defined flag to get "calculated value 2" validity
    calculated_value_3 =
        23, //!< Defined flag to get "calculated value 3" validity
    calculated_value_4 =
        24, //!< Defined flag to get "calculated value 4" validity
    calculated_value_5 =
        25, //!< Defined flag to get "calculated value 5" validity
    calculated_value_6 =
        26, //!< Defined flag to get "calculated value 6" validity
    external_eth_value_1 =
        27, //!< Defined flag to get "external ethernet value 1" validity
    external_eth_value_2 =
        28, //!< Defined flag to get "external ethernet value 2" validity
    external_fieldbus_value_1 =
        29, //!< Defined flag to get "external fieldbus value 1" validity
    external_fieldbus_value_2 =
        30, //!< Defined flag to get "external fieldbus value 2" validity
    analog_output_value =
        31 //!< Defined flag to get "analog output value" validity
  };

  //! This enum define all flags we can use to interract with the clipx
  enum control_word_t {
    zero_gross_value = 0, //!< Defined flag to set the zero gross value
    tare_net_value = 1,   //!< Defined flag to set the zero net value
    reset_zero_value = 2, //!< Defined flag to reset the zero value
    reset_tare_value = 3, //!< Defined flag to reset the tare value
    first_two_point_scaling =
        4, //!< Defined flag to set the first "two point scaling"
    second_two_point_scaling =
        5,              //!< Defined flag to set the second "two point scaling"
    hold_capture_1 = 6, //!< Defined flag to hold the current value in capture 1
    hold_capture_2 = 7, //!< Defined flag to hold the current value in capture 2
    delete_capture_1 = 8, //!< Defined flag to delete the capture 1 value
    delete_capture_2 = 9, //!< Defined flag to delete the capture 2 value
    reset_limit_value_switch_1 =
        10, //!< Defined flag to reset the limit switch value 1
    reset_limit_value_switch_2 =
        11, //!< Defined flag to reset the limit switch value 2
    reset_limit_value_switch_3 =
        12, //!< Defined flag to reset the limit switch value 3
    reset_limit_value_switch_4 =
        13, //!< Defined flag to reset the limit switch value 4
    reset_max_min_p2p_value =
        14, //!< Defined flag to reset the min, max and peak to peak value
    hold_max_min_p2p_value = 15, //!< Defined flag to hold as long as this bit
                                 //!< is set the min, max and peak to peak value
    filter_fast_track =
        16 //!< Defined flag to set the filter output jumps to the input value
  };

  /**
   * @brief Constructor of ClipX class
   */
  ClipX();
  ~ClipX() = default;

  /**
   * @brief Function used to calibrate all ClipX datas from mV/V to Newton.
   *
   * By default all datas are in mV/V. With this calibration all data are in
   * Newton (N)
   *
   * @param [in] coef is the coeficient to transform data from mV/V to Nexton
   * (N)
   */
  void calibrate_volt_To_newton(float coef);

  /**
   * @brief Function used to get ADC value.
   *
   * By default unit is Volt <B>(mV/V)</B>.
   * If user set the calibrated value, unit is <B>Newton (N)</B>
   * @return ADC value.
   */
  float adc();

  /**
   * @brief Function used to get field value.
   *
   * By default unit is Volt <B>(mV/V)</B>.
   * If user set the calibrated value, unit is <B>Newton (N)</B>
   * @return field value.
   */
  float field();

  /**
   * @brief Function used to get gross value.
   *
   * By default unit is Volt <B>(mV/V)</B>.
   * If user set the calibrated value, unit is <B>Newton (N)</B>
   * @return gross value.
   */
  float gross();

  /**
   * @brief Function used to get net value.
   *
   * By default unit is Volt <B>(mV/V)</B>.
   * If user set the calibrated value, unit is <B>Newton (N)</B>
   * @return net value.
   */
  float net();

  /**
   * @brief Function used to get minimum value.
   *
   * By default unit is Volt <B>(mV/V)</B>.
   * If user set the calibrated value, unit is <B>Newton (N)</B>
   * @return minimum value.
   */
  float min();

  /**
   * @brief Function used to get maximum value.
   *
   * By default unit is Volt <B>(mV/V)</B>.
   * If user set the calibrated value, unit is <B>Newton (N)</B>
   * @return maximum value.
   */
  float max();

  /**
   * @brief Function used to get peak to peak value.
   *
   * By default unit is Volt <B>(mV/V)</B>.
   * If user set the calibrated value, unit is <B>Newton (N)</B>
   * @return peak to peak value.
   */
  float peak_to_peak();

  /**
   * @brief Function used to get captured value number 1.
   *
   * By default unit is Volt <B>(mV/V)</B>.
   * If user set the calibrated value, unit is <B>Newton (N)</B>.
   * @return caputred value number 1.
   */
  float captured_1();

  /**
   * @brief Function used to get captured value number 2.
   *
   * By default unit is Volt <B>(mV/V)</B>.
   * If user set the calibrated value, unit is <B>Newton (N)</B>.
   * @return caputred value number 2.
   */
  float captured_2();

  /**
   * @brief Function used to get calculated value number 1 .
   *
   * Unit don't know because don't know calcul made in ClipX by user.
   * Take care with units!
   * @return calculated value number 1.
   */
  float calculated_1();

  /**
   * @brief Function used to get calculated value number 2 .
   *
   * Unit don't know because don't know calcul made in ClipX by user.
   * Take care with units!
   * @return calculated value number 2.
   */
  float calculated_2();

  /**
   * @brief Function used to get calculated value number 3 .
   *
   * Unit don't know because don't know calcul made in ClipX by user.
   * Take care with units!
   * @return calculated value number 3.
   */
  float calculated_3();

  /**
   * @brief Function used to get calculated value number 4 .
   *
   * Unit don't know because don't know calcul made in ClipX by user.
   * Take care with units!
   * @return calculated value number 4.
   */
  float calculated_4();

  /**
   * @brief Function used to get calculated value number 5 .
   *
   * Unit don't know because don't know calcul made in ClipX by user.
   * Take care with units!
   * @return calculated value number 5.
   */
  float calculated_5();

  /**
   * @brief Function used to get calculated value number 6 .
   *
   * Unit don't know because don't know calcul made in ClipX by user.
   * Take care with units!
   * @return calculated value number 6.
   */
  float calculated_6();

  /**
   * @brief Function used to get clipx bus neighbor 1 value.
   *
   * By default unit is Volt <B>(mV/V)</B>.
   * If user set the calibrated value, unit is <B>Newton (N)</B>.
   * @return clipx bus neighbor 1 value.
   */
  float neighbor_1();

  /**
   * @brief Function used to get clipx bus neighbor 2 value.
   *
   * By default unit is Volt <B>(mV/V)</B>.
   * If user set the calibrated value, unit is <B>Newton (N)</B>.
   * @return clipx bus neighbor 2 value.
   */
  float neighbor_2();

  /**
   * @brief Function used to get clipx bus neighbor 3 value.
   *
   * By default unit is Volt <B>(mV/V)</B>.
   * If user set the calibrated value, unit is <B>Newton (N)</B>.
   * @return clipx bus neighbor 3 value.
   */
  float neighbor_3();

  /**
   * @brief Function used to get clipx bus neighbor 4 value.
   *
   * By default unit is Volt <B>(mV/V)</B>.
   * If user set the calibrated value, unit is <B>Newton (N)</B>.
   * @return clipx bus neighbor 4 value.
   */
  float neighbor_4();

  /**
   * @brief Function used to get clipx bus neighbor 5 value.
   *
   * By default unit is Volt <B>(mV/V)</B>.
   * If user set the calibrated value, unit is <B>Newton (N)</B>.
   * @return clipx bus neighbor 5 value.
   */
  float neighbor_5();

  /**
   * @brief Function used to get clipx bus neighbor 6 value.
   *
   * By default unit is Volt <B>(mV/V)</B>.
   * If user set the calibrated value, unit is <B>Newton (N)</B>.
   * @return clipx bus neighbor 6 value.
   */
  float neighbor_6();

  /**
   * @brief Function used to get external ethernet value number 1.
   *
   * No predefine unit. Take care with units!
   * @return external ethernet value number 1.
   */
  float external_eth_1();

  /**
   * @brief Function used to get external ethernet value number 2.
   *
   * No predefine unit. Take care with units!
   * @return external ethernet value number 2.
   */
  float external_eth_2();

  /**
   * @brief Function used to get analog output value.
   *
   * No predefine unit. Take care with units!
   * @return analog output value.
   */
  float analog_output();

  /**
   * @brief Function used to set limit value number 1.
   *
   * By default unit is Volt <B>(mV/V)</B>.
   * If user set the calibrated value, unit is <B>Newton (N)</B>.
   * @param [in] value is limit value desired.
   */
  void set_limit_1(float value);

  /**
   * @brief Function used to get limit value number 1.
   *
   * By default unit is Volt <B>(mV/V)</B>.
   * If user set the calibrated value, unit is <B>Newton (N)</B>.
   * @return limit value number 1.
   */
  float limit_1();

  /**
   * @brief Function used to set limit value number 2.
   *
   * By default unit is Volt <B>(mV/V)</B>.
   * If user set the calibrated value, unit is <B>Newton (N)</B>.
   * @param [in] value is limit value desired.
   */
  void set_limit_2(float value);

  /**
   * @brief Function used to get limit value number 2.
   *
   * By default unit is Volt <B>(mV/V)</B>.
   * If user set the calibrated value, unit is <B>Newton (N)</B>.
   * @return limit value number 2.
   */
  float limit_2();

  /**
   * @brief Function used to set limit value number 3.
   *
   * By default unit is Volt <B>(mV/V)</B>.
   * If user set the calibrated value, unit is <B>Newton (N)</B>.
   * @param [in] value is limit value desired.
   */
  void set_limit_3(float value);

  /**
   * @brief Function used to get limit value number 3.
   *
   * By default unit is Volt <B>(mV/V)</B>.
   * If user set the calibrated value, unit is <B>Newton (N)</B>.
   * @return limit value number 3.
   */
  float limit_3();

  /**
   * @brief Function used to set limit value number 4.
   *
   * By default unit is Volt <B>(mV/V)</B>.
   * If user set the calibrated value, unit is <B>Newton (N)</B>.
   * @param [in] value is limit value desired.
   */
  void set_limit_4(float value);

  /**
   * @brief Function used to get limit value number 4.
   *
   * By default unit is Volt <B>(mV/V)</B>.
   * If user set the calibrated value, unit is <B>Newton (N)</B>.
   * @return limit value number 4.
   */
  float limit_4();

  /**
   * @brief Function used to change the "parameter set".
   * @param [in] value is the number of the parameter set needed, have to be
   * from 1 to 10.
   */
  void change_parameters(uint16_t value);

  /**
   * @brief Function used to read number of actual parameter set.
   * @return number of actual parameter set.
   */
  uint16_t parameters();

  /**
   * @brief Function used to set fieldbus value number 1.
   *
   * No predefine unit. Take care with units!
   * @param [in] value is the coefficient value that user needed.
   */
  void fieldbus_1(float value);

  /**
   * @brief Function used to set fieldbus value number 2.
   *
   * No predefine unit. Take care with units!
   * @param [in] value is the coefficient value that user needed.
   */
  void fieldbus_2(float value);

  /**
   * @brief Function used to set fieldbus flags.
   *
   * @param [in] flag_id is the desired flag define in fieldbus_flag_t.
   * @param [in] state is the desired for the flag (TRUE or FALSE).
   */
  void fieldbus_flag(fieldbus_flag_t flag_id, bool state);

  /**
   * @brief Function used to check I/O status flags.
   *
   * @param [in] io_id is the desired I/O status flag define in io_status_t.
   * @return flag state (TRUE: active or FALSE: unactive).
   */
  bool check_io_status(io_status_t io_id);

  /**
   * @brief Function used to get system status flags.
   *
   * @param [in] status_id is the desired system status flag define in
   * system_status_t.
   * @return flag state (TRUE: active or FALSE: unactive).
   */
  bool system_status(system_status_t status_id);

  /**
   * @brief Function used to check validity of mesured value.
   *
   * @param [in] mesured_value_id is the desired value validity flag define in
   * mesured_value_t.
   * @return flag state (TRUE: invalid or FALSE: valid).
   */
  bool check_measure_validity(
      mesured_value_t
          mesured_value_id); // 0 -> value valid || 1 -> invalid value

  /**
   * @brief Function used to set the control word.
   *
   * @param [in] control_word_id is the desired flag data who want to set. Flags
   * is defined in control_word_t.
   * @param [in] state is the desired state for the flag (TRUE: active flag or
   * FALSE: unactive flag).
   */
  void set_control_word(control_word_t control_word_id, bool state);

  /**
   * @brief Function used to print all datas that clipx have.
   */
  void print_data();

private:
  void update_command_buffer();
  void unpack_status_buffer();
  void update_control_word_ack();

  // Command variable
  float fieldbus_value_1_;<--- class member 'ClipX::fieldbus_value_1_' is never used.
  float fieldbus_value_2_;<--- class member 'ClipX::fieldbus_value_2_' is never used.
  uint16_t fieldbus_flag_;<--- class member 'ClipX::fieldbus_flag_' is never used.
  float limit_value_1_;<--- class member 'ClipX::limit_value_1_' is never used.
  float limit_value_2_;<--- class member 'ClipX::limit_value_2_' is never used.
  float limit_value_3_;<--- class member 'ClipX::limit_value_3_' is never used.
  float limit_value_4_;<--- class member 'ClipX::limit_value_4_' is never used.
  uint32_t control_word_;<--- class member 'ClipX::control_word_' is never used.
  uint16_t parameter_set_number_;<--- class member 'ClipX::parameter_set_number_' is never used.

  // Status variable
  uint32_t system_status_;<--- class member 'ClipX::system_status_' is never used.
  float adc_value_;<--- class member 'ClipX::adc_value_' is never used.
  float field_value_;<--- class member 'ClipX::field_value_' is never used.
  float gross_value_;<--- class member 'ClipX::gross_value_' is never used.
  float net_value_;<--- class member 'ClipX::net_value_' is never used.
  float min_value_;<--- class member 'ClipX::min_value_' is never used.
  float max_value_;<--- class member 'ClipX::max_value_' is never used.
  float peak_to_peak_value_;<--- class member 'ClipX::peak_to_peak_value_' is never used.
  float captured_value_1_;<--- class member 'ClipX::captured_value_1_' is never used.
  float captured_value_2_;<--- class member 'ClipX::captured_value_2_' is never used.
  float calculated_value_1_;<--- class member 'ClipX::calculated_value_1_' is never used.
  float calculated_value_2_;<--- class member 'ClipX::calculated_value_2_' is never used.
  float calculated_value_3_;<--- class member 'ClipX::calculated_value_3_' is never used.
  float calculated_value_4_;<--- class member 'ClipX::calculated_value_4_' is never used.
  float calculated_value_5_;<--- class member 'ClipX::calculated_value_5_' is never used.
  float calculated_value_6_;<--- class member 'ClipX::calculated_value_6_' is never used.
  float neighbor_value_1_;<--- class member 'ClipX::neighbor_value_1_' is never used.
  float neighbor_value_2_;<--- class member 'ClipX::neighbor_value_2_' is never used.
  float neighbor_value_3_;<--- class member 'ClipX::neighbor_value_3_' is never used.
  float neighbor_value_4_;<--- class member 'ClipX::neighbor_value_4_' is never used.
  float neighbor_value_5_;<--- class member 'ClipX::neighbor_value_5_' is never used.
  float neighbor_value_6_;<--- class member 'ClipX::neighbor_value_6_' is never used.
  float external_eth_value_1_;<--- class member 'ClipX::external_eth_value_1_' is never used.
  float external_eth_value_2_;<--- class member 'ClipX::external_eth_value_2_' is never used.
  float analog_output_value_;<--- class member 'ClipX::analog_output_value_' is never used.
  uint32_t io_status_low_;<--- class member 'ClipX::io_status_low_' is never used.
  uint32_t io_stauts_high_;<--- class member 'ClipX::io_stauts_high_' is never used.
  uint32_t measured_value_status_;<--- class member 'ClipX::measured_value_status_' is never used.
  float limit_value_1_read_;<--- class member 'ClipX::limit_value_1_read_' is never used.
  float limit_value_2_read_;<--- class member 'ClipX::limit_value_2_read_' is never used.
  float limit_value_3_read_;<--- class member 'ClipX::limit_value_3_read_' is never used.
  float limit_value_4_read_;<--- class member 'ClipX::limit_value_4_read_' is never used.
  uint32_t control_word_validation_;<--- class member 'ClipX::control_word_validation_' is never used.
  uint16_t parameter_set_number_read_;<--- class member 'ClipX::parameter_set_number_read_' is never used.

  // Calibrate variable
  float calibrate_from_V_to_N_;<--- class member 'ClipX::calibrate_from_V_to_N_' is never used.
  bool clipx_calibrated_;<--- class member 'ClipX::clipx_calibrated_' is never used.
};
} // namespace ethercatcpp