FieldPoint Family

cancel
Showing results for 
Search instead for 
Did you mean: 

[c]FieldPoint acqusition rate goes down

Hi,

I'm developing a [c]FP 2020 application and I'm almost finish. At the beginning I had 4 parallel loops (main loop for sampling two temperature, one pressure, one serail port (1s))
The other loops are for (check if DIP switch 5 is enabled (500ms), check if input1 is set to 1, and the last one for checking if a day is over.
The main 1Hz loop writes the data directly to a cvs file on drive D:\, calculates three histograms and wirtes the results back to three ini files (drive d:\)
During the proccess I read and write data from \ to a configuration file on drive c:\
I could see a strange behavior. It is that the rate of main loop goes down to 0.1Hz. I've droped all the other loops and put the logic inside the main loop. The histogram results I save now inside local variable and I save them first a day is over.

The performance doesn't change. Can anybody help me? Maybe I should store all datas within arrays and save them first at file when I need the datas within a file, but I don't know what happens with the memory of the [c]FP 2020 if I sampling the hole day.

I hope somebody is there and can help me.

Thanks

Thomas
Thomas
0 Kudos
Message 1 of 4
(3,464 Views)
Can you post some code? It is kind of difficult to tell just which functions are
where based on your comments but I'll offer a few suggestions:

1) make sure all of your loops have a time delay
2) pre-allocate arrays for whatever data you are going to accumulate;
you don't want to be building or adding to arrays repeatedly
3) write data out to the C:\ or D:\ only when necessary

As far as memory, a -2020 should have plenty of ram for 2 temps and a pressure,
even at 1 reading each per second for 24 hours (approx. 2MB?) unless you are doing
a whole lot of processing of the data.

Matt
0 Kudos
Message 2 of 4
(3,461 Views)
Hi,

thanks for your response. I did almost everything what you've said. I write to file in cases. It means when a event occurs. But a couple of I've to write online. Maybe should save my collection in arrays and write the values to file when It's time. Anyway, I don't know the rigth way.

Attche is I large image of my code bacause the code is depend on serial devices (GPS, etc.)

Cheers Thomas
Thomas
0 Kudos
Message 3 of 4
(3,456 Views)
Thomas,

Looking at the image of your code, I notice that you have quite a few functions in your loop. Any one of these functions may take a longer period of time or a shorter period of time. I suggest that you run the VI on your host computer and use the VI Profile tool (Tools -->Advanced-->Profile VIs). Profiling the VIs will allow you to see how much time each subVI takes on average so you can determine which portions of the code may be slowing you down. One general thing that is relatively slow is file I/O.

There are other things that you can do to enhance your code as well. Consider using the Unbundle By Name function rather than Unbundle. The FieldPoint VIs are polymorphic so you can set them to your desired data type. For example the FP Read for the Ignition channel, set it to Boolean, and can get rid of the 2 Index Array functions and the number to boolean array function.

Regards,
Aaron
LabVIEW Champion, CLA, CPI
0 Kudos
Message 4 of 4
(3,444 Views)