Jump to content

Problem with read panel from ini and slow solution


Recommended Posts

Hello to all.

I have an application wich use; imaqdx (displays...), sliders, many controls and many indicators, and everything in a tab control of 3 pages and 2 subVI.

I am trying to use "write and read panel to/from ini . vi".

The first thing that my program does is to read panel from ini.

Here there is the first problem because it gives the next error: "Error 91 "The data type of the variant is not compatible with the data type wired to the type input. Set control value"

Here is my piece of code in image attached (boolean input in open.vi is True).

I notticed that it gives me an error if the .ini file does not exist (but it should work even .ini file does not exist).

Well, my next step was to create a .ini file before to use "read panel from INI.vi".

So I use "write panel from INI.vi" and it works fine. It does not give me any error. and the ini file is the next:

[medir.vi]
Boca = "0,000000"
Camara 1 Configuracion = "\00\00\00\1Dremote image 0000000013F9C704\00\00\00\0Anivissvc.*\00\00\00\13LV_ImageDTClassInfo\00\00\00\01\00\13)É\00\00\10\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\10\00¬\00\00\00\00\00\00\00\1D)\13\00\00\00\00\00\00\00\00\00<\04\00\00\00\00\00\00<\04\00\00\00\00\00\00\03\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00€\04\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00DÊù\13\00\00\00\00LÌj\0F<\1E\00\00ø\08\00\00\00\00\00\00\00\00\00\00\01\00\00\00\01\00\00\00\00\00\00\00\1D\00\00\00\00)\13\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00remote image 0000000013F9C704\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\0ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿúïêôÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿËž“Š„€z€}{zzwx|{wwxswyvttquvrtqpprqsrpvppsquqqusputquxusswwssttvwtwt}yqvuxuzvvuwtwvvtvrwrqpupgc\\XYZX\\XW[[UVVWUXTRTRURUQQSPNQNNOKKLKLJLJFEDEEBBC?B??=:>@CDHGHHIJGJEGDFEHJGFDBADDCCEDBCFILS^ao€–³Òñÿÿÿÿÿÿÿÿÿÿÿÿ\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00ÿÿÿÿÿÿÿÿÿÿÿÿÿÿìÛËÚ̾¶³³³¼³Àìÿãϸ¬ª£¤œ‘‘‹Ž‰Œ‡…€†~z~}x{||}z~xx}}v{syx{vwwwzyywxxxxwwuruwzyvwszvzt{z{yv{wy|{vyw{zzwy~y}xzz}y{|€†€‚€€‚ƒƒ†}‡ƒ…‡‡†‹ŠŒŒŽ‹‹•š’–”›žœ›  ¡¢©©©±²µ¶º½ËÒåÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿýëä÷ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ Ž‹…†|ƒ}~xv~z{zu{wvvvuutvssqssusotqrwruxtrpqrrotusrvuwywrsuusyxvywxtvsvwuuwvwywquvvuvswtvqpplge^\\VYWYXWYXSWVUZUVQSUTSRTTUNONMKMMKKMJLLLJGEDC@CA?@@@??=CBDGGJLJIJGGIGHEFGFHHCBCBADCAADDIOWZiq„œ·Ôïÿÿÿÿÿÿÿÿÿÿÿÿ\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00ÿÿÿÿÿÿÿÿÿÿÿÿÿÿåÙ×âɺµ®¶¶³·ÍýÿßDz¨¤¢¥š–“‰ˆ‰…‚‚‚~~z}x}}~xxxwyy}xwzwzvywuvxyuxtvyxvvwtyqvpzv|zvzzy{xzzzxx{yxyzyzxw}{y~{}|~€{{|‚‚„ƒ‚…‡€{‚‚„‚‡Š‰‡‰Š‹ŠŒ‰ŒŽ‘Ž’••’“š™žš™›Ÿ¡§ž£ªª®²´»½ÂÉÚïÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿøàéÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿô»žŒˆƒ€~}~}||w{yzxuwwuxvrtvtvtrqpuotqppttvtxsstqqtrtpswtwwvsusuvwxxxxvxuxxvvtx{ux{uuvttxtsssspoja\\Z\\YYZXWYWSSWXWWUSRPTUQSRNQPQNOLNLLKJJIHFFHECA?A?><@?=?ADHFELIHHJIIGEHFGJJDEFBCBECEACDGJPX_fs‡¢»Úóÿÿÿÿÿÿÿÿÿÿÿÿ\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00ÿÿÿÿÿÿÿÿÿÿÿÿÿÿé×Ýã¾·®´´Âº»Ò
Camara 2 = "0,000000"
led_boca = "FALSE"
Buena_boca = "0,000000"
mala_boca = "0,000000"
Espiga = "0,000000"
led_espiga = "FALSE"
buena_espiga = "0,000000"
Bulbo = "0,000000"
led_bulbo = "FALSE"
buena_bulbo = "0,000000"
Cuello = "0,000000"
led_cuello = "FALSE"
buena_cuello = "0,000000"
mala_cuello = "0,000000"
Cuerpo = "0,000000"
led_cuerpo = "FALSE"
buena_cuerpo = "0,000000"
mala_cuerpo = "0,000000"
Excentricidad = "0,000000"
Buenas = "0,000000"
Malas = "0,000000"
led_excen = "FALSE"
EXCENT = "0,000000"
Camara 2 Configuracion = "\00\00\00\15Threshold Destination\00\00\00\0Anivissvc.*\00\00\00\13LV_ImageDTClassInfo\00\00\00\01\00\00\00Á\00\00\10\0000\00\00\03\00\00\00\00\00\00\00\\00\00\00\00\00\00\00Threshold Destination"
Excentricidad.<size(s)> = "6"
Excentricidad 0. = "<size(s)=0> "
Excentricidad 1. = "<size(s)=0> "
Excentricidad 2. = "<size(s)=30> 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000"
Excentricidad 3. = "<size(s)=30> 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000"
Excentricidad 4. = "<size(s)=30> 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000"
Excentricidad 5. = "<size(s)=30> 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000 0,000000"
Nivel de luminosidad = "157,666672"
led_luminosidad = "TRUE"
Distancia promedio = "46,131313"
Bordes encontrados = "33"
Camara2_grafica = "0,000000"
Dist_Cuerpo_Cnfig = "0,000000"
Dist_Boca_Cnfig = "0,000000"
Dist_Espiga_Cnfig = "0,000000"
Dist_Bulbo_Cnfig = "0,000000"
Largo total = "0,000000"
led_largoTotal = "FALSE"
cuello_config_cluster.Left = "0"
cuello_config_cluster.Top = "0"
cuello_config_cluster.Right = "0"
cuello_config_cluster.Bottom = "0"
cuello_config_cluster.Rotation = "0,000000"
top_cuello_prod = "0"
botton_cuello_prod = "0"
PLC_Valor_Cuello = "0"
ampolla_ok_prod = "FALSE"
num_disparo_cam1 = "0,000000"
PLC_Valor_Espiga = "0"
PLC_Valor_Cam2 = "0"
lim_min_ambar_boca = "0,000000"
lim_max_ambar_boca = "0,000000"
Largo Total.<size(s)> = "1"
Largo Total 0. = "<size(s)=0> "
Tab Control = "Camara 2"
Cluster.Numeric = "0,000000"
Cluster.Numeric 2 = "0,000000"
Cluster.Numeric 3 = "0,000000"
Cluster.Numeric 4 = "0,000000"
Cluster.Numeric 5 = "0,000000"

I resume "camara 1 configuration" because the rare symbols are about x10 more.

Well, next step is to read this .ini file and now it does not give me any error but it stacks in "read panel from ini.vi" (maybe it takes about minutes for reading .ini).

How can I do to write and read panel to/from ini well?

It is very important for my application. Maybe there is another library that I can use?

Thanks a lot!

Selección_052.png

Link to comment
15 hours ago, drjdpowell said:

You might see if the MGI Library has similar functionality.

Thanks for replying.

I have taken a look at MGI Library.

I can't understand well the "Read everything.vi".

I would like to read from ini to Server VI reference "this VI" like I show in the first post. But.. there is no Server VI reference "this VI" as indicator to connect it.

Any ideas to read from ini to the whole panel with MGI library?

Thanks!

Link to comment

I'm guessing its the image refnums, because you can't really include them in a general purpose library. If I remember correctly, the imaq refnum is itself licensed, so if you don't have image acq sw installed and activated the library won't work. I've seen this issue with quick drop shortcuts and image refnums as well. It probably just needs a special case, but then you lose the image if thats something you care about.

Link to comment
3 hours ago, smithd said:

I'm guessing its the image refnums, because you can't really include them in a general purpose library. If I remember correctly, the imaq refnum is itself licensed, so if you don't have image acq sw installed and activated the library won't work. I've seen this issue with quick drop shortcuts and image refnums as well. It probably just needs a special case, but then you lose the image if thats something you care about.

Hello. Thanks for answering.

I have acq sw installed and activated. I don't care to loose the image but I need to keep the ROI position of the image.

However how can I write and read the whole VI except the image? is there a shorcut way? Because it will be really tedious to put every indicator and controls except the image in the block diagram to reaad/write...

Thanks

Link to comment
20 hours ago, drjdpowell said:

looks like they don’t have the feature you want.   Re your original problem, I wonder if the issue is some very large data that you may be saving in the config file.  How large are they?

Config file is 2.7MB. So I think it is very large. The image that it saves are about 3000 symbols...

Read my last post to @smithd because maybe you can help me as well.

Thanks again.

Link to comment
1 hour ago, ASalcedo said:

However how can I write and read the whole VI except the image? is there a shorcut way? Because it will be really tedious to put every indicator and controls except the image in the block diagram to reaad/write...

There’s a middle ground between those two extremes, where one operates on arrays of control references.   You either create the array of references explicitly (lot less work that coding it), or you get it programmatically from either the pane reference or tab-control tab references.  You can even do things like use prefixes in the control’s name to exclude some controls.

Link to comment
20 minutes ago, drjdpowell said:

There’s a middle ground between those two extremes, where one operates on arrays of control references.   You either create the array of references explicitly (lot less work that coding it), or you get it programmatically from either the pane reference or tab-control tab references.  You can even do things like use prefixes in the control’s name to exclude some controls.

Thanks a lot for replying.

How can I create the array of references? An array of every controls and indicators that I can save/load? I think that a lot of work.

Could you send me a very little example of how I can exclude some controls?

Thanks again.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.