toddster900
Member
Hi All
I have recently had cause to start using Unity Pro but am still struggling with it a bit. I a trying to convert a speed reference for a drive being controlled over coms from a DINT to 4 BYTEs. I have managed to do it as follows.
(*Speed Setpoint*)
DINT_AS_WORD (IN := SV001_DB.Drv_SP,
LOW => Delete_SP1,
HIGH => Delete_SP2);
WORD_AS_BYTE (IN := Delete_SP1,
LOW => SVD001.Outputs.Free1[4],
HIGH => SVD001.Outputs.Free1[5]);
WORD_AS_BYTE (IN := Delete_SP2,
LOW => SVD001.Outputs.Free1[6],
HIGH => SVD001.Outputs.Free1[7]);
However, this required me to create two additional tags every time I want to do this. "Delete_SP1" and "Delete_SP2". Is there a way I can achieve this without creating any additional tags.
ST is also not my preferred language but I can see the benefits in it at times and am trying to improve my understanding and use of the language.
Thanks
I have recently had cause to start using Unity Pro but am still struggling with it a bit. I a trying to convert a speed reference for a drive being controlled over coms from a DINT to 4 BYTEs. I have managed to do it as follows.
(*Speed Setpoint*)
DINT_AS_WORD (IN := SV001_DB.Drv_SP,
LOW => Delete_SP1,
HIGH => Delete_SP2);
WORD_AS_BYTE (IN := Delete_SP1,
LOW => SVD001.Outputs.Free1[4],
HIGH => SVD001.Outputs.Free1[5]);
WORD_AS_BYTE (IN := Delete_SP2,
LOW => SVD001.Outputs.Free1[6],
HIGH => SVD001.Outputs.Free1[7]);
However, this required me to create two additional tags every time I want to do this. "Delete_SP1" and "Delete_SP2". Is there a way I can achieve this without creating any additional tags.
ST is also not my preferred language but I can see the benefits in it at times and am trying to improve my understanding and use of the language.
Thanks