Home > Forum > Controllers SlimLine e Netsyst (LogicLab) > Load and speed load acquisition FOR cycle execution
- This topic has 3 replies, 4 participants and was last updated 9 years, 6 months ago da Massimo.
-
AuthorPost
-
April 27, 2011 at 3: 14 pm #35001AlessandroParticipant
I was wondering if in the Slim Line PLC line there is a card to read the load cells, and if you wanted to have more technical information, type of connection, filters used, etc. since I am working on a weight scale.
Also I wanted to understand the CPU performance, for this project I have to do FOR loops, one in particular that even if optimized can reach and exceed 35000 cycles, inside the loop some addition and comparison nothing more, to be done in a few tenths second.
April 27, 2011 at 3: 23 pm #36717Sergio BertanaAdministrator ForumIl analog I / O expansion module which has differential inputs with 23-bit acquisition will soon be updated with a new firmware for the reading of strain gauge as well. Even if given the high number of bits of the convector, it is already possible to acquire the analog values in output from the measuring bridge and acquire the weight value.
As regards the filtering of the acquired weight value, it is possible to implement the filter algorithm from ST language. We have some filter examples that we can provide upon request.
As for the FOR loop, 35000 loops are quite a lot, but if it is not possible to carry out simplification algorithms, force play is to realize the required number of loops. I have created a simple ST program that executes 40000 cycles with three sums and a comparison inside, all on 32 bits variables, and the execution time is 56 mSec.
PROGRAM ST
VAR
i: UINT; {DE: "Auxiliary counter"}
AddArray: ARRAY [0..3] OF UDINT; {DE: "Adding array"}
END_VARFOR i: = 0 TO 40000 DO
AddArray [0]: = AddArray [0] + 1;
AddArray [1]: = AddArray [1] + 1;
AddArray [2]: = AddArray [2] + 1;
IF (AddArray [2] = AddArray [3]) THEN AddArray [3]: = AddArray [3] + 1; END_IF;
END_FOR;END_PROGRAM
October 7, 2014 at 4: 48 pm #38447RobertoParticipantA quick question since we should face a weighing system: I saw that the card drops to 17 bit with a sibylline (min) written next to it. How should it be interpreted?
Second question, do we cheat a bit for the sign or is it possible to use it as a unipolar using all 130 KPoints?
October 7, 2014 at 6: 02 pm #38448MassimoModeratorThe 17 bits (min) refer to the worst case which is when using GAIN = 128. For the other gains here are the various resolutions:
- AD_VIN_VREF_G_1: 19.5bit
- AD_VIN_VREF_G_2: 18.5bit
- AD_VIN_VREF_G_4: 19.0bit
- AD_VIN_VREF_G_8: 19.0bit
- AD_VIN_VREF_G_16: 18.5bit
- AD_VIN_VREF_G_32: 18.5bit
- AD_VIN_VREF_G_64: 18.0bit
- AD_VIN_VREF_G_128: 17.0bitThese are the real bits ie already removing the sign bit. Clearly the gain to choose depends on the characteristics of the strain gage. More information in this topic.
-
AuthorPost
- You must be logged in to reply to this topic.