[Beremiz-devel] datatype enumeration and conversion and assignment to another type

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Beremiz-devel] datatype enumeration and conversion and assignment to another type

ASafronov
H, All!

I have:

TYPE
  MyType : (None, On, Off) := On;
END_TYPE

PROGRAM program0
  VAR_INPUT
    LocalVar0 : INT;
  END_VAR
  VAR
    LocalVar1 : MyType := On;
  END_VAR

  LocalVar1 := DutyOn;
  if Localvar1 = DutyOn then
...
  end_if;

  LocalVar0 := LocalVar1; - error: Incompatible data types for ':=' operation

Can i use equality sign ":=" enum and int?
Or is it necessary to use the conversion function?

Thanks!
-- 
С уважением,
Сафронов Александр
Инженер отдела разработки
ООО "К-СОФТ ИНЖИНИРИНГ"
Best Regards,
Safronov Aleksandr
Developer, Firmware Development Team
LLC "K-SOFT ENGINEERING"

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Beremiz-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beremiz-devel