Wiki source code of LX3V-4DA

Version 2.1 by Leo Wei on 2022/06/08 14:42

Show last authors
1 = **1 Introduction** =
2
3 * The LX3V-4DA analog special function block has four output channels. The output channels take a digital value and output an equivalent analog signal. This is called a D/A conversion. The LX3V-4DA has maximum resolution of 12bits.
4 * The selection of voltage or current based input/output is by user wiring. Analog ranges of -10 to 10V DC (resolution: 5mV), or 0 to 20mA (resolution: 20µA) maybe selected independently for each channel.
5 * Data transfer between the LX3V-4DA and the LX3V main unit is by buffer memory exchange. There are 32 buffer memories (each of 16 bits) in the LX3V-4DA.
6 * The LX3V-4DA consumes 90mA current from the 5V power supply in LX3V main unit or active expansion unit
7
8 = **2 External dimensions and parts** =
9
10 (% style="text-align:center" %)
11 [[image:LX3V-4DA_html_305fb145f01df02f.png||class="img-thumbnail" height="337" width="1000"]]
12
13 ① Extension cable and connector
14
15 ② Com LED: Light when communicating
16
17 ③ Power LED: Light when getting power
18
19 ④ State LED: Light when normal condition
20
21 ⑤ Module name
22
23 ⑥ Analog signal output terminal
24
25 ⑦ Extension module interface
26
27 ⑧ DIN rail mounting slot
28
29 ⑨ DIN rail hook
30
31 ⑩ Mounting holes (φ4.5)
32
33 (((
34 * Be sure to use the crimp-style terminals that satisfy the dimensional requirements shows in the left figure.
35 * Apply 0.5 to 0.8 N.m (5 to 8 kgf.cm) torque to tighten the terminals to prevent abnormal operation.
36
37 (% style="text-align:center" %)
38 [[image:LX3V-4DA_html_567be68423413d26.png||class="img-thumbnail" height="199" width="300"]]
39 )))
40
41 = **3 Installation and wiring** =
42
43 Various special blocks controlled by the FROM/TO commands, such as the analog input blocks high-speed counter blocks, etc. can be connected to the LX3V programmable controller (MPU), or connected to the right side of the other extension blocks or units. Up to 16 special blocks can be connected to a single MPU in the numeric order of No. 0 to No.15.
44
45 (% style="text-align:center" %)
46 [[image:LX3V-4DA_html_272dd0c915b463ef.png||class="img-thumbnail" height="344" width="1100"]]
47
48 **WIRING: **The terminal layout shown below may differ from the actual layout. For the correct terminal layout, refer to section 2 External Dimensions and Parts.
49
50 (% style="text-align:center" %)
51 [[image:LX3V-4DA_html_6f615e1cb3ad1139.png||class="img-thumbnail" height="212" width="800"]]
52
53 *1: Use a twisted pair shielded cable for the analog output. This cable should be wired away from power lines or any other lines which could induce noise.
54
55 *2: Apply 1-point grounding at the load side of the output cable (class 3 grounding: 100Ω or less).
56
57 *3: If electrical noise or a voltage ripple exists at the output, connect a smoothing capacitor of 0.1 to 0.47uF, 25V.
58
59 *4: Connect the [[image:LX3V-4DA_html_521762f8994ba428.png]] terminal on the LX3V-4DA with the [[image:LX3V-4DA_html_521762f8994ba428.png]] terminal on the MPU of the programmable controller.
60
61 *5: Shorting the voltage output terminal or connecting the current output load to the voltage output terminal may damage the LX3V-4DA.
62
63 *6: The 24V DC service power of the programmable controller can also be used.
64
65 *7: Don’t connect any unit to the unused terminal [[image:LX3V-4DA_html_9ea03e9f7e6e8562.png]]
66
67 = **4 Allocation of buffer memories (BFM)** =
68
69 (% border="1" %)
70 |**BFM**|(% colspan="3" %)**Description**
71 |#0(E)|(% colspan="3" %)Output mode select. Factory setting H0000
72 |#1|Output data Channel CH1|(% colspan="2" rowspan="4" %)Channel output value, default: 0
73 |#2|Output data Channel CH2
74 |#3|Output data Channel CH3
75 |#4|Output data Channel CH4
76 |#5(E)|(% colspan="3" %)Holding mode
77 |#6|(% colspan="3" %)Reserved
78 |#7|(% colspan="3" %)Reserved
79 |#8(E)|(% colspan="3" %)Offset/gain setting command CH1,CH2 default :H0000
80 |#9(E)|(% colspan="3" %)Offset/gain setting command CH3,CH4 default :H0000
81 |#10|(% colspan="2" %)Offset data CH1*1|(% rowspan="8" %)(((
82 Unit: mV or μA
83
84 Default offset value:0
85
86 Default gain value:+5000,
87
88 Output mode 0
89 )))
90 |#11|(% colspan="2" %)Gain data CH1*2
91 |#12|(% colspan="2" %)Offset data CH2*1
92 |#13|(% colspan="2" %)Gain data CH2*2
93 |#14|(% colspan="2" %)Offset data CH3*1
94 |#15|(% colspan="2" %)Gain data CH3*2
95 |#16|(% colspan="2" %)Offset data CH4*1
96 |#17|(% colspan="2" %)Gain data CH4*2
97 |#18,#19|(% colspan="3" %)Reserved
98 |#20(E)|(% colspan="3" %)Initialize, default: 0
99 |#21E|(% colspan="3" %)I/O characteristics adjustment inhibit (Initial value 1)
100 |#22-#28|(% colspan="3" %)Reserved
101 |#29|(% colspan="3" %)Error states
102 |#30|(% colspan="3" %)K3020 identification code
103 |#31|(% colspan="3" %)Software version
104
105 * **Channel Select**
106
107 The value of BFM #0 switches the analog output between voltage and current on each channel. It takes the form of a 4 digit hexadecimal number. The first digit will be the command for channel1 (CH1), and the second digit for channel 2 (CH2) etc. The numeric values of these four digits respectively represent the following items:
108
109 O=0: Sets the voltage output mode (-10V to 10V);
110
111 O=1: Sets the current output mode (+4mA to +20mA);
112
113 O=2: Sets the current output mode (0mA to 20mA);
114
115 O=3: Channel OFF;
116
117 O=4: Sets the voltage output mode (-10V to 10V);
118
119 O=5: Sets the current output mode (+4mA to +20mA);
120
121 O=6: Sets the current output mode (0mA to 20mA);
122
123 **Example: H3310**
124
125 CH1: voltage range (-10V to 10V);
126
127 CH2: voltage range (+4mA to +20mA);
128
129 CH3CH4: Channel OFF;
130
131 (% border="1" %)
132 |**BFM#0**|**Analog mode**|**Digital mode**|**Resolution**|**Gain/Offset**|**Constant**
133 |0|-10V ~~ 10V|-2000 ~~2000|5mV|0/5000|1000
134 |1|4mA ~~ 20mA|0 ~~ 1000|16uA|4000/20000|1000
135 |2|0 ~~ 20mA|0 ~~ 1000|20uA|0/20000|1000
136 |3|Disable|~-~-|~-~-|~-~-|~-~-
137 |4|-10V ~~ 10V|-10000 ~~ 10000|1mV|0/5000|5000
138 |5|4mA ~~ 20mA|0 ~~ 2000|8uA|4000/20000|2000
139 |6|0 ~~ 20mA|0 ~~ 2000|10uA|0/20000|2000
140
141 * **[BFM #5]**
142
143 Data holding mode: While the programmable controller is in the STOP mode, the last output value in the RUN mode will be held. To reset the value to the offset value, write the hexadecimal value in BFM #5 as follows:
144
145 (((
146 O=0: Holds the output
147
148 O=1: Reset to the offset value
149
150 (% style="text-align:center" %)
151 [[image:LX3V-4DA_html_1226aff1aed554b0.png||class="img-thumbnail" height="75" width="200"]]
152 )))
153
154 **Example: H0011**
155
156 CH1 and CH2=offset value;
157
158 CH3 and CH4=output holding;
159
160 * **[BFM #8 and #9]**
161
162 Offset/gain setting command: Changes offset and gain values of channels CH1 through CH4 by writing 1 to the corresponding Hex digits of BFM #8 or #9. The current values will be valid until this command is output.
163
164 (((
165 O=0: No change done;
166
167 O=1: Change data value
168
169 (% style="text-align:center" %)
170 [[image:LX3V-4DA_html_7af7e1524e66e172.png||class="img-thumbnail" height="97" width="400"]]
171 )))
172
173 * **[BFM #10 ~~ #17]**
174
175 Offset/gain data: The offset and gain values are changed by writing new data to BFM #10 through #17. The units of the data to be written are mV or µA. The data should be written and then BFM #8 and #9 set. Note that the data value will be rounded down to the nearest 5mV or 20µA.
176
177 * **[BFM #20] Initialize**
178
179 When K1 is written in BFM #20, all values will be initialized to the factory-settings. (Note that the BFM #20 data will override the BFM #21 data.) This initialize function is convenient if users have an error in adjustment.
180
181 * **[BFM #21] I/O characteristics adjustment inhibit**
182
183 Setting BFM #21 to 2 inhibits the user from inadvertent adjustment of I/O characteristics. The adjustment inhibits function, once set, will be valid until the Permit command (BFM #21=1) is set. The initial value is 1 (Permit). The set value will be retained even after power-off.
184
185 * **[BFM #29] Error status**
186
187 When an error occurs, use the FROM command to read out the details of the error.
188
189 (% border="1" %)
190 |**Bit**|**Name**|**Status when bit is set to “1" (turned on)**|(((
191 **Status when bit is set to ”0"**
192
193 **(turned off)**
194 )))
195 |b0|Error|Error if any of b1 through b4 is turned on|No error
196 |b1|O/G error|Offset/gain data in EEPROM is abnormal or a data setting error occurs|Offset/Gain data normal
197 |b2|Power supply error|24V DC power failure|Power supplied normally
198 |b3|Hardware error|Defective D/A converter or other hardware|Non-detective hardware
199 |b10|Range error|The digital input or analog output value is out of the specified range|The input or output value is in the specified range.
200 |b12|G/O Adjustment prohibit status|BFM #21 is not set to “1".|(((
201 Adjustable status
202
203 (BFM #21 = 1)
204 )))
205
206 * **[BFM #30]**
207
208 The identification code for a special block is read using the FROM command. The identification code for the LX3V-4DA unit is K3020.The MPU can use this facility in the program to identify the special block before commencing any data transfer from and to the special block.
209
210 **✎Note: BFM #’s marked E/ (E).**
211
212 * Values of BFM #0, #5, and #21, (marked E) are stored in EEPROM memory of the LX3V-4DA. BFM #10 to #17 are copied to EEPROM when the gain/offset setting command BFM #8, #9 is used. Also, BFM #20 causes resetting of the EEPROM memory. The EEPROM has a life of about 10,000 cycles (changes), so do not use programs which frequently change these BFM’s.
213 * A mode change of BFM #0 automatically involves a change of the corresponding offset and gain values. Because of the time needed to write the new values to the internal EEPROM memory, a delay of 3 s is required between instructions changing BFM #0 and instructions writing to the corresponding BFM #10 through BFM #17.
214
215 Therefore, a delay timer should be used before writing to BFM #10 through #17.
216
217 = **5 Operation and program examples** =
218
219 If the factory-set I/O characteristics are not changed and the status information is not used, user can operate the LX3V-4DA using the following simple program. For the FROM and TO commands, refer to the LX3V PLC Programming Manual.
220
221 CH1 and CH2: Voltage output mode (-10V to +10V);
222
223 CH3: Current output mode (+4mA to +20mA);
224
225 CH4: Current output mode (0mA to +20mA);
226
227 (% style="text-align:center" %)
228 [[image:LX3V-4DA_html_6cdc7105ddd85647.png||class="img-thumbnail" height="196" width="400"]]
229
230 **✎Note: **
231
232 (H2100)→ BFM#0
233
234 * CH1 and CH2: Voltage output,
235 * CH3: Current output (+4mA to +20mA),
236 * CH4: Current output (0mA to +20mA)
237
238 Write data in respective data registers while observing the following ranges:
239
240 Data register D0 and D1: -2,000 to +2,000 Data register D2 and D3: 0 to +1,000
241
242 Data register D0→ BFM #1 (output to CH1)
243
244 Data register D1→ BFM #2 (output to CH2)
245
246 Data register D2→ BFM #3 (output to CH3)
247
248 Data register D3→ BFM #4 (output to CH4)
249
250 **Operation procedure**
251
252 1. Turn off the power of the MPU, and then connect the LX3V-4DA. After that, wire the I/O lines of the LX3V-4DA.
253 1. Set the MPU to STOP, and turn on the power. Write the above program then switch the MPU to RUN.
254 1. Analog values will be sent from D0 (BFM #1), D1 (BFM #2), D2 (BFM #3), and D3 (BFM #4) to the respective output channels of the LX3V-4DA. When the MPU is in STOP, the analog values set before stopping the MPU will remain output. (The output will be held);
255 1. When the MPU is in STOP, the offset values can also be output. For a detailed description, refer to Section 5.
256
257 **Program example**
258
259 For the following program, CH1 and CH2 of the LX3V-4DA connected at special block position No. 1 are used as voltage output channels, CH3 as a current output channel (+4 mA to +20 mA), and CH4 as a current output channel (0mA to +20 mA). When the MPU is in STOP, the output will be held. In addition, the status information is used.
260
261 (((
262 BFM#30 data (model code) of block No.1 transferred data register D4.
263
264 M1 will be tuned on when the model code is set to K3020
265
266 H2100→ BFM#0 (unit No.1)
267
268 CH1 and CH2: Voltage output; CH3: Current output (+4mA to +20mA); CH4: Current output (0 to +20mA)
269
270 D0 → BFM#1 (CH1 output)
271
272 D1 → BFM#2 (CH2 output)
273
274 D2 → BFM#3 (CH3 output)
275
276 D3 → BFM#4 (CH4 output)
277
278 BFM#29 (b15 to b0) → (M25 to M10)
279
280 Reads out the status data
281
282 Output data abnormal
283
284 (% style="text-align:center" %)
285 [[image:LX3V-4DA_html_7a75142ebdd9b334.png||class="img-thumbnail" height="408" width="400"]]
286 )))
287
288 = **6 Caution regarding operation** =
289
290 1. Check whether the output wiring and/or expansion cables are properly connected on LX3V-4DA analog special function block.
291 1. Check that the LX3V system configuration rules have not been broken, i.e. the number of blocks does not exceed 8 and the total system I/O is equal or less than 256 I/O.Ž
292 1. Ensure that the correct output mode has been selected for the application.
293 1. Check that there is no power overload on either the 5V or 24V power source, remember the loading on the LX3V MPU or a powered extension unit varies according to the number of extension blocks or special function blocks connected.
294 1. Put the main processing unit into RUN.(((
295 (% style="text-align:center" %)
296 [[image:LX3V-4DA_html_40b4d6f7aabb6324.png||class="img-thumbnail" height="115" width="600"]]
297 )))
298 1. After turning on or off the 24 VDC power for analog signals, the analog output may fluctuate for approximately 1 second. This is due to time delays in the power supply from the MPU or differences in start time. For this reason, be sure to take preventive measures so that this output fluctuation will not affect the external units.
299
300 = **7 Adjustment of I/O characteristics** =
301
302 **I/O characteristics**
303
304 The standard characteristics (factory default) are shown by the solid lines in the figure below. These characteristics can be adjusted according to the conditions of the user’s system.
305
306 (% style="text-align:center" %)
307 [[image:LX3V-4DA_html_fb0ea795f3721075.png||class="img-thumbnail" height="354" width="1000"]]
308
309 Gain value: Analog output value when the digital input is +1,000;
310
311 Offset value: Analog output value when the digital input is 0;
312
313 When the slope of the I/O characteristic line is steep: slight changes to the digital input will greatly increase or reduce the analog output.
314
315 When the slope of the I/O characteristic line is gentle: slight changes to the digital input will not always change the analog output.
316
317 **Adjustment of I/O Characteristics**
318
319 * To adjust the I/O characteristics, set the offset and gain of the LX3V-4DA either using push button switches connected to input terminals of the programmable controller or using the forced on/off function of a programming panel. To change the offset and gain, just change the conversion constants of the LX3V-4DA. Metering of the analog output is not needed for adjustment; however a program should be created in the MPU.
320 * An example program for adjustment is shown below. The example shows that for channel CH2 of LX3V-4DA block No.1, the offset value is changed to 7 mA, and the gain value to 20 mA. Note that for CH1, CH3, and CH4.
321
322 (% style="text-align:center" %)
323 [[image:LX3V-4DA_html_4a8b657f5c76b2ee.png||class="img-thumbnail" height="558" width="800"]]
324
325 (% style="text-align:center" %)
326 [[image:LX3V-4DA_html_c84bc0ab8f54de6f.png||class="img-thumbnail" height="252" width="300"]]
327
328 = **8 Outline of FROM and TO** =
329
330 For a detailed description, please refer to the LX3V PLC programming manual.
331
332 * **Read BFM**
333
334 (((
335 BFM#30 of special unit No.1→D0
336
337 (% style="text-align:center" %)
338 [[image:LX3V-4DA_html_a1291f1fe8cf7f36.png||class="img-thumbnail" height="67" width="300"]]
339 )))
340
341 1. **m1:** Special unit or block number (K0 to K7, numbered from the MPU)
342 1. **m2:** Buffer memory head address (K0 to K31)
343 1. **D.:** Head device number of destination data. T, C, D, KnM, KnY, KnS, V and Z can be used to designate the head device. Each device number can be qualified using an index.
344 1. **n:** Number of transfer points (K1 to K32) (K1 to K16 for 32-bit command)
345
346 * **Write BFM**
347
348 (((
349 D2 and D3 →BFM#1 and #2 of special unit No.1
350
351 (% style="text-align:center" %)
352 [[image:LX3V-4DA_html_8a0cda9fad9fac35.png||class="img-thumbnail" height="67" width="300"]]
353 )))
354
355 1. **m1, m2, n:** Same as read BFM
356 1. **S.: **Head device number of source data. T, C, D, KnX, KnM, KnY, KnS, V, Z, K and H can be used to designate the head device. Each device number can be qualified using an index.
357
358 When X010 and X011 are off, transfer will not be executed, therefore the destination data value will not be changed.
359
360 = **9 Troubleshooting** =
361
362 If the LX3V-4DA does not operate properly, check the following items:
363
364 * Check the external wiring. Refer to section 3 of this manual.
365 * Check status of the POWER indicator lamp (LED) of the LX3V-4DA.
366
367 On: The extension cable is properly connected.
368
369 Off or flash: Check connection of extension cable. Also check the 5 V power supply capacity.
370
371 * Check status of the 24 V power indicator lamps (LED) of the LX3V-4DA.
372
373 On: 24 VDC is supplied.
374
375 Off: Supply 24 VDC (+10%) to the LX3V-4DA.
376
377 * Check the status of the D/A conversion indicator lamp (LED) of the LX3V-4DA.
378
379 Flash: D/A conversion are normal.
380
381 On or off: The ambient conditions are not suitable for the LX3V-4DA, or the LX3V-4DA is defective.
382
383 1. Check that the external load resistance connected to each analog output terminal does not exceed the capacity of the LX3V-4DA drive (voltage output: 2kΩ to 1 MΩ / current output: 500Ω).‘
384 1. Check the output voltage or current value using a voltmeter or ammeter, and confirm that the output meets the I/O characteristics. If the output does not meet the I/O characteristics, adjust the offset and gain again. Refer to section 8.
385
386 To test the withstand voltage of the LX3V-4DA, connect all the terminals to the grounding terminal.