read special variables (pressure, temperature, ...) from tcp raw data stream

hassanayoub85

Member
Join Date
May 2013
Location
Texas
Posts
33
Dear,

My problem is how to read special variables (pressure, temperature, ...) from tcp raw data stream generated each 100 milliseconds and use them.

And in details:
I have an arduino board whih is sending datas: pressure, airspeed, internal temperature, external temperature as (p: 1.1111, a: 2.2222, i: 3.3333, e: 4.4444) each 100 milli seconds through tcp/ip.
From terminal, i connect to arduino ip:port, ansd i see the data, each data on a new line.

From my PLC S7-1200, I am trying to read the dataand parse them using T_RCV ladder block.
The data are comming to the datablock db1.data (string), but the problem is that the data each time is refreshed it get randomly part of the data like:
1- p: 1.11
2- 33, e: 4.444
3- 1.111, a: 2.222, i:
and so on.

1- How can I make the data come like in terminal exactly?
So always, the db1.data
[0] = p
[1] = :
[2] = {space}
[3] = 1 (or other number generated by arduino)
etc...?

2- How can I control the refresh time of the T-RCV?

3- can I make T_RCV start recieve data on special charactyer till another special character? or an exact amount of characters like 33?

4- How can I put the recieved data of pressure (1.1111) which are on db1.data[3] to db1.data[8] in a plc tag?

5- after putting the datas (1.1111) on a tag, how to convert it to float again, to be able to multiply by a number?

Thanks in advaanced.
 

Similar Topics

Hi, The hardware is: Click Plc model # CO-O1DD1-O HMI model # S3ML-R magnetic-inductive flow meter model # FMM100-1001. I will set the flow meter...
Replies
4
Views
115
Is there a way to use the FAL instruction to do +=2 instead of +=1? I have an array that is organized with alternating "data" and "flag" values...
Replies
5
Views
123
Hi everyone i have a customer, who wants to show an alarm on the machine, if the I/O forces are enabled and set, on at ControlLogix L81E with...
Replies
3
Views
227
Hi Iam using monitouch hmi(V9 soft) with omron plc cj2m (CX programmer). In this I want to read a data from hmi to plc. The data was like...
Replies
0
Views
93
Hi everyone. Quick questions. On UnityPro, I want to open and quickly read tags from a .STA files witouth opening the program. I have 30 plc...
Replies
2
Views
129
Back
Top Bottom