2 from datetime
import datetime
17 "wrong slot settings",
23 return repr(error[self.
value])
28 super(ioThinx_4530_API, self).
__init__()
33 self.
lib = ctypes.cdll.LoadLibrary(shared_library)
39 return(str(
".".join(file.split(
".")[2:5])))
42 error = self.lib.ioThinx_IO_Client_Init(
None)
47 p_status = ctypes.c_uint8()
48 error = self.lib.ioThinx_IO_GetBusStatus(ctypes.byref(p_status))
54 error = self.lib.ioThinx_IO_Config_Reload(
None)
63 p_values = ctypes.c_uint32()
64 error = self.lib.ioThinx_DI_GetValues(ctypes.c_uint32(slot),
65 ctypes.byref(p_values))
68 values = [int(b)
for b
in bin(p_values.value)
69 [2:].zfill(SLOT_CH_NUM)[::-1]]
73 buff = (ctypes.c_uint32 * count)()
74 error = self.lib.ioThinx_DI_GetCntValues(ctypes.c_uint32(slot),
75 ctypes.c_uint8(start),
76 ctypes.c_uint8(count),
82 buff_list.append(value)
86 buff = (ctypes.c_uint32 * count)(*buff_list)
87 error = self.lib.ioThinx_DI_SetCntValues(ctypes.c_uint32(slot),
88 ctypes.c_uint8(start),
89 ctypes.c_uint8(count),
95 p_starts = ctypes.c_uint32()
96 error = self.lib.ioThinx_DI_GetCntStarts(ctypes.c_uint32(slot),
97 ctypes.byref(p_starts))
100 starts = [int(b)
for b
in bin(p_starts.value)
101 [2:].zfill(SLOT_CH_NUM)[::-1]]
105 starts = int(
"".join(map(str, buff_list[:: -1])), BIN_TYPE)
106 error = self.lib.ioThinx_DI_SetCntStarts(ctypes.c_uint32(slot),
107 ctypes.c_uint32(starts))
112 starts = int(
"".join(map(str, buff_list[:: -1])), BIN_TYPE)
113 error = self.lib.ioThinx_DI_SetCntStops(ctypes.c_uint32(slot),
114 ctypes.c_uint32(starts))
119 p_overflows = ctypes.c_uint32()
120 error = self.lib.ioThinx_DI_GetCntOverflows(ctypes.c_uint32(slot),
121 ctypes.byref(p_overflows))
124 overflows = [int(b)
for b
in bin(p_overflows.value)
125 [2:].zfill(SLOT_CH_NUM)[::-1]]
129 overflows = int(
"".join(map(str, buff_list[:: -1])), BIN_TYPE)
130 error = self.lib.ioThinx_DI_SetCntOverflows(ctypes.c_uint32(slot),
131 ctypes.c_uint32(overflows))
136 buff = (ctypes.c_uint8 * count)()
137 error = self.lib.ioThinx_DI_Config_GetModes(ctypes.c_uint32(slot),
138 ctypes.c_uint8(start),
139 ctypes.c_uint8(count),
145 buff_list.append(value)
149 buff = (ctypes.c_uint8 * count)(*buff_list)
150 error = self.lib.ioThinx_DI_Config_SetModes(ctypes.c_uint32(slot),
151 ctypes.c_uint8(start),
152 ctypes.c_uint8(count),
158 buff = (ctypes.c_uint16 * count)()
159 error = self.lib.ioThinx_DI_Config_GetFilters(ctypes.c_uint32(slot),
160 ctypes.c_uint8(start),
161 ctypes.c_uint8(count),
167 buff_list.append(value)
171 buff = (ctypes.c_uint16 * count)(*buff_list)
172 error = self.lib.ioThinx_DI_Config_SetFilters(ctypes.c_uint32(slot),
173 ctypes.c_uint8(start),
174 ctypes.c_uint8(count),
180 buff = (ctypes.c_uint8 * count)()
181 error = self.lib.ioThinx_DI_Config_GetCntTriggers(ctypes.c_uint32(slot),
182 ctypes.c_uint8(start),
183 ctypes.c_uint8(count),
189 buff_list.append(value)
193 buff = (ctypes.c_uint8 * count)(*buff_list)
194 error = self.lib.ioThinx_DI_Config_SetCntTriggers(ctypes.c_uint32(slot),
195 ctypes.c_uint8(start),
196 ctypes.c_uint8(count),
202 buff = (ctypes.c_uint32 * count)()
203 error = self.lib.ioThinx_DI_Config_GetCntValues(ctypes.c_uint32(slot),
204 ctypes.c_uint8(start),
205 ctypes.c_uint8(count),
211 buff_list.append(value)
215 buff = (ctypes.c_uint32 * count)(*buff_list)
216 error = self.lib.ioThinx_DI_Config_SetCntValues(ctypes.c_uint32(slot),
217 ctypes.c_uint8(start),
218 ctypes.c_uint8(count),
227 p_values = ctypes.c_uint32()
228 error = self.lib.ioThinx_DO_GetValues(ctypes.c_uint32(slot),
229 ctypes.byref(p_values))
232 values = [int(b)
for b
in bin(p_values.value)
233 [2:].zfill(SLOT_CH_NUM)[::-1]]
237 values = int(
"".join(map(str, buff_list[:: -1])), BIN_TYPE)
238 error = self.lib.ioThinx_DO_SetValues(ctypes.c_uint32(slot),
239 ctypes.c_uint32(values))
244 buff = (ctypes.c_uint32 * count)()
245 error = self.lib.ioThinx_DO_GetPwmCounts(ctypes.c_uint32(slot),
246 ctypes.c_uint8(start),
247 ctypes.c_uint8(count),
253 buff_list.append(value)
257 buff = (ctypes.c_uint32 * count)(*buff_list)
258 error = self.lib.ioThinx_DO_SetPwmCounts(ctypes.c_uint32(slot),
259 ctypes.c_uint8(start),
260 ctypes.c_uint8(count),
266 p_starts = ctypes.c_uint32()
267 error = self.lib.ioThinx_DO_GetPwmStarts(ctypes.c_uint32(slot),
268 ctypes.byref(p_starts))
271 starts = [int(b)
for b
in bin(p_starts.value)
272 [2:].zfill(SLOT_CH_NUM)[::-1]]
276 starts = int(
"".join(map(str, buff_list[:: -1])), BIN_TYPE)
277 error = self.lib.ioThinx_DO_SetPwmStarts(ctypes.c_uint32(slot),
278 ctypes.c_uint32(starts))
283 stops = int(
"".join(map(str, buff_list[:: -1])), BIN_TYPE)
284 error = self.lib.ioThinx_DO_SetPwmStops(ctypes.c_uint32(slot),
285 ctypes.c_uint32(stops))
290 frequencies_buff = (ctypes.c_uint16 * count)()
291 duty_cycles_buff = (ctypes.c_uint16 * count)()
292 error = self.lib.ioThinx_DO_GetPwmConfigures(ctypes.c_uint32(slot),
293 ctypes.c_uint8(start),
294 ctypes.c_uint8(count),
297 ctypes.byref(duty_cycles_buff))
301 frequencies_buff_list = []
302 for value
in frequencies_buff:
303 frequencies_buff_list.append(value)
304 duty_cycles_buff_list = []
305 for value
in duty_cycles_buff:
306 duty_cycles_buff_list.append(value)
307 return frequencies_buff_list, duty_cycles_buff_list
310 frequencies_buff_list,
311 duty_cycles_buff_list):
312 frequencies_buff = (ctypes.c_uint16 * count)(*frequencies_buff_list)
313 duty_cycles_buff = (ctypes.c_uint16 * count)(*duty_cycles_buff_list)
314 error = self.lib.ioThinx_DO_SetPwmConfigures(ctypes.c_uint32(slot),
315 ctypes.c_uint8(start),
316 ctypes.c_uint8(count),
319 ctypes.byref(duty_cycles_buff))
324 buff = (ctypes.c_uint8 * count)()
325 error = self.lib.ioThinx_DO_Config_GetModes(ctypes.c_uint32(slot),
326 ctypes.c_uint8(start),
327 ctypes.c_uint8(count),
333 buff_list.append(value)
337 buff = (ctypes.c_uint8 * count)(*buff_list)
338 error = self.lib.ioThinx_DO_Config_SetModes(ctypes.c_uint32(slot),
339 ctypes.c_uint8(start),
340 ctypes.c_uint8(count),
346 buff = (ctypes.c_uint32 * count)()
347 error = self.lib.ioThinx_DO_Config_GetPwmCounts(ctypes.c_uint32(slot),
348 ctypes.c_uint8(start),
349 ctypes.c_uint8(count),
355 buff_list.append(value)
359 buff = (ctypes.c_uint32 * count)(*buff_list)
360 error = self.lib.ioThinx_DO_Config_SetPwmCounts(ctypes.c_uint32(slot),
361 ctypes.c_uint8(start),
362 ctypes.c_uint8(count),
368 frequencies_buff = (ctypes.c_uint16 * count)()
369 duty_cycles_buff = (ctypes.c_uint16 * count)()
370 error = self.lib.ioThinx_DO_Config_GetPwmConfigures(ctypes.c_uint32(slot),
377 ctypes.byref(duty_cycles_buff))
381 frequencies_buff_list = []
382 for value
in frequencies_buff:
383 frequencies_buff_list.append(value)
384 duty_cycles_buff_list = []
385 for value
in duty_cycles_buff:
386 duty_cycles_buff_list.append(value)
388 return frequencies_buff_list, duty_cycles_buff_list
391 frequencies_buff_list,
392 duty_cycles_buff_list):
393 frequencies_buff = (ctypes.c_uint16 * count)(*frequencies_buff_list)
394 duty_cycles_buff = (ctypes.c_uint16 * count)(*duty_cycles_buff_list)
395 error = self.lib.ioThinx_DO_Config_SetPwmConfigures(ctypes.c_uint32(slot),
402 ctypes.byref(duty_cycles_buff))
407 p_values = ctypes.c_uint32()
408 error = self.lib.ioThinx_Relay_GetValues(ctypes.c_uint32(slot),
409 ctypes.byref(p_values))
412 values = [int(b)
for b
in bin(p_values.value)
413 [2:].zfill(SLOT_CH_NUM)[::-1]]
417 values = int(
"".join(map(str, buff_list[:: -1])), BIN_TYPE)
418 error = self.lib.ioThinx_Relay_SetValues(ctypes.c_uint32(slot),
419 ctypes.c_uint32(values))
424 buff = (ctypes.c_uint32 * count)()
425 error = self.lib.ioThinx_Relay_GetTotalCounts(ctypes.c_uint32(slot),
426 ctypes.c_uint8(start),
427 ctypes.c_uint8(count),
433 buff_list.append(value)
437 buff = (ctypes.c_uint32 * count)()
438 error = self.lib.ioThinx_Relay_GetCurrentCounts(ctypes.c_uint32(slot),
439 ctypes.c_uint8(start),
440 ctypes.c_uint8(count),
446 buff_list.append(value)
450 resets = int(
"".join(map(str, buff_list[:: -1])), BIN_TYPE)
451 error = self.lib.ioThinx_Relay_ResetCurrentCounts(ctypes.c_uint32(slot),
452 ctypes.c_uint32(resets))
457 buff = (ctypes.c_float * count)()
458 error = self.lib.ioThinx_AI_GetEngs(ctypes.c_uint32(slot),
459 ctypes.c_uint8(start),
460 ctypes.c_uint8(count),
466 buff_list.append(value)
470 buff = (ctypes.c_float * count)()
471 error = self.lib.ioThinx_AI_GetMinEngs(ctypes.c_uint32(slot),
472 ctypes.c_uint8(start),
473 ctypes.c_uint8(count),
479 buff_list.append(value)
483 buff = (ctypes.c_float * count)()
484 error = self.lib.ioThinx_AI_GetMaxEngs(ctypes.c_uint32(slot),
485 ctypes.c_uint8(start),
486 ctypes.c_uint8(count),
492 buff_list.append(value)
496 buff = (ctypes.c_uint32 * count)()
497 error = self.lib.ioThinx_AI_GetRaws(ctypes.c_uint32(slot),
498 ctypes.c_uint8(start),
499 ctypes.c_uint8(count),
505 buff_list.append(value)
509 buff = (ctypes.c_uint32 * count)()
510 error = self.lib.ioThinx_AI_GetMinRaws(ctypes.c_uint32(slot),
511 ctypes.c_uint8(start),
512 ctypes.c_uint8(count),
518 buff_list.append(value)
522 buff = (ctypes.c_uint32 * count)()
523 error = self.lib.ioThinx_AI_GetMaxRaws(ctypes.c_uint32(slot),
524 ctypes.c_uint8(start),
525 ctypes.c_uint8(count),
531 buff_list.append(value)
535 resets = int(
"".join(map(str, buff_list[:: -1])), BIN_TYPE)
536 error = self.lib.ioThinx_AI_ResetMins(ctypes.c_uint32(slot),
537 ctypes.c_uint32(resets))
542 resets = int(
"".join(map(str, buff_list[:: -1])), BIN_TYPE)
543 error = self.lib.ioThinx_AI_ResetMaxs(ctypes.c_uint32(slot),
544 ctypes.c_uint32(resets))
549 buff = (ctypes.c_uint8 * count)()
550 error = self.lib.ioThinx_AI_GetStatuss(ctypes.c_uint32(slot),
551 ctypes.c_uint8(start),
552 ctypes.c_uint8(count),
558 buff_list.append(value)
562 buff = (ctypes.c_uint8 * count)()
563 error = self.lib.ioThinx_AI_Config_GetRanges(ctypes.c_uint32(slot),
564 ctypes.c_uint8(start),
565 ctypes.c_uint8(count),
571 buff_list.append(value)
575 buff = (ctypes.c_uint8 * count)(*buff_list)
576 error = self.lib.ioThinx_AI_Config_SetRanges(ctypes.c_uint32(slot),
577 ctypes.c_uint8(start),
578 ctypes.c_uint8(count),
584 buff = (ctypes.c_float * count)()
585 error = self.lib.ioThinx_AI_Config_GetBurnoutValues(ctypes.c_uint32(slot),
595 buff_list.append(value)
599 buff = (ctypes.c_float * count)(*buff_list)
600 error = self.lib.ioThinx_AI_Config_SetBurnoutValues(ctypes.c_uint32(slot),
610 buff = (ctypes.c_float * count)()
611 error = self.lib.ioThinx_AO_GetEngs(ctypes.c_uint32(slot),
612 ctypes.c_uint8(start),
613 ctypes.c_uint8(count),
619 buff_list.append(value)
623 buff = (ctypes.c_float * count)(*buff_list)
624 error = self.lib.ioThinx_AO_SetEngs(ctypes.c_uint32(slot),
625 ctypes.c_uint8(start),
626 ctypes.c_uint8(count),
632 buff = (ctypes.c_uint16 * count)()
633 error = self.lib.ioThinx_AO_GetRaws(ctypes.c_uint32(slot),
634 ctypes.c_uint8(start),
635 ctypes.c_uint8(count),
641 buff_list.append(value)
645 buff = (ctypes.c_uint16 * count)(*buff_list)
646 error = self.lib.ioThinx_AO_SetRaws(ctypes.c_uint32(slot),
647 ctypes.c_uint8(start),
648 ctypes.c_uint8(count),
654 buff = (ctypes.c_uint8 * count)()
655 error = self.lib.ioThinx_AO_GetStatuss(ctypes.c_uint32(slot),
656 ctypes.c_uint8(start),
657 ctypes.c_uint8(count),
663 buff_list.append(value)
667 buff = (ctypes.c_uint8 * count)()
668 error = self.lib.ioThinx_AO_Config_GetRanges(ctypes.c_uint32(slot),
669 ctypes.c_uint8(start),
670 ctypes.c_uint8(count),
676 buff_list.append(value)
680 buff = (ctypes.c_uint8 * count)(*buff_list)
681 error = self.lib.ioThinx_AO_Config_SetRanges(ctypes.c_uint32(slot),
682 ctypes.c_uint8(start),
683 ctypes.c_uint8(count),
689 buff = (ctypes.c_float * count)()
690 error = self.lib.ioThinx_TC_GetValues(ctypes.c_uint32(slot),
691 ctypes.c_uint8(start),
692 ctypes.c_uint8(count),
698 buff_list.append(value)
702 buff = (ctypes.c_float * count)()
703 error = self.lib.ioThinx_TC_GetMinValues(ctypes.c_uint32(slot),
704 ctypes.c_uint8(start),
705 ctypes.c_uint8(count),
711 buff_list.append(value)
715 buff = (ctypes.c_float * count)()
716 error = self.lib.ioThinx_TC_GetMaxValues(ctypes.c_uint32(slot),
717 ctypes.c_uint8(start),
718 ctypes.c_uint8(count),
724 buff_list.append(value)
728 resets = int(
"".join(map(str, buff_list[:: -1])), BIN_TYPE)
729 error = self.lib.ioThinx_TC_ResetMins(ctypes.c_uint32(slot),
730 ctypes.c_uint32(resets))
735 resets = int(
"".join(map(str, buff_list[:: -1])), BIN_TYPE)
736 error = self.lib.ioThinx_TC_ResetMaxs(ctypes.c_uint32(slot),
737 ctypes.c_uint32(resets))
742 buff = (ctypes.c_uint8 * count)()
743 error = self.lib.ioThinx_TC_GetStatuss(ctypes.c_uint32(slot),
744 ctypes.c_uint8(start),
745 ctypes.c_uint8(count),
751 buff_list.append(value)
755 buff = (ctypes.c_float * count)(*buff_list)
756 error = self.lib.ioThinx_TC_SetCalibrations(ctypes.c_uint32(slot),
757 ctypes.c_uint8(start),
758 ctypes.c_uint8(count),
764 error = self.lib.ioThinx_TC_ResetCalibrations(ctypes.c_uint32(slot),
765 ctypes.c_uint8(start),
766 ctypes.c_uint8(count))
771 buff = (ctypes.c_uint8 * count)()
772 error = self.lib.ioThinx_TC_Config_GetSensorTypes(ctypes.c_uint32(slot),
773 ctypes.c_uint8(start),
774 ctypes.c_uint8(count),
780 buff_list.append(value)
784 buff = (ctypes.c_uint8 * count)(*buff_list)
785 error = self.lib.ioThinx_TC_Config_SetSensorTypes(ctypes.c_uint32(slot),
786 ctypes.c_uint8(start),
787 ctypes.c_uint8(count),
793 buff = (ctypes.c_float * count)()
794 error = self.lib.ioThinx_RTD_GetValues(ctypes.c_uint32(slot),
795 ctypes.c_uint8(start),
796 ctypes.c_uint8(count),
802 buff_list.append(value)
806 buff = (ctypes.c_float * count)()
807 error = self.lib.ioThinx_RTD_GetMinValues(ctypes.c_uint32(slot),
808 ctypes.c_uint8(start),
809 ctypes.c_uint8(count),
815 buff_list.append(value)
819 buff = (ctypes.c_float * count)()
820 error = self.lib.ioThinx_RTD_GetMaxValues(ctypes.c_uint32(slot),
821 ctypes.c_uint8(start),
822 ctypes.c_uint8(count),
828 buff_list.append(value)
832 resets = int(
"".join(map(str, buff_list[:: -1])), BIN_TYPE)
833 error = self.lib.ioThinx_RTD_ResetMins(ctypes.c_uint32(slot),
834 ctypes.c_uint32(resets))
839 resets = int(
"".join(map(str, buff_list[:: -1])), BIN_TYPE)
840 error = self.lib.ioThinx_RTD_ResetMaxs(ctypes.c_uint32(slot),
841 ctypes.c_uint32(resets))
846 buff = (ctypes.c_uint8 * count)()
847 error = self.lib.ioThinx_RTD_GetStatuss(ctypes.c_uint32(slot),
848 ctypes.c_uint8(start),
849 ctypes.c_uint8(count),
855 buff_list.append(value)
859 buff = (ctypes.c_float * count)(*buff_list)
860 error = self.lib.ioThinx_RTD_SetCalibrations(ctypes.c_uint32(slot),
861 ctypes.c_uint8(start),
862 ctypes.c_uint8(count),
868 error = self.lib.ioThinx_RTD_ResetCalibrations(ctypes.c_uint32(slot),
869 ctypes.c_uint8(start),
870 ctypes.c_uint8(count))
875 buff = (ctypes.c_uint8 * count)()
876 error = self.lib.ioThinx_RTD_Config_GetSensorTypes(ctypes.c_uint32(slot),
886 buff_list.append(value)
890 buff = (ctypes.c_uint8 * count)(*buff_list)
891 error = self.lib.ioThinx_RTD_Config_SetSensorTypes(ctypes.c_uint32(slot),
905 buff = (ctypes.c_uint8 * count)()
906 error = self.lib.ioThinx_PWR_GetSysStatus(ctypes.c_uint32(slot),
907 ctypes.c_uint8(start),
908 ctypes.c_uint8(count),
914 buff_list.append(value)
918 buff = (ctypes.c_uint8 * count)()
919 error = self.lib.ioThinx_PWR_GetFieldStatus(ctypes.c_uint32(slot),
920 ctypes.c_uint8(start),
921 ctypes.c_uint8(count),
927 buff_list.append(value)
931 buff = (ctypes.c_float * count)()
932 error = self.lib.ioThinx_PWR_Config_GetAlarms(ctypes.c_uint32(slot),
933 ctypes.c_uint8(start),
934 ctypes.c_uint8(count),
940 buff_list.append(value)
944 buff = (ctypes.c_float * count)(*buff_list)
945 error = self.lib.ioThinx_PWR_Config_SetAlarms(ctypes.c_uint32(slot),
946 ctypes.c_uint8(start),
947 ctypes.c_uint8(count),
958 _fields_ = [(
'model_name', (ctypes.c_uint8 * 20)),
959 (
'product_id', ctypes.c_uint32),
960 (
'fwr_version', ctypes.c_uint16),
961 (
'fwr_build_date', ctypes.c_uint32),
962 (
'serial_number', (ctypes.c_uint8 * 13))]
965 error = self.lib.ioThinx_Misc_GetModuleInfo(ctypes.c_uint8(slot),
966 ctypes.byref(p_module_info))
970 def convert_build_date_from_hex_to_datetime():
971 build_date = hex(p_module_info.fwr_build_date).strip(
973 build_date = [
'{:02d}'.
format(
974 int(build_date[i:i + 2], 16))
for i
in range(0, len(build_date), BIN_TYPE)]
975 build_date = datetime.strptime(
"".join(build_date),
'%y%m%d%H')
977 fwr_build_date = convert_build_date_from_hex_to_datetime()
980 'model_name': str(bytearray(p_module_info.model_name).decode().rstrip(
'\x00')),
981 'product_id': hex(p_module_info.product_id).rstrip(
"L"),
982 'fwr_version': hex(p_module_info.fwr_version),
983 'fwr_build_date': fwr_build_date,
984 'serial_number': str(bytearray(p_module_info.serial_number).decode().rstrip(
'\x00')),
990 _fields_ = [(
'model_name', (ctypes.c_uint8 * 20)),
991 (
'product_id', ctypes.c_uint32),
992 (
'fwr_version', ctypes.c_uint16),
993 (
'fwr_build_date', ctypes.c_uint32),
994 (
'serial_number', (ctypes.c_uint8 * 13))]
997 error = self.lib.ioThinx_Misc_GetModuleInfoML(ctypes.c_uint8(slot),
998 ctypes.byref(p_module_info))
1002 def convert_build_date_from_hex_to_datetime():
1003 build_date = hex(p_module_info.fwr_build_date).strip(
1005 build_date = [
'{:02d}'.
format(
1006 int(build_date[i:i + 2], 16))
for i
in range(0, len(build_date), BIN_TYPE)]
1007 build_date = datetime.strptime(
"".join(build_date),
'%y%m%d%H')
1009 fwr_build_date = convert_build_date_from_hex_to_datetime()
1012 'model_name': str(bytearray(p_module_info.model_name).decode().rstrip(
'\x00')),
1013 'product_id': hex(p_module_info.product_id).rstrip(
"L"),
1014 'fwr_version': hex(p_module_info.fwr_version),
1015 'fwr_build_date': fwr_build_date,
1016 'serial_number': str(bytearray(p_module_info.serial_number).decode().rstrip(
'\x00')),
1021 p_module_count = ctypes.c_uint32()
1022 error = self.lib.ioThinx_Misc_GetModuleCount(
1023 ctypes.byref(p_module_count))
1026 return p_module_count.value
1029 p_module_count = ctypes.c_uint32()
1030 error = self.lib.ioThinx_Misc_GetModuleCountML(
1031 ctypes.byref(p_module_count))
1034 return p_module_count.value
1037 p_state = ctypes.c_uint8()
1038 error = self.lib.ioThinx_Misc_GetRotarySwitchState(ctypes.c_uint32(slot),
1039 ctypes.byref(p_state))
1042 return p_state.value
1045 error = self.lib.ioThinx_Misc_SetUserLedState(ctypes.c_uint32(slot),
1046 ctypes.c_uint8(channel),
1047 ctypes.c_uint8(state))
1052 p_state = ctypes.c_uint8()
1053 error = self.lib.ioThinx_Misc_GetPushButtonState(ctypes.c_uint32(slot),
1054 ctypes.byref(p_state))
1057 return p_state.value
1060 p_state = ctypes.c_uint8()
1061 error = self.lib.ioThinx_Misc_GetLocateState(ctypes.c_uint32(slot),
1062 ctypes.byref(p_state))
1065 return p_state.value
1068 error = self.lib.ioThinx_Misc_SetLocateState(ctypes.c_uint32(slot),
1069 ctypes.c_uint8(state))
1078 buff = (ctypes.c_uint8 * 20)()
1079 p_name = (ctypes.c_uint8 * 20)()
1080 error = self.lib.ioThinx_Serial_GetDevName(
1081 ctypes.c_uint32(slot),
1082 ctypes.c_uint32(port),
1083 ctypes.byref(p_name)
1089 for value
in p_name:
1090 buff_list.append(value)
1092 dev_name = bytes(buff_list).decode(
'ascii')
1096 error = self.lib.ioThinx_Serial_SetInterface(
1097 ctypes.c_uint32(slot),
1098 ctypes.c_uint32(port),
1099 ctypes.c_uint32(mode)
1106 mode = ctypes.c_uint32()
1107 error = self.lib.ioThinx_Serial_GetInterface(
1108 ctypes.c_uint32(slot),
1109 ctypes.c_uint32(port),
def ioThinx_DO_SetPwmCounts(self, slot, start, count, buff_list)
def ioThinx_DO_SetValues(self, slot, buff_list)
def ioThinx_DI_GetCntStarts(self, slot)
def ioThinx_DI_Config_GetCntValues(self, slot, start, count)
def ioThinx_AI_GetMaxRaws(self, slot, start, count)
def ioThinx_Misc_SetUserLedState(self, slot, channel, state)
def ioThinx_Serial_SetInterface(self, slot, port, mode)
def ioThinx_PWR_Config_GetAlarms(self, slot, start, count)
def ioThinx_RTD_ResetMaxs(self, slot, buff_list)
def ioThinx_Misc_GetModuleInfo(self, slot)
def ioThinx_AO_GetRaws(self, slot, start, count)
def ioThinx_DI_Config_SetFilters(self, slot, start, count, buff_list)
def ioThinx_AO_SetEngs(self, slot, start, count, buff_list)
def ioThinx_RTD_GetMinValues(self, slot, start, count)
def ioThinx_Relay_ResetCurrentCounts(self, slot, buff_list)
def ioThinx_DO_Config_SetModes(self, slot, start, count, buff_list)
def __init__(self, value)
def ioThinx_TC_GetStatuss(self, slot, start, count)
def ioThinx_DO_GetPwmConfigures(self, slot, start, count)
def ioThinx_RTD_ResetMins(self, slot, buff_list)
def ioThinx_DO_Config_GetPwmCounts(self, slot, start, count)
def ioThinx_DO_GetPwmCounts(self, slot, start, count)
def ioThinx_RTD_Config_GetSensorTypes(self, slot, start, count)
def ioThinx_AO_Config_GetRanges(self, slot, start, count)
def ioThinx_Misc_SetLocateState(self, slot, state)
def ioThinx_DI_SetCntStarts(self, slot, buff_list)
def ioThinx_DO_SetPwmConfigures(self, slot, start, count, frequencies_buff_list, duty_cycles_buff_list)
def ioThinx_Serial_GetInterface(self, slot, port)
def ioThinx_AI_GetStatuss(self, slot, start, count)
def ioThinx_AI_ResetMaxs(self, slot, buff_list)
def ioThinx_AO_SetRaws(self, slot, start, count, buff_list)
def ioThinx_DI_SetCntStops(self, slot, buff_list)
def ioThinx_RTD_GetValues(self, slot, start, count)
def ioThinx_DO_Config_GetPwmConfigures(self, slot, start, count)
def ioThinx_AI_GetRaws(self, slot, start, count)
def ioThinx_TC_Config_SetSensorTypes(self, slot, start, count, buff_list)
def get_shared_library_version(self)
def ioThinx_Relay_GetCurrentCounts(self, slot, start, count)
def ioThinx_DI_GetCntValues(self, slot, start, count)
def ioThinx_DO_GetPwmStarts(self, slot)
def ioThinx_Misc_GetModuleCountML(self)
def ioThinx_DI_SetCntOverflows(self, slot, buff_list)
def ioThinx_TC_SetCalibrations(self, slot, start, count, buff_list)
def ioThinx_Relay_GetTotalCounts(self, slot, start, count)
def ioThinx_PWR_Config_SetAlarms(self, slot, start, count, buff_list)
def ioThinx_RTD_GetMaxValues(self, slot, start, count)
def ioThinx_AO_Config_SetRanges(self, slot, start, count, buff_list)
def ioThinx_RTD_SetCalibrations(self, slot, start, count, buff_list)
def ioThinx_TC_GetMinValues(self, slot, start, count)
def ioThinx_TC_ResetCalibrations(self, slot, start, count)
def ioThinx_AI_Config_GetBurnoutValues(self, slot, start, count)
def ioThinx_DO_SetPwmStarts(self, slot, buff_list)
def ioThinx_AO_GetEngs(self, slot, start, count)
def ioThinx_DI_GetCntOverflows(self, slot)
def ioThinx_TC_GetMaxValues(self, slot, start, count)
def ioThinx_PWR_GetFieldStatus(self, slot, start, count)
def ioThinx_IO_GetBusStatus(self)
def ioThinx_DI_Config_SetModes(self, slot, start, count, buff_list)
def ioThinx_TC_GetValues(self, slot, start, count)
def ioThinx_AI_Config_SetRanges(self, slot, start, count, buff_list)
def ioThinx_DI_GetValues(self, slot)
def ioThinx_AI_GetMaxEngs(self, slot, start, count)
def ioThinx_DI_SetCntValues(self, slot, start, count, buff_list)
def ioThinx_AI_ResetMins(self, slot, buff_list)
def ioThinx_DO_GetValues(self, slot)
def ioThinx_Misc_GetModuleInfoML(self, slot)
def ioThinx_RTD_GetStatuss(self, slot, start, count)
def ioThinx_IO_Config_Reload(self)
def ioThinx_RTD_Config_SetSensorTypes(self, slot, start, count, buff_list)
def ioThinx_AI_GetMinRaws(self, slot, start, count)
def ioThinx_DI_Config_SetCntTriggers(self, slot, start, count, buff_list)
def ioThinx_RTD_ResetCalibrations(self, slot, start, count)
def ioThinx_DO_SetPwmStops(self, slot, buff_list)
def ioThinx_Misc_GetRotarySwitchState(self, slot)
def ioThinx_Relay_GetValues(self, slot)
def ioThinx_DO_Config_GetModes(self, slot, start, count)
def ioThinx_AI_GetEngs(self, slot, start, count)
def ioThinx_AI_GetMinEngs(self, slot, start, count)
def ioThinx_AI_Config_SetBurnoutValues(self, slot, start, count, buff_list)
def ioThinx_Serial_GetDevName(self, slot, port)
def ioThinx_TC_Config_GetSensorTypes(self, slot, start, count)
def ioThinx_DI_Config_GetCntTriggers(self, slot, start, count)
def ioThinx_Misc_GetPushButtonState(self, slot)
def ioThinx_TC_ResetMins(self, slot, buff_list)
def ioThinx_DI_Config_SetCntValues(self, slot, start, count, buff_list)
def ioThinx_DI_Config_GetFilters(self, slot, start, count)
def ioThinx_DI_Config_GetModes(self, slot, start, count)
def ioThinx_IO_Client_Init(self)
def ioThinx_PWR_GetSysStatus(self, slot, start, count)
def ioThinx_Misc_GetLocateState(self, slot)
def ioThinx_DO_Config_SetPwmCounts(self, slot, start, count, buff_list)
def ioThinx_TC_ResetMaxs(self, slot, buff_list)
def ioThinx_AI_Config_GetRanges(self, slot, start, count)
def ioThinx_Misc_GetModuleCount(self)
def ioThinx_AO_GetStatuss(self, slot, start, count)
def ioThinx_Relay_SetValues(self, slot, buff_list)
def ioThinx_DO_Config_SetPwmConfigures(self, slot, start, count, frequencies_buff_list, duty_cycles_buff_list)
char const int const cJSON_bool format