Hi
Is it possible to combine multiple signals?
For example: I have a signal for Voltage and a signal for Current and I would like to combine these two to give Power.
Is this possible?
If not is there another way in which I could produce a Power signal from the voltage and current messages?
ldbrown
Combining Signals
Re: Combining Signals
Hi,
yes thats possible with the help of a VBmacro. Here is an example:
Sub CalculatePower()
Dim voltage, current, power
Set voltage = Signals("Voltage")
Set current = Signals("Current")
Set power = Signals("Power")
If power Is Nothing Then
' Signal not found, create and initialize new one
Set power = Signals.Add("Power")
power.DataType = peDataTypeFloat
End If
While True
power.Value = voltage.Value * current.Value
Wait(10) ' Prevent 100% CPU load
Wend
End Sub
best regards
Michael
yes thats possible with the help of a VBmacro. Here is an example:
Sub CalculatePower()
Dim voltage, current, power
Set voltage = Signals("Voltage")
Set current = Signals("Current")
Set power = Signals("Power")
If power Is Nothing Then
' Signal not found, create and initialize new one
Set power = Signals.Add("Power")
power.DataType = peDataTypeFloat
End If
While True
power.Value = voltage.Value * current.Value
Wait(10) ' Prevent 100% CPU load
Wend
End Sub
best regards
Michael