transfer data in PLC (programming question)

pavel47

Member
Join Date
Jul 2005
Location
Lausanne
Posts
20
Hello

I want to transfet binary data from PLC outputs
to DWORD data block.
Then, DWORD data block I read in PC (Cimplicity).
The acceptable format for DWORD data block in Cimplicity is:

DB<datablocknumber>.DBD<index>

To transfer value of output A12.0
to bit0 of a byte DB3.DBX1 I use:

U A12.0
= DB3.DBX1.0

But how to transfer A12.0 to bit0 of DWORD DB3.DBD1?

Thank you in advance.

Pavel.
 
You have just done it.... well almost?
even if you a bit (dbx) or byte dbb or word dbw or double dbd setting bit 0 on a word then loading the word the least significant bit will reflect the output A12.0, however if you want to use double words then reverse the words
so
A A12.0
= DB3.dbx2.0 (a double DBD1 contains Dw1 & dw2)
also if you want to transfer a block of 8 or 16 outputs to a byte or word then
either.....
A A12.0
= Db3.dbx1.0
A A12.1
= DB3.dbx1.1
.... and so on
Note if you structure your DB as double words then in the code it will only display without symbolic info.
or
L QW 12
T db3.dbw1
etc.
 
This would also depend on how many bits you could address within the word... for instance in S7 you address the words:
DW0
DW2
DW4 etc

DW0 consists of DBB0 and DBB1

So, a double word eg. DB3.DBD1
Would consist of words..
DB3.DBW1 and DB3.DBW3

Or Bytes
DB3.DBB1 and DB3.DBB2 and DB3.DBB3 and DB3.DBB4

So the least significant bit would be DB3.DBX4.0

Hope this makes sense cos I think I've just confused myself...
:))
 
Just a quick note, although it's possible to do it, it's not generally regarded as good practice to address WORDs and DWORDs by odd addresses such as DB3.DBD1. It's safer to stick to using even addresses for them.
 

Similar Topics

Hi all, I am working on a project that with need to capture force sensor data in footplates in order to determine if weight shift is occurring...
Replies
1
Views
522
Has anyone here successfully created a system where the software SAP (ERP) interfaced with an Allen-Bradley PLC? Currently we have to take recipes...
Replies
6
Views
1,120
Hello parky, goghie, Brian and all of you who kindly come to help when I get stuck. I cannot look into the clock issue that parki has written for...
Replies
5
Views
855
Hi, If we have PLCs on different subnets is it possible to do TCP comms data transfer between them? I'm assuming if we use a routing switch and...
Replies
3
Views
819
Hello folks, :) I'm new to the plc programming, and I have a question that would be great if you help in: I have a bit that goes high every time...
Replies
6
Views
2,069
Back
Top Bottom