comparator problem

dannyt

Member
Join Date
Oct 2008
Location
Brasov
Posts
4
Hi guys,

I'm trying to make a program in S7 Manager and I have an issue with a comparator.
I need to compare the int variable "C" with "3", but the comparator block doesn't allow me to insert the C variable. I've added it as a symbol but I don't know what to do in order to make the comparison.šŸ™ƒ

Can someone help me?

Thanks,
Dan.
 
dannyt said:
Hi guys,

I'm trying to make a program in S7 Manager and I have an issue with a comparator.
I need to compare the int variable "C" with "3", but the comparator block doesn't allow me to insert the C variable. I've added it as a symbol but I don't know what to do in order to make the comparison.šŸ™ƒ

Can someone help me?

Thanks,
Dan.
Are you using the "Integer" comparator to begin with?
If you don't that's your problem.
Use CMP_I= or CPM_I< and such, not sure wht you are trying to accomplish.
If you do type in your symbol as a first value and ONLY type "3" as your second value.
I do not have Step7 on this PC, going by memory.
 
Last edited:
Hi and thanks for the quick reply,

I've added a screenshot with what I'm trying to do.

"c" is already added as a counter symbol.

Basically I'm trying to see if the counter is smaller then or equal to 2.

I hope this helps.

Dan.
 
You cannot use a counter in a compare. Move the count to a temp integer and then do the comparison. Turn type checking off.

cmp0099.JPG
 
You've declared it as a word, not a counter. If you are performing arithmetic then declare it as an integer (INT). You must save the symbols file for it to take effect. When typing in a symbol name in the ladder editor, you need to put it in double quotes
 
Last edited:

Similar Topics

I am trying to help out a company who has no technical support and they are far away from my locale. We are trying to sense when a roll of paper...
Replies
4
Views
1,429
How do we decide in programming a PLC that we use comparator, timer, registers, flags, function blocks etc for any task or for any network ...
Replies
11
Views
7,477
any one can help me to write program in simatic s7. i have two rotating pulleys with with 4 pulse per turn, i want to detect and give an alarm if...
Replies
3
Views
1,898
I'm trying to learn how to use the Comparator instructions in Step 7. I made a Timer (S_ODT) and created a word for the BI output MW47 and...
Replies
7
Views
3,797
How to crate a ladder dia . To compare the temperature with the reference temp. 1. input temp. from RTD 2. Reference temperature...
Replies
2
Views
3,559
Back
Top Bottom