How do I program the analog outputs on AX561 module?
Answers
The I/O channels must beconnected to INT variables, so you need to convert between the range of the raw I/O channels and the scaling of your internal engineering Real values.
Configure the AC561 as normal using Control Builder Plus and create variables eg. AI00, AI01,AI02.. AO00, AO01 etc. Remember to choose a channel type eg 0..10V, 4..20mA etc
Open CoDeSys with the updated PLC configuration.
Open the CoDeSys On-Line help and search for AC561. Look for the "Measuring Ranges" section. You will see that the INT values are scaled to be the same as the voltage or current I/O type you have chosen for the channel. So 4..20mA is scaled 4..20, 0..10V is scaled 0..10 etc
use an INT_TO_REAL to convert from the raw input value and then scale the raw input to your chosen measurment units.
Conversely, Scale your output value ( as a real) from engineering units to raw Units, then convert to int with REAL_TO_INT and connect to your output variable.
And of course, you could make a user FB to do this conversion.
Actually, strictly speaking there isnt really any need to convert from the raw units to engineering units except to make things (a lot) easier for the programmer or for display on the HMI.
If you're completely brand new to programming AC500, there are some really good introductory tutorials available on Youtube. Just search for "AC500".
Add new comment