-2

I am using the getprofileInt() function in C for CAPL scripting, but here it is not taking the variable value defined in ini file. Its taking only default value. This is my code:

int ESPV_hex,BCM1var,BCM1Hex;

Gateway_72_msgrequest()
{
  BCM1var =getProfileInt("CONFIG_SIGNAL","BCM1_ASSUEN_TEMP_UNGEF",0xFF,"SIGNALvalue_list.INI");
  write("BCM signal input value %d",BCM1var);
  write("BCM signal input value %x",BCM1var);
  Gateway_72_Dlc8.byte(7)=BCM1var;
  output(Gateway_72_Dlc8);
}

; File: SIGNALvalue_list.ini
; Contains the list of all Signals values.

[CONFIG_SIGNAL]
BCM1_Waschwasser_Sensor=10
too honest for this site
  • 12,050
  • 4
  • 30
  • 52
srb1991
  • 1,026
  • 1
  • 8
  • 14

1 Answers1

2
  • The name of the function is GetProfileInt, not getProfileInt as you have it in your code
  • GetProfileInt only takes three parameters, whereas you pass four parameters, so the signature is not compatible
  • GetProfileInt only works with the win.ini file. You might prefer using GetPrivateProfileInt which lets you specify the .ini file to use
  • If you are using GetPrivateProfileInt to specify the .ini file, you really should specify the full file path to the .ini file. Otherwise the system will only look for it in the Windows directory.
mnistic
  • 10,866
  • 2
  • 19
  • 33
  • Also `"BCM1_ASSUEN_TEMP_UNGEF"` does not exist in `SIGNALvalue_list.ini` as shown in the question in any case. – Clifford Sep 12 '18 at 10:55