Wiki source code of LX3V-4DA

Version 3.1 by Stone Wu on 2022/09/14 16:03

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||height="337" width="1000" class="img-thumbnail"]]
12
13 1. Extension cable and connector
14 1. Com LED: Light when communicating
15 1. Power LED: Light when getting power
16 1. State LED: Light when normal condition
17 1. Module name
18 1. Analog signal output terminal
19 1. Extension module interface
20 1. DIN rail mounting slot
21 1. DIN rail hook
22 1. Mounting holes (φ4.5)
23
24 (((
25 Be sure to use the crimp-style terminals that satisfy the dimensional requirements shows in the left figure.
26
27 Apply 0.5 to 0.8 N.m (5 to 8 kgf.cm) torque to tighten the terminals to prevent abnormal operation.
28
29 (% style="text-align:center" %)
30 [[image:LX3V-4DA_html_567be68423413d26.png||height="199" width="300" class="img-thumbnail"]]
31 )))
32
33 = **3 Installation and wiring** =
34
35 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.
36
37 (% style="text-align:center" %)
38 [[image:LX3V-4DA_html_272dd0c915b463ef.png||height="344" width="1100" class="img-thumbnail"]]
39
40 **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.
41
42 (% style="text-align:center" %)
43 [[image:LX3V-4DA_html_6f615e1cb3ad1139.png||height="212" width="800" class="img-thumbnail"]]
44
45 * *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.
46 * *2: Apply 1-point grounding at the load side of the output cable (class 3 grounding: 100Ω or less).
47 * *3: If electrical noise or a voltage ripple exists at the output, connect a smoothing capacitor of 0.1 to 0.47uF, 25V.
48 * *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.
49 * *5: Shorting the voltage output terminal or connecting the current output load to the voltage output terminal may damage the LX3V-4DA.
50 * *6: The 24V DC service power of the programmable controller can also be used.
51 * *7: Don’t connect any unit to the unused terminal [[image:LX3V-4DA_html_9ea03e9f7e6e8562.png]]
52
53 = **4 Allocation of buffer memories (BFM)** =
54
55 (% border="1" %)
56 |=(% scope="row" %)**BFM**|=(% colspan="3" %)**Description**
57 |=#0(E)|(% colspan="3" %)Output mode select. Factory setting H0000
58 |=#1|Output data Channel CH1|(% colspan="2" rowspan="4" %)Channel output value, default: 0
59 |=#2|Output data Channel CH2
60 |=#3|Output data Channel CH3
61 |=#4|Output data Channel CH4
62 |=#5(E)|(% colspan="3" %)Holding mode
63 |=#6|(% colspan="3" %)Reserved
64 |=#7|(% colspan="3" %)Reserved
65 |=#8(E)|(% colspan="3" %)Offset/gain setting command CH1,CH2 default :H0000
66 |=#9(E)|(% colspan="3" %)Offset/gain setting command CH3,CH4 default :H0000
67 |=#10|(% colspan="2" %)Offset data CH1*1|(% rowspan="8" %)(((
68 Unit: mV or μA
69
70 Default offset value:0
71
72 Default gain value:+5000,
73
74 Output mode 0
75 )))
76 |=#11|(% colspan="2" %)Gain data CH1*2
77 |=#12|(% colspan="2" %)Offset data CH2*1
78 |=#13|(% colspan="2" %)Gain data CH2*2
79 |=#14|(% colspan="2" %)Offset data CH3*1
80 |=#15|(% colspan="2" %)Gain data CH3*2
81 |=#16|(% colspan="2" %)Offset data CH4*1
82 |=#17|(% colspan="2" %)Gain data CH4*2
83 |=#18,#19|(% colspan="3" %)Reserved
84 |=#20(E)|(% colspan="3" %)Initialize, default: 0
85 |=#21E|(% colspan="3" %)I/O characteristics adjustment inhibit (Initial value 1)
86 |=#22-#28|(% colspan="3" %)Reserved
87 |=#29|(% colspan="3" %)Error states
88 |=#30|(% colspan="3" %)K3020 identification code
89 |=#31|(% colspan="3" %)Software version
90
91 * **Channel Select**
92
93 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:
94
95 * O=0: Sets the voltage output mode (-10V to 10V);
96 * O=1: Sets the current output mode (+4mA to +20mA);
97 * O=2: Sets the current output mode (0mA to 20mA);
98 * O=3: Channel OFF;
99 * O=4: Sets the voltage output mode (-10V to 10V);
100 * O=5: Sets the current output mode (+4mA to +20mA);
101 * O=6: Sets the current output mode (0mA to 20mA);
102
103 **Example: H3310**
104
105 * CH1: voltage range (-10V to 10V);
106 * CH2: voltage range (+4mA to +20mA);
107 * CH3CH4: Channel OFF;
108
109 (% border="1" %)
110 |=(% scope="row" %)**BFM#0**|=**Analog mode**|=**Digital mode**|=**Resolution**|=**Gain/Offset**|=**Constant**
111 |=0|-10V ~~ 10V|-2000 ~~2000|5mV|0/5000|1000
112 |=1|4mA ~~ 20mA|0 ~~ 1000|16uA|4000/20000|1000
113 |=2|0 ~~ 20mA|0 ~~ 1000|20uA|0/20000|1000
114 |=3|Disable|~-~-|~-~-|~-~-|~-~-
115 |=4|-10V ~~ 10V|-10000 ~~ 10000|1mV|0/5000|5000
116 |=5|4mA ~~ 20mA|0 ~~ 2000|8uA|4000/20000|2000
117 |=6|0 ~~ 20mA|0 ~~ 2000|10uA|0/20000|2000
118
119 **[BFM #5]**
120
121 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:
122
123 (((
124 * O=0: Holds the output
125 * O=1: Reset to the offset value
126
127 (% style="text-align:center" %)
128 [[image:LX3V-4DA_html_1226aff1aed554b0.png||height="75" width="200" class="img-thumbnail"]]
129 )))
130
131 **Example: H0011**
132
133 * CH1 and CH2=offset value;
134 * CH3 and CH4=output holding;
135
136 **[BFM #8 and #9]**
137
138 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.
139
140 (((
141 * O=0: No change done;
142 * O=1: Change data value
143
144 (% style="text-align:center" %)
145 [[image:LX3V-4DA_html_7af7e1524e66e172.png||height="97" width="400" class="img-thumbnail"]]
146 )))
147
148 **[BFM #10 ~~ #17]**
149
150 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.
151
152 **[BFM #20] Initialize**
153
154 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.
155
156 **[BFM #21] I/O characteristics adjustment inhibit**
157
158 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.
159
160 **[BFM #29] Error status**
161
162 When an error occurs, use the FROM command to read out the details of the error.
163
164 (% border="1" %)
165 |=(% scope="row" style="width: 58px;" %)**Bit**|=(% style="width: 213px;" %)**Name**|=(% style="width: 463px;" %)**Status when bit is set to “1" (turned on)**|=(((
166 **Status when bit is set to ”0" (turned off)**
167 )))
168 |=(% style="width: 58px;" %)b0|(% style="width:213px" %)Error|(% style="width:463px" %)Error if any of b1 through b4 is turned on|No error
169 |=(% style="width: 58px;" %)b1|(% style="width:213px" %)O/G error|(% style="width:463px" %)Offset/gain data in EEPROM is abnormal or a data setting error occurs|Offset/Gain data normal
170 |=(% style="width: 58px;" %)b2|(% style="width:213px" %)Power supply error|(% style="width:463px" %)24V DC power failure|Power supplied normally
171 |=(% style="width: 58px;" %)b3|(% style="width:213px" %)Hardware error|(% style="width:463px" %)Defective D/A converter or other hardware|Non-detective hardware
172 |=(% style="width: 58px;" %)b10|(% style="width:213px" %)Range error|(% style="width:463px" %)The digital input or analog output value is out of the specified range|The input or output value is in the specified range.
173 |=(% style="width: 58px;" %)b12|(% style="width:213px" %)G/O Adjustment prohibit status|(% style="width:463px" %)BFM #21 is not set to “1".|(((
174 Adjustable status
175
176 (BFM #21 = 1)
177 )))
178
179 **[BFM #30]**
180
181 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.
182
183 **✎Note: BFM #’s marked E/ (E).**
184
185 * 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.
186 * 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.
187
188 Therefore, a delay timer should be used before writing to BFM #10 through #17.
189
190 = **5 Operation and program examples** =
191
192 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.
193
194 1. CH1 and CH2: Voltage output mode (-10V to +10V);
195 1. CH3: Current output mode (+4mA to +20mA);
196 1. CH4: Current output mode (0mA to +20mA);
197
198 (% style="text-align:center" %)
199 [[image:LX3V-4DA_html_6cdc7105ddd85647.png||height="196" width="400" class="img-thumbnail"]]
200
201 **✎Note: **
202
203 (H2100)→ BFM#0
204
205 * CH1 and CH2: Voltage output,
206 * CH3: Current output (+4mA to +20mA),
207 * CH4: Current output (0mA to +20mA)
208
209 Write data in respective data registers while observing the following ranges:
210
211 * Data register D0 and D1: -2,000 to +2,000 Data register D2 and D3: 0 to +1,000
212 * Data register D0→ BFM #1 (output to CH1)
213 * Data register D1→ BFM #2 (output to CH2)
214 * Data register D2→ BFM #3 (output to CH3)
215 * Data register D3→ BFM #4 (output to CH4)
216
217 **Operation procedure**
218
219 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.
220 1. Set the MPU to STOP, and turn on the power. Write the above program then switch the MPU to RUN.
221 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);
222 1. When the MPU is in STOP, the offset values can also be output. For a detailed description, refer to Section 5.
223
224 **Program example**
225
226 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.
227
228 (((
229 BFM#30 data (model code) of block No.1 transferred data register D4.
230
231 M1 will be tuned on when the model code is set to K3020
232
233 H2100→ BFM#0 (unit No.1)
234
235 CH1 and CH2: Voltage output; CH3: Current output (+4mA to +20mA); CH4: Current output (0 to +20mA)
236
237 D0 → BFM#1 (CH1 output)
238
239 D1 → BFM#2 (CH2 output)
240
241 D2 → BFM#3 (CH3 output)
242
243 D3 → BFM#4 (CH4 output)
244
245 BFM#29 (b15 to b0) → (M25 to M10)
246
247 Reads out the status data
248
249 Output data abnormal
250
251 (% style="text-align:center" %)
252 [[image:LX3V-4DA_html_7a75142ebdd9b334.png||height="408" width="400" class="img-thumbnail"]]
253 )))
254
255 = **6 Caution regarding operation** =
256
257 1. Check whether the output wiring and/or expansion cables are properly connected on LX3V-4DA analog special function block.
258 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.Ž
259 1. Ensure that the correct output mode has been selected for the application.
260 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.
261 1. Put the main processing unit into RUN.(((
262 (% style="text-align:center" %)
263 [[image:LX3V-4DA_html_40b4d6f7aabb6324.png||height="115" width="600" class="img-thumbnail"]]
264 )))
265 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.
266
267 = **7 Adjustment of I/O characteristics** =
268
269 **I/O characteristics**
270
271 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.
272
273 (% style="text-align:center" %)
274 [[image:LX3V-4DA_html_fb0ea795f3721075.png||height="354" width="1000" class="img-thumbnail"]]
275
276 * Gain value: Analog output value when the digital input is +1,000;
277 * Offset value: Analog output value when the digital input is 0;
278 * 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.
279 * When the slope of the I/O characteristic line is gentle: slight changes to the digital input will not always change the analog output.
280
281 **Adjustment of I/O Characteristics**
282
283 * 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.
284 * 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.
285
286 (% style="text-align:center" %)
287 [[image:LX3V-4DA_html_4a8b657f5c76b2ee.png||height="558" width="800" class="img-thumbnail"]]
288
289 (% style="text-align:center" %)
290 [[image:LX3V-4DA_html_c84bc0ab8f54de6f.png||height="252" width="300" class="img-thumbnail"]]
291
292 = **8 Outline of FROM and TO** =
293
294 For a detailed description, please refer to the LX3V PLC programming manual.
295
296 **Read BFM**
297
298 (((
299 BFM#30 of special unit No.1→D0
300
301 (% style="text-align:center" %)
302 [[image:LX3V-4DA_html_a1291f1fe8cf7f36.png||height="67" width="300" class="img-thumbnail"]]
303 )))
304
305 * **m1:** Special unit or block number (K0 to K7, numbered from the MPU)
306 * **m2:** Buffer memory head address (K0 to K31)
307 * **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.
308 * **n:** Number of transfer points (K1 to K32) (K1 to K16 for 32-bit command)
309
310 **Write BFM**
311
312 (((
313 D2 and D3 →BFM#1 and #2 of special unit No.1
314
315 (% style="text-align:center" %)
316 [[image:LX3V-4DA_html_8a0cda9fad9fac35.png||height="67" width="300" class="img-thumbnail"]]
317 )))
318
319 * **m1, m2, n:** Same as read BFM
320 * **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.
321
322 When X010 and X011 are off, transfer will not be executed, therefore the destination data value will not be changed.
323
324 = **9 Troubleshooting** =
325
326 If the LX3V-4DA does not operate properly, check the following items:
327
328 * Check the external wiring. Refer to section 3 of this manual.
329 * Check status of the POWER indicator lamp (LED) of the LX3V-4DA.
330
331 On: The extension cable is properly connected.
332
333 Off or flash: Check connection of extension cable. Also check the 5 V power supply capacity.
334
335 * Check status of the 24 V power indicator lamps (LED) of the LX3V-4DA.
336
337 On: 24 VDC is supplied.
338
339 Off: Supply 24 VDC (+10%) to the LX3V-4DA.
340
341 * Check the status of the D/A conversion indicator lamp (LED) of the LX3V-4DA.
342
343 Flash: D/A conversion are normal.
344
345 On or off: The ambient conditions are not suitable for the LX3V-4DA, or the LX3V-4DA is defective.
346
347 * 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Ω).‘
348 * 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.
349
350 To test the withstand voltage of the LX3V-4DA, connect all the terminals to the grounding terminal.