Technical Forum

STEP 7 (TIA Portal)

How to sent packet data (>4 Bytes).?

Thread Starter: khairul   Started: 8/18/2011 8:59 AM   Replies: 3

« Previous thread Next thread »
Page 1 of 1 (4 items)
  8/18/2011, 8:59 AM
Joined 6/22/2011
Last visit: 9/27/2014
Posts: 34
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Hi everyone..
i would like to ask about packet data.
currently i'm able to send/received 4Bytes using the "DWORD".

what i want to do is to send/received some packet data which is more than 4 Bytes.
for example,
i want to send this data : "4D 53 43 6C 20 56 31 2E 30 30 30 31 0D 0A".
and after that,
i will received some data like this : "49 30 0D".

How can i send/received that..?

Thanks you.
Top
  8/18/2011, 1:26 PM
Joined 3/14/2008
Last visit: 8/10/2014
Posts: 111
Rating:
Rated: Excellent [4.07 out of 5 / rated 14 time(s)]. (14) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
If it is a memory location you can do the following as an example.
To send MD100, MD104, and MD108 you could use P#M100.0 DWord 3 or P#M100.0 byte 12.

f it is in a DB then you could set up an array of DWords (example Array [1 .. 100] of DWord) and then use the LEN input to determine how many DWrods are being sent.

Are you sending the data with TBlocks or point to point?
Top
  8/26/2011, 5:13 AM
Joined 6/22/2011
Last visit: 9/27/2014
Posts: 34
Rating:
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
i'm using the PTP.

I already succes to send the data using the block,
and now i would like to send the data step by step.

for example:

1. when the plc is startup, i will send command "26 45 30 0D" to some software.
2. after that, the software will reply with "0D 0A".
3. i need to compare the byte that received from software.
4. if it same, it will send command "40 30 0D", and the software will reply it back.
5. the sequence will go on.
6. the data that send must be in 1 packet only, it should not repeat sending the data.

how can i do that..?


Top
  8/26/2011, 10:41 AM
Joined 1/17/2007
Last visit: 10/29/2014
Posts: 1016
Rating:
Rated: Excellent [4.42 out of 5 / rated 218 time(s)]. (218) 
Rated: no ratings [0 out of 5 / rated 0 time(s)]. (0) 
What functions / CP / interface are you using to send the data?

Programming today is the race between software engineers building bigger and better idiot proof programs, and the universe producing bigger and better idiots.

So far, the universe is winning...
Top
Page 1 of 1 (4 items)
Actions