nicepal Posted April 3, 2019 Report Posted April 3, 2019 I have this issue. working on Omron's CJ2M. String received can be +4.24737E-03 or +2.17737E+01 Somehow, the structure text function does not have STRING_TO_REAL. We need to extract some readings from a Meter and do some value comparison in the PLC to set the passing range. Any advise I can get from personnel here?
Mendon Systems Posted April 3, 2019 Report Posted April 3, 2019 The FVAL(449) instruction should do wat you are looking for.
nicepal Posted April 5, 2019 Author Report Posted April 5, 2019 Seems the FVAL is in the Ladder format. Under Structure Text, like don't have direct. Anyway, I have work around this by extracting the Integer part to a DINT -> Real, the Decimal part to another DINT -> Real -> Convert into Decimal value. Add them together. Then check if it is E+ or E-, and Multiply or Divide according to the E number.
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