Author Topic: Constant Real Value  (Read 10628 times)

Offline LBee11

  • PLUS+1 Developer
  • ***
  • Posts: 26
  • Karma: +1/-0
Constant Real Value
« on: September 08, 2016, 01:12:08 PM »
Hi All,

I'm new to the PLUS+1 Guide software and am struggling with how to provide a constant Real value. I'm trying to use a Multi-Character constant but when I put the value of "32.5" in, there is not a value type that will accept decimal places?

Am I missing something? I'm sure a Constant Real value is achievable!

Thanks

Offline FStelzer

  • PLUS+1 Expert
  • ****
  • Posts: 50
  • Karma: +8/-0
Re: Constant Real Value
« Reply #1 on: September 08, 2016, 03:33:58 PM »
Hello,

as far as I know is there no possibility to define a constant real value.

You have to multiple your value with 10 to get "decimal" places.

Regards,
FStelzer

Offline oiltronic

  • PLUS+1 Guru
  • *****
  • Posts: 170
  • Karma: +15/-0
Re: Constant Real Value
« Reply #2 on: September 08, 2016, 09:43:07 PM »
Welcome to Danfoss Land, Alvxx1.  When it comes to numbers Plus+1 GUIDE only does integer values: 8, 16 or 32-bits wide, signed or unsigned.  You'll need to scale all values as FSelzer said.  Because of this, I add a suffix to all my variable names that indicates the units, for example "EE_MaxCylSpeed_pctx100" for the typical hundredths of a percent values scaled up to an integer, or "CP_LeftPressure_mV" for millivolts.

Offline Nilla

  • PLUS+1 Guru
  • *****
  • Posts: 253
  • Karma: +14/-0
Re: Constant Real Value
« Reply #3 on: September 09, 2016, 08:06:18 AM »
Hi all!

Floating point data types REAL and LREAL are available in the PLC editor of GUIDE.
In GUIDE graphical code there is no possibility to create floating point constants, although floating point variables can be routed through GUIDE graphical code from one PLC POU to another.

Best regards
Nilla
PLUS+1 Helpdesk team

Offline FluidPowerTom

  • PLUS+1 Guru
  • *****
  • Posts: 363
  • Karma: +33/-0
Re: Constant Real Value
« Reply #4 on: September 12, 2016, 05:52:38 PM »
The Structured Text POU's in GUIDE is what I go to when I need floating point.
Controls Engineer
Hydra-Power Systems