s7-1200 sine wave

mel_w

Member
Join Date
Sep 2006
Location
yorkshire
Posts
55
Hi
does any one have or know where I can obtain a function to generate a slow sine wave output of 4-20 ma with variable frequency and amplitude?
or any pointers on how to do it
this will be using a s7-1200 PLc
Regards
Mel
 
The 1200 has a SIN function. It should be easy enough to use the system time to turn that into a signal generator.

f = frequency
A = amplitude
t = time
p = phase offset
o = amplitude offset or bias

The general formula would be as below, although the constants change a bit depending whether you want radians or degrees.

signal = A * sin(f*t+p) + o

You'll need to do some data type conversions, but in the end you should be able to use the scaling blocks to pass the signal to your output card.

edit: for the smoothest/most regular curve, you can run this out of a cyclic OB instead of the main OB, but it should work fine either way.
 
Last edited:

Similar Topics

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
239
HI i would like to know how to get a variable that will store the amount of times a program has been executed. The issue is I have 3 DBs for 1 FB...
Replies
2
Views
77
Hi, I have attached herewith one image which our programmer has been used in S7 1500 PLC. Now we need to use the same instructions in S7 1200 PLC...
Replies
4
Views
118
commentaire communiqué siemens s7-1200 avec vfd delta ? (cablage et sur tia portal )
Replies
0
Views
124
Hi, I have a 1214 on ip 192.168.0.100. This is connected to other modules through a switch on same network. I need to connect this to a company...
Replies
1
Views
176
Back
Top Bottom