LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Ini_GetStringIntoBuffer read hexa value return 0x3F if source hexa over 0x7F

Solved!
Go to solution

Hello,

 

I have a magic tricks here.

I am doing carry over of old code to a new computer.

The new computer is windows 10 LTSC 2019 with CVI2020.

 

I am trying to read a string in a ini file to get hexa values.

The ini file contains LIN frames description to be use with the NI-CAN api.

 

This is the one of the ini section that have issue:

 

[RequestStartCom]
nom = "RequestStartCom"
description = "Start the com"
ident = "\x3C"
longueur = "8"
trame = "\x05\x01\x81"
IsRemote = "\x12"

 

this is the code used to read it:

 

{
const char* const section = "RequestStartCom";
unsigned int tmp;
/*unsigned*/ char tmpident[3]={0}, tmpIsRemote[3]={0}; //init to 0
assert(Ini_GetStringIntoBuffer(iniHandle, section, "ident", tmpident,3) >= 0);
StructMessageLIN.pstrFrameStartCom->ArbitrationId = (unsigned long)(tmpident[0]);

assert(Ini_GetUInt(iniHandle, section, "longueur", &tmp) >= 0);
StructMessageLIN.pstrFrameStartCom->DataLength = tmp;

assert(Ini_GetStringIntoBuffer(iniHandle, section, "trame", (unsigned char*)StructMessageLIN.pstrFrameStartCom->Data, ‌‌ >= 0);

assert(Ini_GetStringIntoBuffer(iniHandle, section, "IsRemote", tmpIsRemote, 4) >= 0);

StructMessageLIN.pstrFrameStartCom->IsRemote = (unsigned long)(tmpIsRemote[0]); // full frame

}

 

The struct were we store the data is NI-CAN struct.

 

when i put a breakpoint on the struct i see that the byte 0x81 is transform in 0x3F. It do the same for all hexa value in all the string if we try to change the value for debug purposes.

jungledede_0-1637070259408.png

 

What i miss here ?

0 Kudos
Message 1 of 2
(1,006 Views)
Solution
Accepted by topic author jungledede

Hello Again,

 

I found a solution.

By trying with a colleague on another machine, we found that with CVI 2017 it's works.

 

I take all the inifiles sources and fp from the cvi 2017 and put them on the CVI 2020. 

Clean/rebuild later it's works as expected.

 

Maybe it is du to the encoding of the inifile, but i have try to save it in utf8 and it was the same.

The old productions machines were French windows 7 and CVI 2015 .

the new one is Polish machine in windows 10.

 

Maybe the files encoding change for this 2 country on windows.

0 Kudos
Message 2 of 2
(987 Views)