MartyB Posted June 5, 2020 Report Posted June 5, 2020 I'm working on simple structured text program which takes in DWORD values, does some math on them and then outputs in DWORD type. What data type should I be using and how can I make this work? This is one of the lines from the code(everything DWORD) and I get 'operator not supported by DWORD data type' XPos3 := XPos1 + (2*XIncrement);
Michael Walsh Posted June 5, 2020 Report Posted June 5, 2020 DWORD is a hex format, generic for a double channel. I assume these are integers, so you would want the data types to be DINTs (signed) or UDINTs (Unsigned). I would recommend that you make them DINTs or UDINTs from the get go though (Therefore no conversion instructions). Unless there is a specific reason they need to be DWORDs....
MartyB Posted June 8, 2020 Author Report Posted June 8, 2020 Thank you for the advice. I just had to convert the data type to DINT and then convert back. Couldn't change variable data type from the get go since I'm receiving and sending them through the network and the receiving device specifies all data has to be in DWORD.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now