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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

(Reference#3123798) Server logging application

Hello,

I have made a logging program that is communicating with a server UniDDE (7 items) with LabView 8.5. It WRITES every minute to a .csv file. After several hours it stops writing to the .csv file or it is skipping several minutes. I can not find the course of the problem? Sometimes 600 write actions an later 2653 write actions until it stops or skips. The program is running on a windows 10 machine. I am posting a picture of my VI and csv file with the missing data. Can anyone help me, please?

Download All
0 Kudos
Message 1 of 18
(2,863 Views)

You are using a lot of local variables and it wouldn't surprise me if you have a race condition somewhere that is causing your problems.  It's really difficult to debug a picture full of case structures and sequence structures, since we can't see what is happening in the other cases or sequences.

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 2 of 18
(2,830 Views)

Dear Aputman,

 

You're right. This is the VI where I am still working on.

0 Kudos
Message 3 of 18
(2,802 Views)

Hello MicV,

 

I had a look trough your VI and I am missing the Request addresses.vi, so I can't run the code myself.

I also agree with aputman that there are many cases and local variables which makes it difficult to follow the program

 

If I understand it correctly, most things happen in the "process" case and you are opening a DDE connection to UniDDE, reading a couple of values from an excel sheet, writing it to a csv and closing the connection.

If your connection is dropping out intermittently, there is most likely an error occurring inside this loop.

Unfortunately all your error wires are ending in nothing, thus I fear that all your error information, which could help us debugging is lost.

 

I think your next step should be to collect the errors in your program either by using a simple error handler.vi or better logging all occurring errors to an error log file.

 

This should allow us to understand better which component is failing and what we can do about it.

 

Andreas

Andreas
CLA, CTA
0 Kudos
Message 4 of 18
(2,789 Views)

Wow, that's a lot of local variables being used while all of your controls and indicators are sitting quietly off to the side.  I'm not sure where to start.

 

First of all, your write problem may be caused by the fact that you are writing the current time to a local variable and then almost immediately you are reading from the local variable to set the next log time.  My understanding of local variables is that in order to update them, the UI thread has to be invoked, which may not occur right away.  This is one of the symptoms of overuse of local variables rather than using the wires as the variable.  

 

currentTime.PNG

 

Next, the case structure for StartTimeSelector has both cases that appear to be identical except for the sample time has a different multiplier (or what should be a multiplier....you are using addition).  Avoid duplicating code.  If you need to use the same code in another location, put it in a subVI.  

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 5 of 18
(2,783 Views)

The solution to connect the control and indicator directly with a wire helps me a little bit. 30 crashes instead of 80 craches during the weekend logging. I am still looking for an solution. Im a running out of options lately. I also post the address VI

0 Kudos
Message 6 of 18
(2,745 Views)

Hi MicV,

 

From an outsider perspective it is very difficult to help you finding the reason for the crash with the information you provide.

Thanks for the RequestAdresses.vi, but there is still the Unitronix_Ser_DDE Request.vi missing.

 

You said the the program is crashing and I would like to repeat my question:

What do you mean by crashing? Is it the application which is crashing (like throwing an exception), are you getting a LabVIEW error or is it just stopping to log. We still don't know if it is a problem of crashing code or a connection problem.

If there is any message associated with the crash?

 

Right now we are looking blindly through your code, so it is impossible to pin down what is happening on your computer.

If I would point out everything which could be a potential issue: there are hundreds of variables, each one being a potential race condition.

 

Andreas

Andreas
CLA, CTA
0 Kudos
Message 7 of 18
(2,731 Views)

Hi Andreas,

 

The Unitronix_DDE Request.vi is the DDE request from National Instruments --> From the ..\...\...\..\DDE.lib.

I am getting (during the crach / or hick-up) no Error message, but the program stops logging the data to a file.

If I click on a later moment with my mouse on the program (the title bar text is getting black in stead of grey), the program goes on and saves the new data???

It looks like Windows10 puts the program in the background!!!

I am now testing the program with "high priority", and I will see whats happening.

Last night the data is saved continuously with "high priority" until I get a restart of my PC at 04:05 AM (windows update).

I will now test it again a few days and I hope that is keeps working.

MicV

0 Kudos
Message 8 of 18
(2,726 Views)

Hi MicV,

 

Okay, this sounds indeed more like it's a combination of Windows and LabVIEW and I could have stared weeks on your code without finding a reason for this.

 

This is actually something which has happened to a couple of people and nobody was ever able to find the reason that it is happening on some computers/with some applications. It seems like it is likely connected to some multiprocessor architecture issue, but this is just a guess.

 

There are a couple of work-arounds and it seems the one with the opening/closing front panel periodically seems to work best.

https://forums.ni.com/t5/LabVIEW/Compumotor-6K-4-used-to-drive-goniometer-table/m-p/1561514#M574778

 

Ps: DDE is a very old protocol from Windows 2.0 (1987) and has long been superseded by OLE, COM and ActiveX.

Ps2: I found only a DDE Request.vi my DDE.lib (without the Unitronix), could it be that you renamed it on your computer anywhere in the past?

 

Andreas

 

Andreas
CLA, CTA
0 Kudos
Message 9 of 18
(2,717 Views)

On the forum they gave me a solution to replace the CHECK DDE with ADVICE DDE.

After 37.5 hours of logging with ADVICE DDE (in stead of 7 to 8 hours with CHECK DDE ) the program stops logging with the highest exe priority.

When I look this morning at the PC I found out that the program will continue when I place the mouse pointer above the program or remote log-in???

At cell 134962 at 29-03-2018 02:55 the second logger stops and the counter in the timer loop is 134962 and several hours later at 29-03-2018 08:47 (log in on PC and move mouse pointer over program) the program continue and the counter is one higher 134963 and than the program is continue logging every minute.

What can go wrong (Windows 10 or LabView) ? I am now totally out of options and ideas after 5 weeks. Can anyone please help me? 

0 Kudos
Message 10 of 18
(2,665 Views)