Hello, I have a modbus tcp communication for an inverter and i need to convert an U32 (unsigned double word) to a string that reports the states of the Inverter, for example: Error, Off, Ok, Warning....Do you know a logic to do it with function blocks??
Answer this question Follow
Voted best answer
It is not an issue with Modbus TCP/IP communication, it is just a matter of how you are configuring your IEC61131 application logic.
If each bit represents one state for eg: Bit 0 - Error, Bit 1 - Off etc., then you can use Integer to Bool Conversion. If each integer value represents one state for eg: Value 0 - Error, Value 1 - Off etc., then simple If/Case statement will be the answer for you.
try this: create one variable name: report and data type string create more variables name errormsg data type strings with initial value 'error' , other offmsg and initial value 'off' etc create case with the variable u32 (cannot remember if case tool aceppt this data type u32) on every case write report:= errormsg; or report:= offmsg; report take the initial value depend of the case best regards
For AC800M there are functions like "dint_to_string" and "uint_to_string" for type casting. Observe that uint is 16 bit unsigned, string length is limited (and should be declared). There are also SIL application restrictions... Regards
Other questions needing answers
DCS in general >
Application Knowledge Store (AKS) will no longer be available after the 31 July 2021.
We are enhancing our Customer and Partner experience and will be migrating data from AKS to the new portal.
During the transition please direct your questions to:
If you are an ABB customer with a CARE Agreement you can access our Customer Portal, where you can find solutions and ask questions, and communicate directly with ABB.
If you are not an existing CARE customer with ABB please contact your local ABB sales office.
For our authorised Partners you can directly access additional support information in the Partner Portal