SendSignal: how to cast value of type Integer to type Real

Trying to send a real value from the process SendSignal statement, but getting the error:

0:00:00 | Error   | Positioner::ProcessExecutor::Positioner::Send Signal error: An error occurred while trying to get the value from the expression: Unable to cast value of type Integer to type Real

How to cast the value to type real?

Does changing the value to 2200.0 instead of 2200 work?

No, already tried 2200.00, f2200, 2200f, float(2000) and similar things that maybe could work.

There’s a workaround where you create a process variable of type real, then use Assign to assign a value and then in SendSignal set as value the variable, but I’d it to work directly.

I just tried, but for me it works.

If I make a real signal and try to send 1 it gives the same error:


But if I input 1.0 it works:


(using VC4.10)

(double)2200.0

https://help.visualcomponents.com/5.1/Premium/en/English/Expressions/Type_Conversion.htm

5.0 and newer versions have a minor bug that the expression field for “Value” omits the zero after decimal point. I remember reporting this problem recently. Earlier versions such as 4.10 allowed typing 2200.0, but 5.0 and newer force the 2200.0 into 2200, causing that error.