LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

File path changing my code?

Hi,
I am using labview 7 to take voltage readings from a discharge detector, convert them to digital using NI PCI 4474 card then hopefully integrate them. A program for a similar function has already been written for the same card, but when i copied this program to a different PC and changed the file directory, the wire from task out on the DAQmx Stop Task.vi to the DAQmx Clear task.vi "task in" gets broken, and I can't figure out why or how to solve this. I know I need to do quite a bit of development to this program for it to meet my specific needs, but this just makes no sense, can anyone please help?? I've posted the code below.
Cheers  
0 Kudos
Message 1 of 15
(2,720 Views)
I loaded your VI into two different versions of LV and I didn't get a broken wire.
What exactly do you mean by "changing the file directory"? Do you mean you have it copyed to a different folder on the second PC? Or did you just change the control and stored that as default value?
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
0 Kudos
Message 2 of 15
(2,707 Views)

Hi, no I don't just looking at the VI, so when I try and run it as is with my system to acquire data I get the file path not found message (as the file it is directing to is from the C drive on the other PC where the VI was developed), so then I change the directory to one on the C drive I'm working with (I change the files to write the data to ie the green file paths) the wire coming from the loop to the clear data DAQmx breaks and says it is data of the wrong kind? 

I am new to all this so I could be missing something really stupid, but literally all I change is the file path so i can't see how that affects the data in/out of the stop and clear DAQmx vi's?

0 Kudos
Message 3 of 15
(2,702 Views)

Are your file paths matching?

One points to C:\test_DA\(your file here)

and the other to C:\test_DA\Data\(your file here)

But you end up with a path like test_080212180712:\ which would indicate that the Folder Path must have been blank when it ran...

Check your paths using a probe.. 

RayR

 



Message Edited by JoeLabView on 06-02-2008 06:02 PM
0 Kudos
Message 4 of 15
(2,695 Views)
Ok cheers, i'll give that a go
0 Kudos
Message 5 of 15
(2,687 Views)

Start by looking at the file path. 

You can write the base path in "Folder Path", such as C:\test_DA (or whatever you want).   The right-click the "Folder Path" control and select Data Operation and make current value default.  Just to try as a quick fix .. 😉

RayR



Message Edited by JoeLabView on 06-02-2008 07:36 PM
0 Kudos
Message 6 of 15
(2,682 Views)
Ray I have seen the fact with the file paths too but as he was reporting about the DAQmx wire I didn't go into that.
 
First thing the tunnel out of a for loop will give you an invalid DAQmx reference in the case the for loop will not run at least one time. But the "Nr of steps" control is set by a non zero number. You should replace the tunnels of the DAQmx and the error cluster with a shift register.
 
Another thing is the name of the device. Opening the VI I get Dev1 as device name. You should click on the DAQmx constant and check if the device has the same name on the second PC.
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
0 Kudos
Message 7 of 15
(2,644 Views)

Hi Khume,

another point, why do you start and stop your task every time in the loop? Start it ones before the loop and stop it after.

Mike

0 Kudos
Message 8 of 15
(2,640 Views)

Hi, thanks for all of your help and suggestions,

I am thinking that maybe the break in the wire coming from the DAQ stop,and tunneling to the clear is maybe not to do with the files. I have tried replacing the tunnels with shift registries and still no joy. I can get the program to write to the correct files now, but then still end up getting thios broken wire. I have saved it with the wire broken so you can see what I mean, somehow I must be changing the format of the data or something?

0 Kudos
Message 9 of 15
(2,614 Views)

One problem I see is that where the task wire and the error wire come into the loop, they come through as a normal tunnel that is sitting on top the shift register.  The shift register is unused.  See attached.  I dragged the tunnels away from the SR's to highlight.



Message Edited by Ravens Fan on 06-03-2008 08:38 PM
0 Kudos
Message 10 of 15
(2,605 Views)