LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

System crash

Hi,

 

Hardware used : cDAQ 9184 with modules NI 9213(thermocouple), 9215(  Voltage measurement), 9418(Relay) and 9472(Digital output) 

Software : Labview 2021 SP1, DAQmx 21.3

 

I am using the above mentioned hardware and software for an application. And there are 12 thermocouple measurements and 4 voltage measurements taken at the rate of 1 Hz and logged into a tdms file (2 writes in per second). For each 30 mins the file reference is closed and defragmented.The file is also read concurrently for viewing history data at the press of 'History button'. The program (attached) is crashing presently when run about 33 hours.

Ideally I want to run the code till 50 days at 1 Hz measurement rate and have a single file where the data is logged. 

Can you help point me where I should start to solve the issue?

0 Kudos
Message 1 of 6
(1,457 Views)

Hi Anurag,

 


@Anurag_NI wrote:

The program (attached) …

Can you help point me where I should start to solve the issue?


We could once you really attach your code…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(1,450 Views)

Hi GerdW

Missed the attachement, here you go. The file contains Main.vi in the MEPA.lvproj

Cheers,

Anurag

0 Kudos
Message 3 of 6
(1,417 Views)

Hi Anurag,

 


@Anurag_NI wrote:

Ideally I want to run the code till 50 days at 1 Hz measurement rate and have a single file where the data is logged. 

Can you help point me where I should start to solve the issue?


Thanks for posting the code!

 

But: the main VI is way too large. It uses way too much locals. It uses way too many property nodes.

It's written in a "sub-optimal" way (to put it in nice words)…

 

You really should re-organize the whole program before tackling any other problems.

 

Examples:

  • Your "timing engine" loop holds 4 different wait functions: do you really think you will implement reliable timings at all?
  • Do you really need 7 while loops running in parallel (didn't check for sure) in your main VI? Don't you think it might cleanup the code when you move atleast some of them into their separate subVI?
  • Using locals (and "value" properties) is calling for race-conditions: try to avoid them…
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 6
(1,378 Views)

Hi Gerdw,

Thanks for looking in and responding, I am making changes in the code and moving the loops to subvi. Use of variables are reduced using notifiers. I will post the code after finishing up these. But still I would need to use property nodes to enable and disable controls for the fuctionality, I don't see a way around this. Also during the run time I tracked RAM usage it seems not to go up even after long time. 


  • Your "timing engine" loop holds 4 different wait functions: do you really think you will implement reliable timings at all?


The wait funtions are excecuted mutually exclusively, so it should give reliable enough timing.

Best regards,

Anurag

0 Kudos
Message 5 of 6
(1,331 Views)

Hi,

I have reorganised the code with Funtional global variables. Could you please have a look at it and suggest improvements.

The initial code just replacing the global variable for start and stop with FGV has been put to run and has not crashed for 43 hours and counting. But I am yet to test the attached code here for long time run.

Best Regards,

Anurag

0 Kudos
Message 6 of 6
(1,296 Views)