Schneider M221, SoMachine Basic, Memory locations.

Edmhydraulics

Member
Join Date
Apr 2014
Location
Beaumont
Posts
173
Hi again all, wondering if someone can help me. I have a programming running on an M221 PLC and I want to capture some analog data to a series of MEmory Word locations. Let's say from %MW0 - %MW600 based on a Timer value. Instead of writing out comparators for each memory location like %TV0.V = 1 then an operator like %MW1 := %IW1.0, %MW2 := %IW1.0, Etc.

Is there a way to use the Timer value to automatically increment the MW locations from 0-600.
Example: %MW(TV0.V):=%IW1.0. ???
 
Not sure about somachine, but in unity I would
make an array called my_array of INT 0..601 at %MW0, it will then occupy all memory to %MW600
the timer value is a TIME, use TIME_TO_REAL, divide by the number of milliseconds in the time-increment between memory addresses, then convert that to an INT called my_index, then
my_index:=max(0,min(600,my_index)); // avoid out of bounds errors
my_array[my_index] := %IW1.0;
 
So does anyone work for Schneider out there? they make a great product and good software (I have only used SoMachine Basic) but we need help on instructions, I do see that im not the only one that cant find much on more than just the 'basic' instructions... im sure they would sell a lot more if they had some good manuals :cool:
 
I see there is a ROL_Arr and ROR_Arr
Maybe easier to use this than manually writing to each word. There is explanations of this function in the help file
 
You need indexed object, look from help file.



on operator blocks:

%TM0.p:=600, %TM0 is with 1s timebase (or 100ms if you want 60s time)

%MW1000 :=%TM0.V (%MW1000 is index used later)

%MW1000>=599 -> %MW1000:=599 or reset timer etc.

and for copying to different memory ares use syntax:

%MW0[%MW1000]:=%IW1.0 (copying %IW1.0 to memory areas %MW0...%MW599
 
This is little bit differently. It also makes averege of collected data afterwards (average is updated after 60 seconds)

Another method to average is with looping data = 60 or 600 operator blocks without loop.
On M221 Looping is possible with network labels
 

Similar Topics

Hi all, I've been trying to develop modbus rtu program between uv balasts and plc ı'have 6 slave balast.I am reading fault run voltages etc...
Replies
0
Views
1,200
Hello! I am new at PLC programming. I am using TM221CE16R PLC with TM3AI8 analog input module and SoMachine Basic v1.6. I am trying to scale...
Replies
8
Views
7,076
Hello, I need to access the bits from the fire system control panel through RS-485. So, I used Read Var block to read from the panel...
Replies
0
Views
199
Hi, I am stuck with these SE cartridges, I am trying to add a second serial port rs485 to a M221 PLC. What is the difference between TMC2CONV01...
Replies
1
Views
121
I am using a M221 PLC (TM221CE24R) which provides me 1 Rs485 port, which I am already using to communicate with a sensor (Rs485/Modbus). My...
Replies
1
Views
749
Back
Top Bottom