So Machine Basic reset coils

lesmar96

Lifetime Supporting Member
Join Date
May 2017
Location
PA
Posts
520
I am programming in SoMachine basic with a M221 plc. I've ran into this issue twice recently. Don't recall ever running into it before, so I am not sure If I need to do something different.

I am using set and reset coils. At the beginning of the cycle it sets a bit on, and at the end of the cycle it resets the bit. Thus I have a bit that is true the whole way through the cycle to signal the rest of the program.

The deal is that when I power down the plc and repower it, the coils still show as set in the program. So when i power up the plc, certain parts of the program kick in like the cycle is on, when it really isn't, just that the coil was set when the plc powered down and so it is still set.

Is there anyway around this? Am I missing something simple? Upon first scan, I could reset every coil, but that seems lame. Is there any sort of reset all?

Waiting to here your suggestions.
 


%s13
---| |--------------------------------------------%m0:16 :=0
|
%m16:16:=0



I'm sorry. I don't quite understand this logic. %S13 is the first scan bit I know, but what all are you setting to 0? Thanks for explaining to us who are still learning!
 
%M0:16 transfer value 0 from integer side to bits %M0,M1..%M15 (16 consecutive bits string of address %M0)

You can of course use 16 times different reset coils for %M0..%M15, but this is more efficient and quicker to code ;)
You can use command eveywhere on bits side, start address only needs to be diviable with 16 (8 maybe also works, because you can also use at least %Mx:8 command)
 

Similar Topics

Hey Programmers, Heres todays puzzle I was trying to solve... I have a Modbus TCP network with two Modicon M221 controllers live on my work bench...
Replies
0
Views
441
In the last two months I have had an issue after making some online changes between the software and an Schneider M221 PLC via ethernet network...
Replies
0
Views
1,061
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,155
Hello Everyone, Is there a procedure in the Schneider EcoStructure Machne Basic program to save the controllers runtime memory word data (ie...
Replies
4
Views
2,301
Hello, I am using Machine expert - basic with an M221 PLC. I have two 16 bit modbus registers coming in and I want to convert to a 32bit real...
Replies
8
Views
3,737
Back
Top Bottom