How to use OPC Data Generator
contents
-
Introduction.
-
A practical example to begin.
-
How to have several different signals?
-
Summary of the item ID's (the server name space).
-
Specification.
Introduction
The OPC Data Generator provides you an arbitrary number of OPC items whose
values are generated according to a selected function, sine, ramp or white
noise.
The generated signal range is, -1 to +1.
Let's see how it works through an example.
A pratical example to begin
Connect you to the OPC Data Generator with your OPC Client and add an OPC
Group.
Add to the OPC group the following items:
Write -1 on set0.on item. Then the generator will start and the value of
set0.item0 will follow a sine function of period 1000 ms.
If you want more items whith values following the same function
you can add items of the form:
-
set0.itemY, where Y is a string that identify your item, e.g. 1, 007 or
Tomato (please, avoid the use of periods in this string)...
All the items beginning with set0.item string will have the same value,
following a sine function of period 1000ms.
Now, you may want to change the period. For this add the item,
and write the period you desire (in ms).
If you want to change the function, add the item,
and write:
-
0 to get a sine (the default function),
-
1 to get a ramp,
-
2 to get noise (random numbers between -1 and 1).
If you want to stop the signal generation and put all the values of the
items begining with set0.item string to 0, write 0 on set0.on.
How to have several different signals?
Now you have several items generating a sine (or ramp or noise) function
of a given period. All these items have the same value at a given time.
Let's consider you want to have another set of items with a different
period or function. For that, you have just to redo the previous process
by replacing set0 with set1 (or set following by any number between 1 and
1024 - 1 ).
Summary of the item ID's (the server name space)
-
setX.on, where X is the number of the signal genrator, 0<X<1024
, switch of the signal generator X (0 for OFF, -1 for ON).
-
setX.fct, where X is the number of the signal genrator, 0<X<1024
, function of the signal generator X.
-
0 for sine
-
1 for ramp
-
2 for noise
-
setX.period, where X is the number of the signal genrator, 0<X<1024
, function period of the signal generator X.
-
setX.T0, where X is the number of the signal genrator, 0<X<1024
, function initial time of the signal generator X.
-
e.g. for a sine function, the signal time function will be:
s(t)=sine(2*pi*(t-T0)/period)
-
setX.itemY, where X is the number of the signal generator and Y
is a character string (avoid periods), item from where you get the generated
signal.
Specification
functions: sine (identifier: 0), ramp (identifier: 1), noise (identifier:
2)
signal range: [-1;+1]
period unit: ms
internal signal sampling: 10 ms. (the signal values are generated
every 10 ms)