LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read Configuration File Takes a long time when not using Raw Type (Slow Unescape Algorithm in LabVIEW)

Does anyone know of a good algorithm for Unescaping raw data.  When run this code (VI Snippet posted below), it takes 70+ seconds for the Read Config VI to return. This is because I have to read non-RAW data in order to get the Get/Set Ctrl Val to work.  I narrowed it down to the Unescape String VI.  I was thinking if I could replace this with a C DLL that it would be behave much faster.  Also, if anyone knows how to get around having to NOT use RAW data when using the strings in a .ini to store Ctrl Values, I would like to know.

 

 

 

Config Read Speed Test.png

 

Slow unescape VI.png 

Joji
0 Kudos
Message 1 of 3
(2,890 Views)

Hi Joji,

 

could you please split your test into 4 stages:

1) reading all control values

2) writing the ini file

3) reading the ini file

4) setting all control values

 

and then report the time for each stage?

Also:

How many controls are you saving? How big are the data (any [large] arrays included)?

Best regards,
GerdW


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

It seems a little strange to write raw binary text to an ini file. Usually you want plain text that a user could read or modify manually. One quick alternative to the ini file would be an XML file using the default LabVIEW schema. It automatically flattens all data types to readable text. I personally don't think it's the best schema in the world, but it's quick and easy.

 

Your other alternative is to manually flatten the binary data to descriptive, plain text. OpenG has a Variant Configuration File utility that does exactly this for ini files, and should have decent performance.

Jarrod S.
National Instruments
0 Kudos
Message 3 of 3
(2,870 Views)