Home > Forum > Controllers SlimLine e Netsyst (LogicLab) > Acquisition of digital and analog signals
- This topic has 9 replies, 4 participants and was last updated 4 years ago da Sergio Bertana.
-
AuthorPost
-
March 6, 2018 at 10: 14 pm #36182FleaParticipant
I need to acquire a 0-10V signal on a CPU Slimline MPS053. While for digital I simply mapped my boolean variable from SysCPU [x], for analogs I can't figure out where I find the purchase value from the CPU. Can anyone give me some suggestions?
March 10, 2018 at 7: 16 am #40037Sergio BertanaAdministrator ForumThe SysGetAnInp FB is used to manage the analog inputs, the SysSetAnOut FB is used to manage the analog outputs. You must define the hardware address (Set with the dip switches) of the module and the channel to be managed as a parameter. In the Mode parameter for the inputs it is possible to define the acquisition mode (Current, voltage, temperature, resistance), for the outputs the type of output (Current, voltage).
I add a note regarding the digital I / O, the operating system manages them in the process image by automatically allocating them in the input and output data blocks. So just map the inputs as% IXmc and% QXmc for the outputs (m: Module address, c: Channel), then input 5 of the module with address 1 will be% IX1.5 while output 7 of module 4 will be % QX4.7. Remember that the module address of the CPU is 255, so input 1 of the CPU module will be% IX255.1.
Even for digital I / Os, it is still possible to directly acquire / manage the value using the FB SysGetPhrDI for reading inputs and SysSetPhrDO for managing outputs. I recommend reading: topical, topical, topical.
April 4, 2018 at 7: 58 am #40066AuthorlessIdleSorry I'm a beginner, if I have to acquire a heating water temperature value from an analog input, if I understand correctly I have to do:
Add a function block called for example "Temperature" in which I have to declare the variable.
Define a variable, for example “Twater” as global variable, click on type and check Function Blocks and in the list on the right I call the “Temperature” function that I had created. It's right ? what code do i put to declare the variable?Is it okay to type word? that is, SlimLine reason in whole numbers, then I have to formulate mathematical operations to get the value with the desired decimals, right?
April 5, 2018 at 5: 52 am #40067Sergio BertanaAdministrator ForumIn your specific case, acquiring temperatures using Pt100 or Pt1000 sensors is extremely simple, ours analog I / O expansion module it directly manages many types of sensors, returning to the output a temperature value already in degrees centigrade on a floating point variable of the REAL type.
So it will be enough in your program to instantiate a FB SysGetAnInp defining the address of the analog I / O module and the channel (the module can have 5 or 10) from which you want to acquire the temperature value, here is the screenshot of a program in FBD.In practice it is a bit what you described, in fact, to instantiate means to declare a variable by assigning a name (In our case Temperature) of type FB, in the program the various parameters will be defined as input to the FB (In our case module address, channel number and type of reading) and the variable that will contain the value will be connected to the output (in our case TAcqua).
As you can see for simplicity I have declared the variable TAcqua as a local variable, but if you want to use it in other programs (POUs) of the project you will have to declare as you said a global variable.
July 10, 2018 at 11: 59 am #45102FleaParticipantI am trying with the SysGetAnInp block to read a 0-10V channel on an MPS053A110 CPU… this is the program.
AI_Wind.Addressl: = 255; (* CPU Module *)
AI_Wind.Channel:=0;
AI_Wind.Mode: = 2; (* AD_VOLT_0_10_COMMON *)AI_Wind_Speed: = TO_USINT (ValueScale (AI_Wind.Value, 0.0, 10.0, 0.0 30.0)); (* Scaling 0-10Volt to 0-30 m / s *)
But going online the channel returns zero (no bit of fault) while we are talking about 2V .. where am I wrong?
July 10, 2018 at 12: 02 pm #45113Sergio BertanaAdministrator ForumThe mistake is that you instantiate the FB, parameterize it, use its value, but do not do it... You have to add after the parameterization:
AI_Wind (); (* Perform analog value acquisition *)
March 30, 2020 at 7: 33 pm #54364Alexander NaplesParticipantSorry I'm a beginner, I have to acquire a 0-10V analog signal on a CPU Slimline MPS053 using a piezoelectric sensor to measure vibrations. How should I do?
And also how can I view the trend of the acquired signal?
March 30, 2020 at 7: 45 pm #54366Sergio BertanaAdministrator ForumTo acquire the analog signal as written in the previous posts you must use the FB SysGetAnInp, defining as a way of acquisition AD_VOLT_0_10_COMMON.
I don't understand the second part of the question, what do you mean by visualizing its trend ... you can visualize it graphically using the LogicLab oscilloscope utility (THU an example of use).
You can place it in a variable accessible from Modbus and use an HMI panel to display it in numerical and / or graphic form (See post).
You can follow this article and display the signal trend in a browser-managed oscilloscope.
March 31, 2020 at 1: 08 pm #54382Alexander NaplesParticipantAs an acquisition method for an analogue signal in mV I must always use AD_VOLT_0_10_COMMON ?
March 31, 2020 at 1: 15 pm #54389Sergio BertanaAdministrator ForumThe CPU module MPS053 that you have only manages 0-10 volt inputs in a common way, different speech if you had a module available analog acquisition, this module has an A / D converter with many acquisition possibilities.
In the meantime, it manages the differential acquisition which allows to limit crosstalk disturbances on the acquired signal, and in the configuration with 1 Volt full scale it can acquire with a resolution of 1.577uV. While the CPU module has a resolution of 9.7mV (More than 6000 times lower).
-
AuthorPost
- You must be logged in to reply to this topic.