LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

file ref num recording pb

Solved!
Go to solution

hello ,

 

i have a recording probleme when using file refnum from a vi to another 

i use AE to memorize file refnum , it s ok if  done all in one sequence but not if reading is done in a vi

an writing and close in another. 

if a i use probes to know refnum value  i have the same at moment of record that the one at reading all other actions work correctely  I don't understand where is the problem ?

 

here my vis

 

Any ideas ?

 

Tinnitus

 

 

CLAD / Labview 2011, Win Xp
------------------------------------------------------
Mission d'une semaine- à plusieurs mois laissez moi un MP...
RP et Midi-pyrénées .Km+++ si possibilité de télétravail

Kudos always accepted / Les petits clicks jaunes sont toujours appréciés
Don't forget to valid a good answer / pensez à valider une réponse correcte
0 Kudos
Message 1 of 5
(2,751 Views)
Solution
Accepted by topic author tinnitus

LabVIEW refnums all have a so called garbage collection. This means the refnum is disposed off as soon as the top level VI in whose hierarchy the refnum was created/opened goes idle. Solutions are several:

 

1) Keep the part in which you opened the refnum active for the entire duration of when you want that object the refnum is refering to available.

2) Pass not refnums around but paths and reopen the file whenever you need to do something

 

2) is obvious, 1) can be achieved in many ways, but what I usually do is having the main framework which is kept always active anyhow, do the opening of refnums to be used in spawned subpanels.

 

Message Edited by rolfk on 03-20-2010 05:58 PM
Rolf Kalbermatter
My Blog
Message 2 of 5
(2,739 Views)

I don't see where you are actually initializing the file refnum shift register.  In vi_mem_init, the shift registers for the file refnum gets a value stored in it in the "Read File" action.

 

Bu in test ae config, your actions are get cluster, set cluster, get cluster (okay none of those actually use the refnum) then Write file which needs the refnum but was never set.

 

You talk about the Read config vi, but I don't see where you are executing that or in what order it would be relative to the test ae config vi.

0 Kudos
Message 3 of 5
(2,736 Views)

hello,

 

 

here it just a simplified example and it is just the problem, if you replace the first call in test ae config with read , no problem.

 

if you lanch read config file vi then launch test ae config (with first element to get cluster) the record doesn't work.

 

This simulate the first call of read config file in my top level vi and the record of this file in a sub vi trying to use the refnum even if this

refnum is well stored

 

is it clearer ?

 

best regards

 

Tinnitus

 

CLAD / Labview 2011, Win Xp
------------------------------------------------------
Mission d'une semaine- à plusieurs mois laissez moi un MP...
RP et Midi-pyrénées .Km+++ si possibilité de télétravail

Kudos always accepted / Les petits clicks jaunes sont toujours appréciés
Don't forget to valid a good answer / pensez à valider une réponse correcte
0 Kudos
Message 4 of 5
(2,725 Views)

sorry i forgot two files

 

best regards

 

 

 

CLAD / Labview 2011, Win Xp
------------------------------------------------------
Mission d'une semaine- à plusieurs mois laissez moi un MP...
RP et Midi-pyrénées .Km+++ si possibilité de télétravail

Kudos always accepted / Les petits clicks jaunes sont toujours appréciés
Don't forget to valid a good answer / pensez à valider une réponse correcte
0 Kudos
Message 5 of 5
(2,714 Views)