-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmb2hal.ini
176 lines (139 loc) · 6.1 KB
/
mb2hal.ini
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
#Infos:
#DC67 26.12.2019
#Load the modbus HAL userspace module as the examples below,
#change to match your own HAL_MODULE_NAME and .ini file name
#Using HAL_MODULE_NAME=mb2hal or nothing (default): loadusr -W mb2hal config=config_file.ini
#Using HAL_MODULE_NAME=mymodule: loadusr -Wn mymodule mb2hal config=config_file.ini
#Initialisierung:
[MB2HAL_INIT]
#OPTIONAL: Debug level of init and INI file parsing.
# 0 = silent.
# 1 = error messages (default).
# 2 = OK confirmation messages.
# 3 = debugging messages.
INIT_DEBUG=1
#OPTIONAL: HAL module (component) name. Defaults to "mb2hal".
HAL_MODULE_NAME=st500
#OPTIONAL: Insert a delay of "FLOAT seconds" between transactions in order
#to not to have a lot of logging and facilitate the debugging.
#Useful when using DEBUG=3 (NOT INIT_DEBUG=3)
#It affects ALL transactions.
#Use "0.0" for normal activity.
SLOWDOWN=0.0
#REQUIRED: The number of total Modbus transactions. There is no maximum.
TOTAL_TRANSACTIONS=6
#One transaction section is required per transaction, starting at 00 and counting up sequentially.
#If there is a new link (not transaction), you must provide the REQUIRED parameters 1st time.
#Warning: Any OPTIONAL parameter not specified are copied from the previous transaction.
[TRANSACTION_00]
#Fehler aus FU einlesen:
#Der FU hat verschiedene Fehlermeldungen, diese werden hier alle eingelesen
#NOTSTOP Funktion!
#St500 Adresse: 0x8000 (-> 32768 Dez)
#Allgememeine Kommunkitaktionseinstellungen:
LINK_TYPE=Serial
SERIAL_PORT=/dev/ttyUSB0
SERIAL_BAUD=19200
#Data bits. One of 5,6,7,8.
SERIAL_BITS=8
#Data parity. One of: even, odd, none.
SERIAL_PARITY=none
#Stop bits. One of 1, 2.
SERIAL_STOP=2
#Serial port delay between for this transaction only.
#In ms. Defaults to 0.
# AC10 does not keep up if this value is too small
SERIAL_DELAY_MS=0
MB_SLAVE_ID=1
##St500 Adresse: 0x8000 (-> 32768 Dez)
FIRST_ELEMENT=32768
PIN_NAMES=state
#REQUIRED: Modbus transaction function code (see www.modbus.org specifications).
# fnct_03_read_holding_registers (03 = 0x03)
# fnct_06_write_single_register (06 = 0x06)
#fnct_03_read_holding_registers: creates a floating point output HAL pins, also creates a u32 output HAL pins.
#The pins are named based on component name, transaction number and order number.
#Example: mb2hal.00.01 (transaction=00, second register=01 (00 is the first one))
MB_TX_CODE=fnct_03_read_holding_registers
#OPTIONAL: Response timeout for this transaction. In INTEGER ms. Defaults to 500 ms
#This is how much to wait for 1st byte before raise an error.
##St500: Kein Wert angegeben, jedoch mit 250ms getestet!
MB_RESPONSE_TIMEOUT_MS=250
#OPTIONAL: Byte timeout for this transaction. In INTEGER ms. Defaults to 500 ms.
#This is how much to wait from byte to byte before raise an error.
##St500: Kein Wert angegeben, jedoch mit 250ms getestet!
MB_BYTE_TIMEOUT_MS=250
#OPTIONAL: Instead of giving the transaction number, use a name.
#Example: mb2hal.00.01 could become mb2hal.plcin.01
#The name must not exceed 32 characters.
#NOTE: when using names be careful that you dont end up with two transactions
#usign the same name.
HAL_TX_NAME=error
#OPTIONAL: Maximum update rate in HZ. Defaults to 0.0 (0.0 = as soon as available = infinit).
#NOTE: This is a maximum rate and the actual rate may be lower.
#If you want to calculate it in ms use (1000 / required_ms).
#Example: 100 ms = MAX_UPDATE_RATE=10.0, because 1000.0 ms / 100.0 ms = 10.0 Hz
MAX_UPDATE_RATE=0.0
#OPTIONAL: Debug level for this transaction only.
#See INIT_DEBUG parameter above.
DEBUG=1
#While DEBUGGING transactions note the returned "ret[]" value correspond to:
#/* Modbus protocol exceptions */
#ILLEGAL_FUNCTION -0x01 the FUNCTION code received in the query is not allowed or invalid.
#ILLEGAL_DATA_ADDRESS -0x02 the DATA ADDRESS received in the query is not an allowable address for the slave or is invalid.
#ILLEGAL_DATA_VALUE -0x03 a VALUE contained in the data query field is not an allowable value or is invalid.
#SLAVE_DEVICE_FAILURE -0x04 SLAVE (or MASTER) device unrecoverable FAILUER while attemping to perform the requested action.
#SERVER_FAILURE -0x04 (see above).
#ACKNOWLEDGE -0x05 This response is returned to PREVENT A TIMEOUT in the master.
# A long duration of time is required to process the request in the slave.
#SLAVE_DEVICE_BUSY -0x06 The slave (or server) is BUSY. Retrasmit the request later.
#SERVER_BUSY -0x06 (see above).
#NEGATIVE_ACKNOWLEDGE -0x07 Unsuccessful programming request using function code 13 or 14.
#MEMORY_PARITY_ERROR -0x08 SLAVE parity error in MEMORY.
#GATEWAY_PROBLEM_PATH -0x0A (-10) Gateway path(s) not available.
#GATEWAY_PROBLEM_TARGET -0x0B (-11) The target device failed to repond (generated by master, not slave).
#/* Program or connection */
#COMM_TIME_OUT -0x0C (-12)
#PORT_SOCKET_FAILURE -0x0D (-13)
#SELECT_FAILURE -0x0E (-14)
#TOO_MANY_DATAS -0x0F (-15)
#INVALID_CRC -0x10 (-16)
#INVALID_EXCEPTION_CODE -0x11 (-17)
[TRANSACTION_01]
#FU Frequenz einlesen:
#Die aktuelle Frequenz des FU wird eingelesen
#Frequenz in Hz * 10 (-> 2400 U/min = 40.0 Hz => Wert 400)
#St500 Adresse: 0x1001 (-> 4097 Dez)
MB_TX_CODE=fnct_03_read_holding_registers
FIRST_ELEMENT=4097
HAL_TX_NAME=read
PIN_NAMES=frequency
[TRANSACTION_02]
#Spindel Start / Stopp:
#Parameter: Start Vorwärts (CW) / Start Rückwärts (CCW) / Stop
#St500 Adresse: 0x2000 (-> 8192 Dez)
MB_TX_CODE=fnct_06_write_single_register
FIRST_ELEMENT=8192
HAL_TX_NAME=runmode
PIN_NAMES=command
[TRANSACTION_03]
#Drehzahl (Frequenz):
#Parameter: Drehzahl wurde in Prozentwert der Maximalen Frequenz umgerechnet,
#und auf Gültigkeit überprüft (innerhalb 40...400 Hz (-> 2400...24000 U/min))
#St500 Adresse: 0x1000 (-> 4096 Dez)
MB_TX_CODE=fnct_06_write_single_register
FIRST_ELEMENT=4096
HAL_TX_NAME=write
PIN_NAMES=frequency
[TRANSACTION_04]
#FU Strom einlesen
MB_TX_CODE=fnct_03_read_holding_registers
FIRST_ELEMENT=4100
HAL_TX_NAME=strom
PIN_NAMES=strom
[TRANSACTION_05]
#FU Leistung einlesen
MB_TX_CODE=fnct_03_read_holding_registers
FIRST_ELEMENT=4102
HAL_TX_NAME=drehmoment
PIN_NAMES=drehmoment