Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

STEP-7 using timer data 3

Status
Not open for further replies.

meatstu

Electrical
Jul 17, 2009
3
Hi everyone, this is my first time using Siemens gear (STEP-7, ladder logic and CPU224) and I would appreciate any ideas anyone can offer.

Basically I have a pick-up sensing a wheel with a single tooth giving me an aprox 1Hz square wave signal with a low M/S ratio.

The frequency of this signal will vary a small amount, so I would like to use this signal to generate a variable that can be adjusted using a math function, and then applied to the PT of another timer. The timer then turns on a punch, so basically I am trying to create a speed compensation system.

So far I have the following:

1. I have used a BGN_ITIME and CAL_ITIME instructions to find my time value - a DWORD value.

2. Next I take the DWORD value, use a MULT_R instruction and multiply my time value by a coefficient, generating a new REAL value output.

3. Now I'm stuck, I've tried applying my REAL value output directly to the PT of my final TON timer but I get an error - data type is not valid for the instruction operand.

I'm guessing the data type is the wrong size for the PT input, so my question is how do I convert it? I've tried the convert instructions but none seem suitable. Anybody point me in the right direction?

Or am I going about this the wrong way, is there an easier more straight forward way?

Sorry for the long post and thanks for looking if you've got this far.
 
Replies continue below

Recommended for you

I believe it is as simple as a Load and transfer instructions. (MOV instrucion in AB)

Create data type that will be accepted by the instruction that you are trying use. Load the value you are using and transfer into the new variable.

Load REAL_variable
Transfer Dword_Variable
 
Yes this has done the trick with a DI_I conversion at the end.

Thanks very much for the help.
 
Thanks looks like some handy stuff.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor