S7 1200 DB to store a bit

Join Date
Nov 2011
Location
Ireland
Posts
182
Hello,

I have a signal from a switch on my PLC. The signal is either 1 or 0. i want to store the current value of the switch in a DB block.

I have currently set up a DB to store a DWord and it works fine. However when i set up a new DB to store the switch signal i was not successful. Do i use the data type as "Bool" in the DB block?

Also I cannot use a MOVE block to move the 1 or 0 signal to the DB? Any help would be much appreciated
 
Yes to store the state of a bit, you need a bool data type in the DB.
A MOV is used to a move a byte, word or dword not a bit. To move a bit use the bit level instructions.
 
You might want to look at using M memory rather than DB memory for 'bit' signals. Then you won't need a 'Move' instruction you will just to a contact to operate a coil. The lower values in M memory can be made retentive if needed.
 

Similar Topics

I'm trying to figure out a way to store real numbers in Micrologix 1200. The LIFO & FIFO instructions won't allow me to use Floating values so I'm...
Replies
15
Views
3,822
Hello, dose anyone know how I could store a value from a HSC for a short period of time e.g 60sec and then use this value for a calculation Also...
Replies
2
Views
2,430
Hello, I have a question about an encoder that has absolute measurement. Specifically, it's the Lika SMA5, which I would like to connect...
Replies
2
Views
49
Hello, I have a question about an encoder that has absolute measurement. Specifically, it's the Lika SMA5, which I would like to connect...
Replies
0
Views
30
Hi all, Currently having trouble getting a speed reference to write over modbus to an Omron M1... I can successfully write a run command and...
Replies
6
Views
264
Back
Top Bottom