From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

problems moving from cvi 5.5 to 2015

I am new to labWindows/cvi and have been tasked to move existing code from Windows XP (using labWindows/cvi 5.5.1) to Windows 10 (using cvi 2015). I have run into several problems including FILE pointers not passing correctly, for example with the function:

 

            short get_file_line (char *line_ptr, FILE *file_ptr)  // a function to read txt file line by line

 

the dereferenced value of file_ptr changes after passing the pointer to the function,  and the function fails to read a text file. However, by adding a third argument to the function and passing a dummy variable as in;

 

short get_file_line(char *line_ptr, FILE *file_ptr, long dummy) // a new function to read a txt file line by line

 

the deref value of file_ptr before and after passing  to the function stays the same and the function works as intended. Could this be a compiler issue?

 

Additionally, panel functionality is not working. callback functions are running (I can put printf statements in to check) but other functionality inside the callback is not. As far as I can tell (and I’m new) panel functions in the 5.5 code are the same as 2015, but I know it is a huge leap from 5.5 to 2015.

 

Any guidance or suggestions on where to look would be appreciated.

0 Kudos
Message 1 of 8
(3,744 Views)

Hello,

get_file_line does not appear to be a function included in standard CVI libraries, it has been probably developed specifically for your project (and using techniquest for variable number of arguments passed if I may add). You need to find the code associated to the function and check it about parameters passed and their usage: right-click on the function name in the code and select "Go to definition" to jump to the function code (or to the function definition if it is included in an external library).

 

Besides it, there have been several changed from 5.5 to 2015 but you're right saying that the basic framework of control callbacks has not changed over time; there may be several reasons for the code not being executed: one of them may for example be the usage of InStandaloneExecutable () which is now obsolete but could be used in 5.5 to customize a different code execution if run inside the CVI IDE or as a compiled executable; without looking at an actual code sample is difficult to guess what's happening.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 8
(3,726 Views)

Thank you Roberto for your reply. the get_file_line() is a custom function and I understand how it works, just thought it strange that the pointer would change when only 2 arguements were part of function but not when a third arguments(that is simply passed an not every used) is added to the function declaration/definition the pointer retains it's value.

 

The second part of my post was extremely vague, and I appologize for that. Does anyone know of a change logs or documentation that discusses UIR changes from one release to another?

 

I'll keep digging. Thanks.

0 Kudos
Message 3 of 8
(3,715 Views)

bwh0x20 ha scritto:

Does anyone know of a change logs or documentation that discusses UIR changes from one release to another?

 


Wow: that's an extremely long task to accomplish! I suppose the best source of information is the collection of release notes for all CVI versions you can find here.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 8
(3,713 Views)

In the list I linked you'll notice that CVI6 is missing: that release was sold at the time as a component of Measurement Studio and not as a separate program. I am attaching the Release notes for that release taken from a running install of CVI6 I still have at work Smiley Wink



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 5 of 8
(3,710 Views)

Thanks Roberto.

 

It appears that one of the main issues with my current code is in the callback functions. Apparently in 5.5 the callback functions pass the panel numbers while in 2015 callback function pass the panelHandle.

 

I made a few adjustments and panel functions are working.

 

0 Kudos
Message 6 of 8
(3,698 Views)

I don't think so!  The first parameter in panel or control callback has always been the panel Handle.  This the element that identifies An actual instance of that type in memory and permits differentiating the objects at runtime. 



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 7 of 8
(3,691 Views)

You are correct.

 

[for any one else in upgrading ] Fortuitously, in our own code our panel handles were being created sequentially in 5.5 and seem to have the same values as the panel numbers, at least the code was treating the panelHandle as the panel number without errors. This was not occuring in 2015. 

0 Kudos
Message 8 of 8
(3,640 Views)