JohnB315
MrPLC Member-
Content count
4 -
Joined
-
Last visited
Content Type
Profiles
Forums
Downloads
Calendar
Everything posted by JohnB315
-
SoMachine Basic Modbus Read_Var help
JohnB315 posted a topic in Modicon / Telemecanique / Schneider Electric
Hi guys, I have an M221 and trying to read process data from a HACH controller via Modbus 485. In the Read_Var function block I need to configure ObjType, FirstObj, Quantity and IndexData. Slave ID is 3 and I am using SL2. So, say if I wanted to read to following registers, Register #40001, Data Type Integer, Length 1, Description- Sensor Measure Register #40005, Data Type Float, Length 2, Description - Sensor Temp Register #40007, Data Type String, Length 6, Description - Sensor Name what do I put into the Read_Var function ? I am completely new to this and it's just not clear to me. Thanks John- 7 replies
-
- somachine basic
- m221
-
(and 1 more)
Tagged with:
-
SoMachine Basic Modbus Read_Var help
JohnB315 replied to JohnB315's topic in Modicon / Telemecanique / Schneider Electric
Thanks cHud. So, a little update, I have managed to figure out how to display any floating point variable. Take Register #40005, Float, Length 2, according to slave's Modbus map. First, the ObjType is 0 - to access the 4xxxx registers like Wasan said. Then, in my case #40005 - sensor temp. I needed to offset by -1, so FirstObj will be 4. Quantity - the no. of %MW needed, 2 in this case, I used %MW0 and %MW1, IndexData is the starting point, %MW0 Now, I finally realised I need to look at the value of both memory locations combined, either a double or floating word, %MD or %MF %MF0/%MD0 = %MW0 + %MW1, ----- %MF1/%MD1 = %MW1 + %MW2 %MF2/%MD2 = %MW2 + %MW3 ---- %MF3/%MD3 = %MW3 + %MW4 etc. %MFx or %MDx = %MWx + %MW(x+1) All I need to do is put the corresponding %MF in the animation table and boom....there's the sensor reading. Following on from that, can anyone tell me what to do with Register #40007, Data Type String, Length 6 ? -
SoMachine Basic Modbus Read_Var help
JohnB315 replied to JohnB315's topic in Modicon / Telemecanique / Schneider Electric
Thanks cHud -
SoMachine Basic Modbus Read_Var help
JohnB315 replied to JohnB315's topic in Modicon / Telemecanique / Schneider Electric
Thank you Wasan, I couldn't have asked for a better explanation. It worked but I had to offset the address by -1 (40001 = 0, 40002 = 1 etc.) to get a response otherwise it will return an error. Now, the next stage of my confusion, the value in the %MW I get back is random, anything from -322xx to +20000 or 30000. I was expecting something in line with the actual sensor measurement (pH), or do I need to scale it like a mA value ? If so could you please tell me the steps involved ? Also, is there a simple way to view what value is in a %MW while I am online during testing in somachine basic?