
randomguyrandomcode (Customer) asked a question.
I have a C0-12DRE-2-D Click PLC and I don't understand how to use the analog output. I set the values in the data view, but how do you actually output the voltage? I also tried setting the initial values in the address picker (DF 5 I set to 50 and DF6 to 100). I did go to "CPU Built-in I/O Setup" to change the voltage of DF6 to 0 to .3 Volts, but I left the scale at 0 to 100 so I assumed setting it to 100 should automatically output .3 Volts. What should I do? I'm trying to hook this up to a motor driver and I am using the analog output to connect to a pin (that I believe) can vary the speed by varying the input voltage of the motor driver. I'm pretty sure the problem is on the programming side of things because the light for DA1V and DA2V don't turn on while the program is running. By chance can anyone guide me as to what I'm supposed to do to get the analog outputs working?
Posting your code would be helpful, but the short answer is, yes, your 0-100 is scaled to your 0-.3 volt output. So setting DF6 to zero is 0-volts, 50 is .15-volts and 100 is .3. Now, you'll need to scale your input to the DF6 output to get the full range. Since there is no scale instruction in Click, you'll have to do it with a math instruction..
If you limit your analog output to only 0.3 volts (out of 10) you are giving up a lot of resolution. Personally, if I had a device that only needed 0.3V max, I'd still set the CLICK to output 10V and then use a voltage divider to reduce the final voltage.
" connect to a pin (that I believe) can vary the speed" If you have a voltmeter I'd suggest using to check the output while trouble shooting to remove one variable for the problem, i.e. is the problem the CLICK or the device you are driving?
Also, think that "lights" for the analog I/O don't actually have LEDs behind them, the same case is used for models with discrete outputs so the holes and light pipes are there for them but LEDs are not installed on analog models, so lack of light means nothing
Okay so, I just realized that the motor driver I bought is not analog. When I read how the pins work it said that the pin for the speed takes a PWM as input.
I would post my code, but no joke it just has a single line with END. I tried dragging the "OUT" instruction to the end of one rung, but it didn't allow me to type in DF5 or DA1V. That's kind of what I meant when I said I didn't understand how to do it.
Thanks for the idea to use a voltmeter to test whether I was getting any output! When I edit the value of DF5 in the Data View (I set it to 50 with the range set to 0 to 10 volts) I got 4.9 V on the voltmeter. I just assumed the output wasn't working because I thought the little light next to it would turn on when anything was being sent out.
Although I am not using the analog output anymore, is it alright if I ask how I am supposed to program an analog output? I might consider buying a different driver/controller at some point because the one that I bought was designed to work with Arduino's. I thought I could "make it work" despite that, but well... we'll see how that goes.
Outs are for bools. Need to use a copy for float and int.
Ex. Copy 50 to DF5.
...how I am supposed to program an analog output?
For example, your analog output is controlled by DF6. If you had your Click connected to a C-more or other HMI, you could use an up/down instruction in the HMI to edit the value in DF6. The up/down instruction could have a low limit of 0, and upper limit of 100. The default scaling in Click is 0-100 for 0-10V. So, by changing the value at DF6 by the up/down instruction in the HMI is one way to control the analog output.
In an application I did (but with a Productivity 2000 PLC, aka P2K) was applying glue to a strip of release paper. The pump for the glue was run by an electric pump on a GS3 drive. The machine could also be sped up an slowed down to either increase throughput or decrease it. The issue is, the thickness of glue must not change based on speed. To solve this, I took the 0-10V output of the machine's drive as an analog input into the P2K and scaled that input to control the speed of the GS3 on the pump (the GS3 was operated serially with Modbus read/writes from the P2K.)
Hi @randomguyrandomcode (Customer),
The following post may help you to program an analog output.
https://accautomation.ca/click-plc-analog-dusk-to-dawn-program/
Regards,
Garry
https://accautomation.ca/series/click-plc/
Well, suddenly I'm not getting any voltage in the analogs despite not really changing the scale on DF5 or the Data View value. I'll probably take a couple of days to figure out what I did wrong there. I think I understand my problem now. I've only ever worked with an older Keyence PLC hooked up to a stepper motor. I just assumed the analog needed to be "turned on" before it would do anything. From what I understand it sounds like there is always output to the analog, you just have to adjust the voltage through the values in DF5 and DF6.
Never mind. The analog outputs are working fine. Thanks for all of your help!