NKTPDLL¤
NKTDLL
(Interface)
¤
NKTDLL(equipment: Equipment)
flowchart LR
msl.equipment_resources.nkt.nktpdll.NKTDLL[NKTDLL]
msl.equipment.schema.Interface[Interface]
msl.equipment.schema.Interface --> msl.equipment_resources.nkt.nktpdll.NKTDLL
click msl.equipment_resources.nkt.nktpdll.NKTDLL href "" "msl.equipment_resources.nkt.nktpdll.NKTDLL"
click msl.equipment.schema.Interface href "" "msl.equipment.schema.Interface"
Wrapper around the NKTPDLL.dll SDK from NKT Photonics.
Regular-expression patterns that are used to select this Resource when connect() is called.
manufacturer=r"^NKT"
model=r"^NKTDLL$"
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
equipment
|
Equipment
|
An Equipment instance. |
required |
A Connection instance supports the following properties for the NKT wrapper.
Connection Properties:
| Name | Type | Description |
|---|---|---|
sdk_path |
str
|
The path to the SDK library. Default: |
open_port |
bool
|
Whether to automatically open the port. Default: |
auto |
bool
|
Whether to open the port with bus scanning. Default: |
live |
bool
|
Whether to open the port in live mode. Default: |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
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 | |
close_ports
staticmethod
¤
close_ports(*ports: str) -> None
Close the specified port(s).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ports
|
str
|
The name(s) of the port(s) to close. If not specified, close all opened ports. Port names are case sensitive. |
()
|
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
506 507 508 509 510 511 512 513 514 515 516 517 518 | |
device_create
¤
Creates a device in the internal device list.
If the open_ports function has
been called with live=True then the kernel immediately starts to monitor the device.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
wait_ready
|
bool
|
|
required |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
565 566 567 568 569 570 571 572 573 574 575 576 577 | |
device_exists
¤
Checks if a specific device already exists in the internal device list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
Returns:
| Type | Description |
|---|---|
bool
|
Whether the device exists. |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
579 580 581 582 583 584 585 586 587 588 589 590 | |
device_get_all_types
staticmethod
¤
Returns all device types (module types) from the internal device list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ports
|
str
|
A port or multiple ports. If not specified then the get_open_ports method is called. |
()
|
size
|
int
|
The maximum number of bytes that the device list can be. |
255
|
Returns:
| Type | Description |
|---|---|
dict[str, dict[str, int]]
|
The port names are the keys and each value is dict with the module type as the keys and its corresponding device ID as the value. |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
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 | |
device_get_boot_loader_version
¤
Returns the boot-loader version (int) for a given device id.
It is not necessary to open the port, create the device or register before using this function, since it will do a dedicated read.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
Returns:
| Type | Description |
|---|---|
int
|
The boot-loader version. |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 | |
device_get_boot_loader_version_str
¤
Returns the boot-loader version (string) for a given device id.
It is not necessary to open the port, create the device or register before using this function, since it will do a dedicated read.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
Returns:
| Type | Description |
|---|---|
str
|
The boot-loader version. |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 | |
device_get_error_code
¤
Returns the error code for a given device id.
It is not necessary to open the port, create the device or register before using this function, since it will do a dedicated read.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
Returns:
| Type | Description |
|---|---|
int
|
The error code. |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 | |
device_get_firmware_version
¤
Returns the firmware version (int) for a given device id.
It is not necessary to open the port, create the device or register before using this function, since it will do a dedicated read.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
Returns:
| Type | Description |
|---|---|
int
|
The firmware version. |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 | |
device_get_firmware_version_str
¤
Returns the firmware version (string) for a given device id.
It is not necessary to open the port, create the device or register before using this function, since it will do a dedicated read.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
Returns:
| Type | Description |
|---|---|
str
|
The firmware version. |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 | |
device_get_live
¤
Returns the internal device live status for a specific device id.
Requires the port being already opened with the open_ports function and the device being already created, either automatically or with the device_create function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
Returns:
| Type | Description |
|---|---|
bool
|
Whether live mode is enabled. |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 | |
device_get_mode
¤
device_get_mode(device_id: int) -> DeviceMode
Returns the internal device mode for a specific device id.
Requires the port being already opened with the open_ports function and the device being already created, either automatically or with the device_create function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
Returns:
| Type | Description |
|---|---|
DeviceMode
|
The device mode type. |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 | |
device_get_module_serial_number_str
¤
Returns the module serial number (string) for a given device id.
It is not necessary to open the port, create the device or register before using this function, since it will do a dedicated read.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
Returns:
| Type | Description |
|---|---|
str
|
The serial number. |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 | |
device_get_part_number_str
¤
Returns the part number for a given device id.
It is not necessary to open the port, create the device or register before using this function, since it will do a dedicated read.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
Returns:
| Type | Description |
|---|---|
str
|
The part number. |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 | |
device_get_pcb_serial_number_str
¤
Returns the PCB serial number (string) for a given device id.
It is not necessary to open the port, create the device or register before using this function, since it will do a dedicated read.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
Returns:
| Type | Description |
|---|---|
str
|
The part number. |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 | |
device_get_pcb_version
¤
Returns the PCB version for a given device id.
It is not necessary to open the port, create the device or register before using this function, since it will do a dedicated read.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
Returns:
| Type | Description |
|---|---|
int
|
The PCB version number. |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 | |
device_get_status_bits
¤
Returns the status bits for a given device id.
It is not necessary to open the port, create the device or register before using this function, since it will do a dedicated read.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
Returns:
| Type | Description |
|---|---|
int
|
The status bits. |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 | |
device_get_type
¤
Returns the module type for a specific device id.
It is not necessary to open the port, create the device or register before using this function, since it will do a dedicated read.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
Returns:
| Type | Description |
|---|---|
int
|
The module type. |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 | |
device_remove
¤
device_remove(device_id: int) -> None
Remove a specific device from the internal device list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
809 810 811 812 813 814 815 | |
device_remove_all
¤
device_remove_all() -> None
Remove all devices from the internal device list.
No confirmation is given, the list is simply cleared.
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
817 818 819 820 821 822 | |
device_set_live
¤
Sets the internal device live status for a specific device id (module address).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
enabled
|
bool
|
Whether to enable ( |
required |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
824 825 826 827 828 829 830 831 | |
disconnect
¤
disconnect() -> None
Disconnect from the port.
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
833 834 835 836 837 | |
get_all_ports
staticmethod
¤
Returns a list of all ports.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
size
|
int
|
The maximum size of the string buffer to fetch the results. |
255
|
Returns:
| Type | Description |
|---|---|
list[str]
|
A list of port names. |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 | |
get_legacy_bus_scanning
staticmethod
¤
get_legacy_bus_scanning() -> bool
Get the bus-scanning mode.
Returns:
| Type | Description |
|---|---|
bool
|
|
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
870 871 872 873 874 875 876 877 878 879 880 881 | |
get_modules
¤
Returns all device types (module types) from the device.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
size
|
int
|
The maximum number of bytes that the device list can be. |
255
|
Returns:
| Type | Description |
|---|---|
dict[str, int]
|
The module type as the keys and its corresponding device ID as the value. |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
858 859 860 861 862 863 864 865 866 867 868 | |
get_open_ports
staticmethod
¤
Returns a list of already-opened ports.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
size
|
int
|
The maximum size of the string buffer to fetch the results. |
255
|
Returns:
| Type | Description |
|---|---|
list[str]
|
A list of port names that are already open. |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 | |
get_port_error_msg
¤
get_port_error_msg() -> str
Retrieve error message for the port.
Returns:
| Type | Description |
|---|---|
str
|
The error message. An empty string indicates no error. |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
902 903 904 905 906 907 908 909 910 911 | |
get_port_status
¤
get_port_status() -> PortStatus
Get the status of the port.
Returns:
| Type | Description |
|---|---|
PortStatus
|
The port status. |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
913 914 915 916 917 918 919 920 921 | |
load_sdk
staticmethod
¤
load_sdk(path: PathLike | None = None) -> None
Load the SDK.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
PathLike | None
|
The path to |
None
|
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
520 521 522 523 524 525 526 527 528 | |
open_ports
staticmethod
¤
Open the specified port(s).
Repeated calls to this function is allowed to reopen and/or rescan for devices.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
names
|
str
|
If not specified then open all available ports are opened. Port
names are case sensitive. Example port names are |
()
|
auto
|
bool
|
If |
True
|
live
|
bool
|
If |
True
|
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 | |
point_to_point_port_add
¤
point_to_point_port_add(port: PointToPoint) -> None
Creates or modifies a point-to-point port.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
port
|
PointToPoint
|
A point-to-point port. |
required |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 | |
point_to_point_port_del
¤
point_to_point_port_del() -> None
Delete the point-to-point port.
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
969 970 971 | |
point_to_point_port_get
¤
point_to_point_port_get() -> PointToPoint
Retrieve the information about the point-to-point port setting.
Returns:
| Type | Description |
|---|---|
PointToPoint
|
The information about the point-to-point port setting. |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 | |
register_create
¤
register_create(
device_id: int,
reg_id: int,
priority: int | RegisterPriority,
data: int | RegisterData,
) -> None
Creates a register in the internal register list.
If the open_ports function has
been called with live=True then the kernel immediately starts to monitor the register.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
reg_id
|
int
|
The register id (register address). |
required |
priority
|
int | RegisterPriority
|
The monitoring priority. |
required |
data
|
int | RegisterData
|
The register data type. Not used internally but could be used in a common callback function to determine the data type. |
required |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 | |
register_exists
¤
Checks if a specific register already exists in the internal register list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
reg_id
|
int
|
The register id (register address). |
required |
Returns:
| Type | Description |
|---|---|
bool
|
Whether the register exists. |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 | |
register_get_all
¤
Returns the register ids (register addresses) from the internal register list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
Returns:
| Type | Description |
|---|---|
list[int]
|
The register ids. |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 | |
register_read
¤
Reads a register value and returns the result.
It is not necessary to open the port, create the device or register before using this function, since it will do a dedicated read.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
reg_id
|
int
|
The register id (register address). |
required |
index
|
int
|
Value index. Typically -1, but could be used to extract data from a specific position in the register. Index is byte counted. |
-1
|
Returns:
| Type | Description |
|---|---|
bytes
|
The register value. |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 | |
register_read_ascii
¤
Reads an ascii string from the register.
It is not necessary to open the port, create the device or register before using this function, since it will do a dedicated read.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
reg_id
|
int
|
The register id (register address). |
required |
index
|
int
|
Value index. Typically -1, but could be used to extract data from a specific position in the register. Index is byte counted. |
-1
|
Returns:
| Type | Description |
|---|---|
str
|
The ascii value. |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 | |
register_read_f32
¤
Reads 32-bit float value from the register.
It is not necessary to open the port, create the device or register before using this function, since it will do a dedicated read.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
reg_id
|
int
|
The register id (register address). |
required |
index
|
int
|
Value index. Typically -1, but could be used to extract data from a specific position in the register. Index is byte counted. |
-1
|
Returns:
| Type | Description |
|---|---|
float
|
The 32-bit float value. |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 | |
register_read_f64
¤
Reads 64-bit double value from the register.
It is not necessary to open the port, create the device or register before using this function, since it will do a dedicated read.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
reg_id
|
int
|
The register id (register address). |
required |
index
|
int
|
Value index. Typically -1, but could be used to extract data from a specific position in the register. Index is byte counted. |
-1
|
Returns:
| Type | Description |
|---|---|
float
|
The 64-bit double value. |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 | |
register_read_s16
¤
Reads 16-bit signed short value from the register.
It is not necessary to open the port, create the device or register before using this function, since it will do a dedicated read.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
reg_id
|
int
|
The register id (register address). |
required |
index
|
int
|
Value index. Typically -1, but could be used to extract data from a specific position in the register. Index is byte counted. |
-1
|
Returns:
| Type | Description |
|---|---|
int
|
The 16-bit signed short value. |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 | |
register_read_s32
¤
Reads 32-bit signed long value from the register.
It is not necessary to open the port, create the device or register before using this function, since it will do a dedicated read.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
reg_id
|
int
|
The register id (register address). |
required |
index
|
int
|
Value index. Typically -1, but could be used to extract data from a specific position in the register. Index is byte counted. |
-1
|
Returns:
| Type | Description |
|---|---|
int
|
The 32-bit signed long value. |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 | |
register_read_s64
¤
Reads 64-bit signed long long value from the register.
It is not necessary to open the port, create the device or register before using this function, since it will do a dedicated read.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
reg_id
|
int
|
The register id (register address). |
required |
index
|
int
|
Value index. Typically -1, but could be used to extract data from a specific position in the register. Index is byte counted. |
-1
|
Returns:
| Type | Description |
|---|---|
int
|
The 64-bit signed long long value. |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 | |
register_read_s8
¤
Reads 8-bit signed char value from the register.
It is not necessary to open the port, create the device or register before using this function, since it will do a dedicated read.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
reg_id
|
int
|
The register id (register address). |
required |
index
|
int
|
Value index. Typically -1, but could be used to extract data from a specific position in the register. Index is byte counted. |
-1
|
Returns:
| Type | Description |
|---|---|
int
|
The 8-bit signed char value. |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 | |
register_read_u16
¤
Reads 16-bit unsigned short value from the register.
It is not necessary to open the port, create the device or register before using this function, since it will do a dedicated read.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
reg_id
|
int
|
The register id (register address). |
required |
index
|
int
|
Value index. Typically -1, but could be used to extract data from a specific position in the register. Index is byte counted. |
-1
|
Returns:
| Type | Description |
|---|---|
int
|
The 16-bit unsigned short value. |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 | |
register_read_u32
¤
Reads 32-bit unsigned long value from the register.
It is not necessary to open the port, create the device or register before using this function, since it will do a dedicated read.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
reg_id
|
int
|
The register id (register address). |
required |
index
|
int
|
Value index. Typically -1, but could be used to extract data from a specific position in the register. Index is byte counted. |
-1
|
Returns:
| Type | Description |
|---|---|
int
|
The 32-bit unsigned long value. |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 | |
register_read_u64
¤
Reads 64-bit unsigned long long value from the register.
It is not necessary to open the port, create the device or register before using this function, since it will do a dedicated read.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
reg_id
|
int
|
The register id (register address). |
required |
index
|
int
|
Value index. Typically -1, but could be used to extract data from a specific position in the register. Index is byte counted. |
-1
|
Returns:
| Type | Description |
|---|---|
int
|
The 64-bit unsigned long long value. |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 | |
register_read_u8
¤
Reads 8-bit unsigned char value from the register.
It is not necessary to open the port, create the device or register before using this function, since it will do a dedicated read.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
reg_id
|
int
|
The register id (register address). |
required |
index
|
int
|
Value index. Typically -1, but could be used to extract data from a specific position in the register. Index is byte counted. |
-1
|
Returns:
| Type | Description |
|---|---|
int
|
The 8-bit unsigned char value. |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 | |
register_remove
¤
Remove a specific register from the internal register list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
reg_id
|
int
|
The register id (register address). |
required |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
1283 1284 1285 1286 1287 1288 1289 1290 | |
register_remove_all
¤
register_remove_all(device_id: int) -> None
Remove all registers from the internal register list.
No confirmation given, the list is simply cleared.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
1292 1293 1294 1295 1296 1297 1298 1299 1300 | |
register_write
¤
Writes a register value.
It is not necessary to open the port, create the device or register before using this function, since it will do a dedicated write.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
reg_id
|
int
|
The register id (register address). |
required |
data
|
bytes
|
The data to write to the register. |
required |
index
|
int
|
Value index. Typically -1, but could be used to write a value in a multi-value register. |
-1
|
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 | |
register_write_ascii
¤
register_write_ascii(
device_id: int,
reg_id: int,
string: str,
*,
write_eol: bool = False,
index: int = -1
) -> None
Writes a string to the register value.
It is not necessary to open the port, create the device or register before using this function, since it will do a dedicated write.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
reg_id
|
int
|
The register id (register address). |
required |
string
|
str
|
The string to write to the register. |
required |
write_eol
|
bool
|
Whether to append the End Of Line character (a null character) to the string. |
False
|
index
|
int
|
Value index. Typically -1, but could be used to write a value in a mixed-type register. |
-1
|
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 | |
register_write_f32
¤
Writes a 32-bit float register value.
It is not necessary to open the port, create the device or register before using this function, since it will do a dedicated write.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
reg_id
|
int
|
The register id (register address). |
required |
value
|
float
|
The 32-bit float to write to the register. |
required |
index
|
int
|
Value index. Typically -1, but could be used to write a value in a multi-value register. |
-1
|
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 | |
register_write_f64
¤
Writes a 64-bit double register value.
It is not necessary to open the port, create the device or register before using this function, since it will do a dedicated write.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
reg_id
|
int
|
The register id (register address). |
required |
value
|
float
|
The 64-bit double to write to the register. |
required |
index
|
int
|
Value index. Typically -1, but could be used to write a value in a multi-value register. |
-1
|
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 | |
register_write_read
¤
Writes then reads a register value.
It is not necessary to open the port, create the device or register before using this function, since it will do a dedicated write followed by a dedicated read.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
reg_id
|
int
|
The register id (register address). |
required |
data
|
bytes
|
The data to write to the register. |
required |
index
|
int
|
Value index. Typically -1, but could be used to write a value in a multi-value register. |
-1
|
Returns:
| Type | Description |
|---|---|
bytes
|
The data that was written to the register. |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 | |
register_write_read_ascii
¤
register_write_read_ascii(
device_id: int,
reg_id: int,
string: str,
*,
write_eol: bool = False,
index: int = -1
) -> str
Writes then reads a string register value.
It is not necessary to open the port, create the device or register before using this function, since it will do a dedicated write followed by a dedicated read.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
reg_id
|
int
|
The register id (register address). |
required |
string
|
str
|
The string to write to the register. |
required |
write_eol
|
bool
|
Whether to append the End Of Line character (a null character) to the string. |
False
|
index
|
int
|
Value index. Typically -1, but could be used to write a value in a multi-value register. |
-1
|
Returns:
| Type | Description |
|---|---|
str
|
The string that was written to the register. |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 | |
register_write_read_f32
¤
Writes then reads a 32-bit float register value.
It is not necessary to open the port, create the device or register before using this function, since it will do a dedicated write followed by a dedicated read.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
reg_id
|
int
|
The register id (register address). |
required |
value
|
float
|
The 32-bit float value to write to the register. |
required |
index
|
int
|
Value index. Typically -1, but could be used to write a value in a multi-value register. |
-1
|
Returns:
| Type | Description |
|---|---|
float
|
The 32-bit float value that was written to the register. |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 | |
register_write_read_f64
¤
Writes then reads a 64-bit double register value.
It is not necessary to open the port, create the device or register before using this function, since it will do a dedicated write followed by a dedicated read.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
reg_id
|
int
|
The register id (register address). |
required |
value
|
float
|
The 64-bit double value to write to the register. |
required |
index
|
int
|
Value index. Typically -1, but could be used to write a value in a multi-value register. |
-1
|
Returns:
| Type | Description |
|---|---|
float
|
The 64-bit double value that was written to the register. |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 | |
register_write_read_s16
¤
Writes then reads a 16-bit signed short register value.
It is not necessary to open the port, create the device or register before using this function, since it will do a dedicated write followed by a dedicated read.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
reg_id
|
int
|
The register id (register address). |
required |
value
|
int
|
The 16-bit signed short value to write to the register. |
required |
index
|
int
|
Value index. Typically -1, but could be used to write a value in a multi-value register. |
-1
|
Returns:
| Type | Description |
|---|---|
int
|
The 16-bit signed short value that was written to the register. |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 | |
register_write_read_s32
¤
Writes then reads a 32-bit signed long register value.
It is not necessary to open the port, create the device or register before using this function, since it will do a dedicated write followed by a dedicated read.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
reg_id
|
int
|
The register id (register address). |
required |
value
|
int
|
The 32-bit signed long value to write to the register. |
required |
index
|
int
|
Value index. Typically -1, but could be used to write a value in a multi-value register. |
-1
|
Returns:
| Type | Description |
|---|---|
int
|
The 32-bit signed long value that was written to the register. |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 | |
register_write_read_s64
¤
Writes then reads a 64-bit signed long long register value.
It is not necessary to open the port, create the device or register before using this function, since it will do a dedicated write followed by a dedicated read.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
reg_id
|
int
|
The register id (register address). |
required |
value
|
int
|
The 64-bit signed long long value to write to the register. |
required |
index
|
int
|
Value index. Typically -1, but could be used to write a value in a multi-value register. |
-1
|
Returns:
| Type | Description |
|---|---|
int
|
The 64-bit signed long long value that was written to the register. |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 | |
register_write_read_s8
¤
Writes then reads a 8-bit signed char register value.
It is not necessary to open the port, create the device or register before using this function, since it will do a dedicated write followed by a dedicated read.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
reg_id
|
int
|
The register id (register address). |
required |
value
|
int
|
The 8-bit signed char value to write to the register. |
required |
index
|
int
|
Value index. Typically -1, but could be used to write a value in a multi-value register. |
-1
|
Returns:
| Type | Description |
|---|---|
int
|
The 8-bit signed char value that was written to the register. |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 | |
register_write_read_u16
¤
Writes then reads a 16-bit unsigned short register value.
It is not necessary to open the port, create the device or register before using this function, since it will do a dedicated write followed by a dedicated read.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
reg_id
|
int
|
The register id (register address). |
required |
value
|
int
|
The 16-bit unsigned short value to write to the register. |
required |
index
|
int
|
Value index. Typically -1, but could be used to write a value in a multi-value register. |
-1
|
Returns:
| Type | Description |
|---|---|
int
|
The 16-bit unsigned short value that was written to the register. |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 | |
register_write_read_u32
¤
Writes then reads a 32-bit unsigned long register value.
It is not necessary to open the port, create the device or register before using this function, since it will do a dedicated write followed by a dedicated read.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
reg_id
|
int
|
The register id (register address). |
required |
value
|
int
|
The 32-bit unsigned long value to write to the register. |
required |
index
|
int
|
Value index. Typically -1, but could be used to write a value in a multi-value register. |
-1
|
Returns:
| Type | Description |
|---|---|
int
|
The 32-bit unsigned long value that was written to the register. |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 | |
register_write_read_u64
¤
Writes then reads a 64-bit unsigned long long register value.
It is not necessary to open the port, create the device or register before using this function, since it will do a dedicated write followed by a dedicated read.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
reg_id
|
int
|
The register id (register address). |
required |
value
|
int
|
The 64-bit unsigned long long value to write to the register. |
required |
index
|
int
|
Value index. Typically -1, but could be used to write a value in a multi-value register. |
-1
|
Returns:
| Type | Description |
|---|---|
int
|
The 64-bit unsigned long long value that was written to the register. |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 | |
register_write_read_u8
¤
Writes then reads a 8-bit unsigned char register value.
It is not necessary to open the port, create the device or register before using this function, since it will do a dedicated write followed by a dedicated read.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
reg_id
|
int
|
The register id (register address). |
required |
value
|
int
|
The 8-bit unsigned char value to write to the register. |
required |
index
|
int
|
Value index. Typically -1, but could be used to write a value in a multi-value register. |
-1
|
Returns:
| Type | Description |
|---|---|
int
|
The 8-bit unsigned char value that was written to the register. |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 | |
register_write_s16
¤
Writes a 16-bit signed short register value.
It is not necessary to open the port, create the device or register before using this function, since it will do a dedicated write.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
reg_id
|
int
|
The register id (register address). |
required |
value
|
int
|
The 16-bit signed short to write to the register. |
required |
index
|
int
|
Value index. Typically -1, but could be used to write a value in a multi-value register. |
-1
|
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 | |
register_write_s32
¤
Writes a 32-bit signed long register value.
It is not necessary to open the port, create the device or register before using this function, since it will do a dedicated write.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
reg_id
|
int
|
The register id (register address). |
required |
value
|
int
|
The 32-bit signed long to write to the register. |
required |
index
|
int
|
Value index. Typically -1, but could be used to write a value in a multi-value register. |
-1
|
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 | |
register_write_s64
¤
Writes a 64-bit signed long long register value.
It is not necessary to open the port, create the device or register before using this function, since it will do a dedicated write.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
reg_id
|
int
|
The register id (register address). |
required |
value
|
int
|
The 64-bit signed long long to write to the register. |
required |
index
|
int
|
Value index. Typically -1, but could be used to write a value in a multi-value register. |
-1
|
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 | |
register_write_s8
¤
Writes a 8-bit signed char register value.
It is not necessary to open the port, create the device or register before using this function, since it will do a dedicated write.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
reg_id
|
int
|
The register id (register address). |
required |
value
|
int
|
The 8-bit signed char to write to the register. |
required |
index
|
int
|
Value index. Typically -1, but could be used to write a value in a multi-value register. |
-1
|
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 | |
register_write_u16
¤
Writes a 16-bit unsigned short register value.
It is not necessary to open the port, create the device or register before using this function, since it will do a dedicated write.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
reg_id
|
int
|
The register id (register address). |
required |
value
|
int
|
The 16-bit unsigned short to write to the register. |
required |
index
|
int
|
Value index. Typically -1, but could be used to write a value in a multi-value register. |
-1
|
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 | |
register_write_u32
¤
Writes a 32-bit unsigned long register value.
It is not necessary to open the port, create the device or register before using this function, since it will do a dedicated write.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
reg_id
|
int
|
The register id (register address). |
required |
value
|
int
|
The 32-bit unsigned long to write to the register. |
required |
index
|
int
|
Value index. Typically -1, but could be used to write a value in a multi-value register. |
-1
|
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 | |
register_write_u64
¤
Writes a 64-bit unsigned long long register value.
It is not necessary to open the port, create the device or register before using this function, since it will do a dedicated write.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
reg_id
|
int
|
The register id (register address). |
required |
value
|
int
|
The 64-bit unsigned long long to write to the register. |
required |
index
|
int
|
Value index. Typically -1, but could be used to write a value in a multi-value register. |
-1
|
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 | |
register_write_u8
¤
Writes a 8-bit unsigned char register value.
It is not necessary to open the port, create the device or register before using this function, since it will do a dedicated write.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device_id
|
int
|
The device id (module address). |
required |
reg_id
|
int
|
The register id (register address). |
required |
value
|
int
|
The 8-bit unsigned char to write to the register. |
required |
index
|
int
|
Value index. Typically -1, but could be used to write a value in a multi-value register. |
-1
|
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 | |
set_callback_device_status
staticmethod
¤
set_callback_device_status(callback: NKTDeviceStatusCallback | None) -> None
Enables/Disables a callback for device status changes.
See superk_callback.py for an example usage.
Note
Due to a risk of circular runaway leading to stack overflow, it is not allowed to call functions in the DLL from within the callback function. If a call is made to a function in the DLL the function will raise an exception.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
callback
|
NKTDeviceStatusCallback | None
|
A callback function. Pass in |
required |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 | |
set_callback_port_status
staticmethod
¤
set_callback_port_status(callback: NKTPortStatusCallback | None) -> None
Enables/Disables a callback for port status changes.
Used by the open_ports and close_ports functions.
See superk_callback.py for an example usage.
Note
Due to a risk of circular runaway leading to stack overflow, it is not allowed to call functions in the DLL from within the callback function. If a call is made to a function in the DLL the function will raise an exception.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
callback
|
NKTPortStatusCallback | None
|
A callback function. Pass in |
required |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 | |
set_callback_register_status
staticmethod
¤
set_callback_register_status(
callback: NKTRegisterStatusCallback | None,
) -> None
Enables/Disables a callback for register status changes.
See superk_callback.py for an example usage.
Note
Due to a risk of circular runaway leading to stack overflow, it is not allowed to call functions in the DLL from within the callback function. If a call is made to a function in the DLL the function will raise an exception.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
callback
|
NKTRegisterStatusCallback | None
|
A callback function. Pass in |
required |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 | |
set_legacy_bus_scanning
staticmethod
¤
set_legacy_bus_scanning(*, mode: bool) -> None
Set the bus-scanning mode to normal or legacy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
bool
|
If |
required |
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 | |
Wrapper around the NKTPDLL.dll SDK from NKT Photonics.
The wrapper was written using v2.1.2.766 of the SDK.
DeviceStatusCallback
module-attribute
¤
A callback function when the status of a device changes.
PortStatusCallback
module-attribute
¤
A callback function when the status of a port changes.
RegisterStatusCallback
module-attribute
¤
RegisterStatusCallback = CFUNCTYPE(
None, c_char_p, c_ubyte, c_ubyte, c_ubyte, c_ubyte, c_ubyte, c_void_p
)
A callback function when the status of a register changes.
DeviceMode
(IntEnum)
¤
The DeviceModeTypes enum.
Attributes:
| Name | Type | Description |
|---|---|---|
Disabled |
int
|
The device is disabled. Not being polled and serviced, |
AnalyseInit |
int
|
The analyse cycle has been started for the device, |
Analyse |
int
|
The analyse cycle is in progress. All default registers being
read to determine its state, |
Normal |
int
|
The analyse cycle has completed and the device is ready, |
LogDownload |
int
|
A log is being downloaded from the device, |
Error |
int
|
The device is in an error state, |
Timeout |
int
|
The connection to the device has been lost, |
Upload |
int
|
The device is in upload mode and can not be used normally, |
DeviceStatus
(IntEnum)
¤
The DeviceStatusTypes enum.
Attributes:
| Name | Type | Description |
|---|---|---|
ModeChanged |
int
|
Data contains 1 unsigned byte
DeviceMode, |
LiveChanged |
int
|
Data contains 1 unsigned byte, 0=live off, 1=live on, |
TypeChanged |
int
|
Data contains 1 unsigned byte with DeviceType, |
PartNumberChanged |
int
|
Data contains a zero terminated string with part number, |
PCBVersionChanged |
int
|
Data contains 1 unsigned byte with PCB version number, |
StatusBitsChanged |
int
|
Data contains 1 unsigned long with status bits, |
ErrorCodeChanged |
int
|
Data contains 1 unsigned short with error code, |
BlVerChanged |
int
|
Data contains a zero terminated string with Bootloader version, |
FwVerChanged |
int
|
Data contains a zero terminated string with Firmware version, |
ModuleSerialChanged |
int
|
Data contains a zero terminated string with Module serial number, |
PCBSerialChanged |
int
|
Data contains a zero terminated string with PCB serial number, |
SysTypeChanged |
int
|
Data contains 1 unsigned byte with SystemType, |
ParameterSet
(Structure)
¤
The ParameterSet struct.
This is how a calculation on parameter sets is done internally by modules:
DAC_value = (value * (X/Y)) + Offset
where, value is either ParameterSet.StartVal or ParameterSet.FactoryVal
value = (ADC_value * (X/Y)) + Offset
where, value often is available via another measurement register.
Attributes:
| Name | Type | Description |
|---|---|---|
Unit |
c_uint8
|
Unit type as defined in tParamSetUnitTypes. |
ErrorHandler |
c_uint8
|
Warning/Error handler not used. |
StartVal |
c_ushort
|
Setpoint for Settings parameter set, unused in Measurement parameter sets. |
FactoryVal |
c_ushort
|
Factory Setpoint for Settings parameter set, unused in Measurement parameter sets. |
ULimit |
c_ushort
|
Upper limit. |
LLimit |
c_ushort
|
Lower limit. |
Numerator |
c_short
|
Numerator(X) for calculation. |
Denominator |
c_short
|
Denominator(Y) for calculation. |
Offset |
c_short
|
Offset for calculation. |
PointToPoint
dataclass
¤
PointToPoint(
host_address: str,
host_port: int,
client_address: str,
client_port: int,
protocol: int,
ms_timeout: int,
)
A point-to-point port.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
host_address
|
str
|
The local ip address, e.g., |
required |
host_port
|
int
|
The local port number. |
required |
client_address
|
str
|
The remote ip address, e.g., |
required |
client_port
|
int
|
The remote port number. |
required |
protocol
|
int
|
Either |
required |
ms_timeout
|
int
|
Telegram timeout value in milliseconds. |
required |
PortStatus
(IntEnum)
¤
The PortStatusTypes enum.
Attributes:
| Name | Type | Description |
|---|---|---|
Unknown |
int
|
Unknown status, |
Opening |
int
|
The port is opening, |
Opened |
int
|
The port is now open, |
OpenFail |
int
|
The port open failed, |
ScanStarted |
int
|
The port scanning is started, |
ScanProgress |
int
|
The port scanning progress, |
ScanDeviceFound |
int
|
The port scan found a device, |
ScanEnded |
int
|
The port scanning ended, |
Closing |
int
|
The port is closing, |
Closed |
int
|
The port is now closed, |
Ready |
int
|
The port is open and ready, |
RegisterData
(IntEnum)
¤
The RegisterDataTypes enum.
Attributes:
| Name | Type | Description |
|---|---|---|
UNKNOWN |
int
|
Unknown/Undefined data type, |
MIXED |
int
|
Mixed content data type, |
U8 |
int
|
8-bit unsigned data type (unsigned char), |
S8 |
int
|
8-bit signed data type (char), |
U16 |
int
|
16-bit unsigned data type (unsigned short), |
S16 |
int
|
16-bit signed data type (short), |
U32 |
int
|
32-bit unsigned data type (unsigned long), |
S32 |
int
|
32-bit signed data type (long), |
F32 |
int
|
32-bit floating point data type (float), |
U64 |
int
|
64-bit unsigned data type (unsigned long long), |
S64 |
int
|
64-bit signed data type (long long), |
F64 |
int
|
64-bit floating point data type (double), |
ASCII |
int
|
Zero terminated ascii string data type, |
ParamSet |
int
|
ParameterSet data type, |
B8 |
int
|
8-bit binary data type (unsigned char), |
H8 |
int
|
8-bit hexadecimal data type (unsigned char), |
B16 |
int
|
16-bit binary data type (unsigned short), |
H16 |
int
|
16-bit hexadecimal data type (unsigned short), |
B32 |
int
|
32-bit binary data type (unsigned long), |
H32 |
int
|
32-bit hexadecimal data type (unsigned long), |
B64 |
int
|
64-bit binary data type (unsigned long long), |
H64 |
int
|
64-bit hexadecimal data type (unsigned long long), |
DATETIME |
int
|
DateTime data type, |
RegisterStatus
(IntEnum)
¤
The RegisterStatusTypes enum.
Attributes:
| Name | Type | Description |
|---|---|---|
Success |
int
|
Register operation was successful |
Busy |
int
|
Register operation resulted in a busy, |
Knackered |
int
|
Register operation resulted in a knackered register (a non-existing register), |
CRCErr |
int
|
Register operation resulted in a CRC error, |
Timeout |
int
|
Register operation resulted in a timeout, |
ComError |
int
|
Register operation resulted in a COM error. Out of sync. or garbage error, |
Unit
(IntEnum)
¤
The ParamSetUnitTypes enum.
Attributes:
| Name | Type | Description |
|---|---|---|
NONE |
int
|
None/Unknown, |
mV |
int
|
mV, |
V |
int
|
V, |
uA |
int
|
uA, |
mA |
int
|
mA, |
A |
int
|
A, |
uW |
int
|
uW, |
cmW |
int
|
mW/100, |
dmW |
int
|
mW/10, |
mW |
int
|
mW, |
W |
int
|
W, |
mC |
int
|
degC/1000, |
cC |
int
|
degC/100, |
dC |
int
|
degC/10, |
pm |
int
|
pm, |
dnm |
int
|
nm/10, |
nm |
int
|
nm, |
percent |
int
|
%, |
perMile |
int
|
per mile, |
cmA |
int
|
mA/100, |
dmA |
int
|
mA/10, |
RPM |
int
|
RPM, |
dBm |
int
|
dBm, |
cBm |
int
|
dBm/10, |
mBm |
int
|
dBm/100, |
dB |
int
|
dB, |
cB |
int
|
dB/10, |
mB |
int
|
dB/100, |
dpm |
int
|
pm/10, |
cV |
int
|
V/100, |
dV |
int
|
V/10, |
lm |
int
|
lm (lumen), |
dlm |
int
|
lm/10, |
clm |
int
|
lm/100, |
mlm |
int
|
lm/1000, |
device_status_callback
¤
device_status_callback(f: NKTDeviceStatusCallback) -> _CFunctionType
Use as a decorator for a callback function when the status of a device changes.
See superk_callback.py for an example usage.
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
76 77 78 79 80 81 82 | |
port_status_callback
¤
port_status_callback(f: NKTPortStatusCallback) -> _CFunctionType
Use as a decorator for a callback function when the status of a port changes.
See superk_callback.py for an example usage.
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
63 64 65 66 67 68 69 | |
register_status_callback
¤
register_status_callback(f: NKTRegisterStatusCallback) -> _CFunctionType
Use as a decorator for a callback function when the status of a register changes.
See superk_callback.py for an example usage.
Source code in packages/resources/src/msl/equipment_resources/nkt/nktpdll.py
89 90 91 92 93 94 95 | |