SoMachine Basic Modbus Function Block Help

JohnB315

Member
Join Date
Oct 2018
Location
Bally
Posts
3
Hi all, I have a HACH sc200 controller with 2 sensors which I hope to connect an M221 plc to via Modbus RS485 in order to display the info on a HMI.
I am completely new to this and I am struggling to get my head around it.
I am struggling to understand how to set up the Read_Var function block to access the registers in the HACH.

For example, in the HACH manual some of the registers are:

Register# 40001, Data Type Integer, Length 1, Description Sensor meas.
Register# 40005, Data Type Float, Length 2, Description SensorTemp Meas.
Register# 40007, Data Type String, Length 6, Description Sensor Name.

How does this correspond to the options available in the Read_Var function block ?
The options are :
ObjType- 0 Read Multiple Words- Modbus 0x03
1 Read Multiple Bits - Modbus 0x02
2 Read Multiple Bits - Modbus 0x01
4 Read Multiple Words - Modbus 0x04
FirstObj -
Quantity -
IndexData-

I assume I need a Read_Var FB for each individual register ?

Any help to send me in the right direction would be greatly appreciated

John
 
http://www.plctalk.net/qanda/showthread.php?t=99112
The above thread may help you out.

For example, in the HACH manual some of the registers are:

Register# 40001, Data Type Integer, Length 1, Description Sensor meas.
Register# 40005, Data Type Float, Length 2, Description SensorTemp Meas.
Register# 40007, Data Type String, Length 6, Description Sensor Name.

The registers will show you the length and location. In order to read more than 1 word at a time use:
4 Read Multiple Words - Modbus 0x04

Here are a couple of good links on Modbus RTU:
https://www.rtaautomation.com/technologies/modbus-rtu/
http://www.simplymodbus.ca/FAQ.htm

I hope that this helps you out.
Regards,
 
http://www.plctalk.net/qanda/showthread.php?t=99112
The above thread may help you out.



The registers will show you the length and location. In order to read more than 1 word at a time use:
4 Read Multiple Words - Modbus 0x04

Here are a couple of good links on Modbus RTU:
https://www.rtaautomation.com/technologies/modbus-rtu/
http://www.simplymodbus.ca/FAQ.htm

I hope that this helps you out.
Regards,

Afraid this is wrong. Modbus Function code FC03 will read the 40000's, FC04 will read the 30000's

As an aside, from the SoMachine posts I've seen around here recently, I think we can agree it looks like it's garbage. How Schneider can ruin Codesys is beyond me, but they seem to have managed it.
 
Afraid this is wrong. Modbus Function code FC03 will read the 40000's, FC04 will read the 30000's

As an aside, from the SoMachine posts I've seen around here recently, I think we can agree it looks like it's garbage. How Schneider can ruin Codesys is beyond me, but they seem to have managed it.

This post is regarding Somachine basic... Nothing to do with Codesys.
And the times I did use somachine it was basically codesys with a small amount of tweaks to it. 99% is codesys
 

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,196
Hi All, I am a newbie to Modbus tcp communication, and need some directions in this regard. I have TMCE221CE16R with SoMachine Basic as my...
Replies
9
Views
5,454
Hi, Does anyone have any examples on how to use the Modbus IO Scanner on the Schneider M221 controller? I have one on test bench with a Delta...
Replies
4
Views
5,974
Hi all I tried to piggyback onto the back of an old thread, but I think I need to ask for help on here. I am trying to get two M221 plcs to...
Replies
5
Views
4,724
hello eveyrone I want to make an application with M221 PLC in SOMACHINE BASIC program. I request your valuable help. I have a 50 ms pulse...
Replies
1
Views
1,603
Back
Top Bottom