Schneider Modicon M241 and SoMachine v4.1

HamzaSA

Member
Join Date
Aug 2017
Location
Sarajevo
Posts
34
Hello everyone,

I just stumbled upon this site and it looks really interesting! This is my first post here.

I have never programmed PLCs before, therefore I am a complete beginner but I'm a quick learner. My first task is programming a m241 with ht eSoMachine v4.1 software. I have added the devices that will be used and made the majority of my POU.

However, I am confused with the memory mapping. I understand data types (bits, bytes, words, dwords etc) and I understand that the syntax is %MX, %MB etc. But from where can I start allocating memory? From what I understand there is also system reserved memory so it probably has a portion of memory reserved (bear in mind that I still haven't been able to read the entire self-service manual).

For example, I am measuring temperature over a sensor which is conncted to the analog input. I want to store that data inside a virtual variable so it can be accessed remotely.

Also, function block instancing isn't completely clear to me. I made a function block which receives an INT from the sensor and converts it to REAL. When I insert the block inside POU, I get "???" over it. I don't understand what this "???" means or how I should remove it.

I realise I have a lot of knowledge gaps with PLC programming and I am grateful for any help you can provide.

Thanks in advance,
Tarik
 
You don't have to allocate any addresses to the variables. It will allocated memory space automatically. The only reason that you may choose to manually assign a address such as %MW100 is so that you can communicate to the PLC with an HMI using Modbus.

Read up on CoDeSys - SoMachine is a just a different front end for the standard CoDeSys programming software.
 
Hello everyone,

I just stumbled upon this site and it looks really interesting! This is my first post here.

I have never programmed PLCs before, therefore I am a complete beginner but I'm a quick learner. My first task is programming a m241 with ht eSoMachine v4.1 software. I have added the devices that will be used and made the majority of my POU.

However, I am confused with the memory mapping. I understand data types (bits, bytes, words, dwords etc) and I understand that the syntax is %MX, %MB etc. But from where can I start allocating memory? From what I understand there is also system reserved memory so it probably has a portion of memory reserved (bear in mind that I still haven't been able to read the entire self-service manual).

For example, I am measuring temperature over a sensor which is conncted to the analog input. I want to store that data inside a virtual variable so it can be accessed remotely.

Also, function block instancing isn't completely clear to me. I made a function block which receives an INT from the sensor and converts it to REAL. When I insert the block inside POU, I get "???" over it. I don't understand what this "???" means or how I should remove it.

I realise I have a lot of knowledge gaps with PLC programming and I am grateful for any help you can provide.

Thanks in advance,
Tarik
Hi,

You don't need a function block for INT_TO_REAL.

Just type INT_TO_REAL (it's a type conversion operator).

In SoMachine -> Help -> SoMachine programming guide -> Programming reference -> Operators -> Type conversion operators.

For an understanding on what a function block is SoMachine programming guide -> Program -> Program components -> Function block


Hope this helps.

Thanks.
 
That's exactly why I want to give it an address kitty. After some testing, I realised I can even assign %MD0 for REAL values because it doesn't seem to be reserved, but just to be sure I'll start my memeory allocation from %MD100

Engineer_MG, I realise there is that block, but I want I wanna make a FB that will convert the INT value from Ni1000 sensor to REAL then divide it by 10 to get the actual temperature which I will use to display etc. I wanna make a FB to do it, and not use INT_TO_REAL in series with a DIVIDE block.
 
Create a function

- You can create a FUNCTION to encompass your equation(not Function block).
- Please check attached images as an example
- A function has one return type and does not need to be instantiated
- Keep in mind the divisor should not be zero.
- If you create a Function block, it will need to be instantiated when calling it.

Hope this helps.
Thanks.


That's exactly why I want to give it an address kitty. After some testing, I realised I can even assign %MD0 for REAL values because it doesn't seem to be reserved, but just to be sure I'll start my memeory allocation from %MD100

Engineer_MG, I realise there is that block, but I want I wanna make a FB that will convert the INT value from Ni1000 sensor to REAL then divide it by 10 to get the actual temperature which I will use to display etc. I wanna make a FB to do it, and not use INT_TO_REAL in series with a DIVIDE block.

FUNCTION_1.jpg FUNCTION_Call.jpg
 
Ok, I figured it out.

Another question, what is the best way of controlling a three-way valve? I thought about implemention a PID controller, but couldn't find a 3-state one in SoMachine, only continious.

For controlling the valve, I only have 2 BO's available, for opening and closing.
 
Ok, I figured it out.

Another question, what is the best way of controlling a three-way valve? I thought about implemention a PID controller, but couldn't find a 3-state one in SoMachine, only continious.

For controlling the valve, I only have 2 BO's available, for opening and closing.
Look into OSCAT.de. The OSCAT libraries can be installed in SoMachine.

http://www.oscat.de/component/jdownloads/send/5-oscat-building/27-oscat-building100-en.html?Itemid=0

They have some cool function blocks (Maybe you can use the Actuator_3P from the OSCAT building library if that's what you are looking for).

Thanks.
 

Similar Topics

Everything was working fine, but suddenly CPU went into error mode, and the ERR and TER LEDs lit up. Now I can't download or connect with the PLC...
Replies
0
Views
46
I have an old PLC (circa 2007) consisting of Telemecanique/Modicon/Schneider Electric devices. The system has developed errors and unfortunately...
Replies
2
Views
241
Hey all, I do not have the original source code of a Modicon M172 PLC (HVAC PLC). I want to modify some of the code but read you cant upload...
Replies
2
Views
347
Hi, I have an older Kohler Generator/ATS controller that has a Schneider Electric (Modicon) Momentum PLC and has a Advantech HMI. I assume this...
Replies
3
Views
713
Hello, I'm having a hard time understanding how to get a Modicon M340 to pull a Modbus address from an ABB Totalflow via Ethernet. I set up a port...
Replies
5
Views
1,158
Back
Top Bottom