Jump to content

change path of .NET file event during run-time


Recommended Posts

Hi lava,

I hope you can help me with my problem.

 

The problem that I want to solve (in a proper way) is the following: 

I have a list of all the *.dat files in a folder. I want this list to update every time a new *.dat file i created in that folder.

I don't want to pool the folder constantly so I have solved this problem by using a dynamic event from a .NET action. This is all nice and great.

My problem is, that if I change the folder, my dynamic event does not execute when a new file is added to the new folder.

 

I have attached two snippets of the main part of the code. 

 

In the mainVI, I first setup some events. The events are then written to a global variable. It is this global that I use when broadcasting the event.  

 

post-46625-0-20004200-1384332511_thumb.p 

 

In the watch_dir.VI the .NET event is setup. I look for files that are created, deleted, changed or renamed. (Most of the code is from Steve Chandler's nugget: http://forums.ni.com/t5/LabVIEW/My-First-Nugget-Directory-Changed-Event/m-p/1407552)

 

post-46625-0-80999300-1384332192_thumb.p

 

I have tried initializing the different events when the folder is changed,but that does not seem to fix the problem. I hope I have made myself clear, but please dont hesitate in asking questions. 

 

I could off course just pool the number of files in the folder or something like that, but that doesn't seem right to me.

 

I hope you can help me. 

 

-Jørgen

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.