LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

change settings of view variable value

Solved!
Go to solution

Hello,

 

I want to know if it's possible to change the settings of the debugger, especially the display settings of the "view variable values" in labwindows cvi 9.0.

My problem is that in my project it is crucial to be able to debug and I came across some difficulities using array of structs containig pointers to structs. So I made a demo project to demonstrate:

 

typedef struct {
 short sVar1;
 short sVar2;
 char cVar1[512];
}MyStruct2;

 

typedef struct {
 MyStruct2 ReadMyS2;
 MyStruct2 WriteMyS2;
 MyStruct2* pReadMyS2;
 MyStruct2* pWriteMyS2;
}MyStruct1;

 

int main()

{

 MyStruct1 MyS1_Phis[3]={0};
 int i = 0;

 // init
 
 for(i=0;i<3;i++)
 {

  MyS1_Phis[i].pReadMyS2 = &MyS1_Phis[i].ReadMyS2;     

  MyS1_Phis[i].pWriteMyS2 = &MyS1_Phis[i].WriteMyS2;
 }

}

Most unfortunately the debugger handles the MyS1_Phis[0].pReadMyS2 pointer as if it's pointing to an array of 10 MyStruct2 type elements.

Does anyone know the reason for that?

Thanks in advance,

Laszlo Nagy

0 Kudos
Message 1 of 3
(3,195 Views)
Solution
Accepted by topic author NagyLas

Hi Laszlo,

 

Yes, this is a known issue in CVI. This can happen because of the way the CVI user protection is implemented. It's definitely undesirable, but we probably won't be able to change this for at least another year or two.

 

One workaround you have is to disable user protection and then rebuild your program (Options>>Build Options>>Debugging Level: No run-time checking)

 

Luis

0 Kudos
Message 2 of 3
(3,163 Views)

Hello Luis,

 

Thanks for the solution.

Best regards,

 

Laszlo

0 Kudos
Message 3 of 3
(3,133 Views)