LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Driver subVIs in one folder works but not the copy of it in a different folder doesnt work.

Hi, I have a NI switch matrix TB 2641 and I communicate it to it using drivers in labview. I have a weird problem with it which doesnt make any sense. So i have one program that uses this driver VIs and this program works perfectly. Now I am making different new programs. But when I make a new program I just copy these drivers into the new folder of that program and then place it in the program from there. When I do that the switch matrix doesnt work correctly and I am not getting the expected output. But then if I just copy these switch matrix from the original program directly as subVIs into the new program instead of copying into the folder then the program will work fine. That if my program is using driver VIs from its own folder it doesnt work, but if it is using driver VIs from the original program folder it works. I dont understand why is that because the driver VIs in the new program folder is just a copy from the original program folder. So why doesnt it work. Why does it work only if I use it directly from the original program folder. Can anyone help me with this weird problem. Thank You. 

0 Kudos
Message 1 of 14
(2,397 Views)

Define "it doesn't work"...

 

BSoD? Broken wires? Errors? What errors? Etc.

0 Kudos
Message 2 of 14
(2,376 Views)

No there are no broken wires or errors, the program works fine. The program is used to measure resistance between the NC connection and common of a microcontroller board. How I do it is using the switch matrix connect the NC and Common to the resistance terminals of a calibrator to measure resistance. Now here comes the problem. When the driver VIs is from the original program folder it gives an accurate measurement that is a reading in ohm, but when I use the driver VIs stored in the same folder as this program, then the reading showing is over which is that the resistance cant be measured. How is this happening since this driver VIs is just a copy of the other driver VIs in the original program folder. 

0 Kudos
Message 3 of 14
(2,370 Views)

Instead of copying the driver all over the place, just put it in the instr.lib folder where it belongs and delete all the copies.  This should ensure that all the software uses the same driver in the same environment.

 

(Maybe that makes them all not work, but at least then you have your problems all in one place.)  😄

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 14
(2,351 Views)

@govindsankar wrote:

 How is this happening since this driver VIs is just a copy of the other driver VIs in the original program folder. 


There probably is a relative path to a dependency that doesn't get copied.

 

Have you wired all errors? I'd expect some kind of error, although that depends on the driver.

0 Kudos
Message 5 of 14
(2,340 Views)

Thank you, could you explain that some more, I didnt understand but I think that is the problem. Yes I have wired all errors. 

0 Kudos
Message 6 of 14
(2,335 Views)

Most NI Drivers, including NI SWITCH, are shallow calls to an IVI COM style driver.  Copies of the API vis don't know where the DLL is relative to where you copied it because you didn't INSTALL  the driver at the new location.   You almost certainly are not reporting errors properly.

 

Time to post some code!


"Should be" isn't "Is" -Jay
Message 7 of 14
(2,321 Views)

@govindsankar wrote:

Hi, I have a NI switch matrix TB 2641 and I communicate it to it using drivers in labview.


Technically you are really using most likely a NI 2532 module. The TB  2641 is just a connector block without any intelligence in it that your LabVIEW program could talk to.

 

Now what driver are you talking about? If you use directly NI-Switch there is no driver you should ever copy around. If it is a custom driver on top of NI-Switch then you would have to go into it and see what assumptions it makes that prevent it to work from a different path. Maybe some configuration file that is located alongside?

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 8 of 14
(2,312 Views)

Yes you it is NI 2532 module. My mistake. The driver was already there in a folder when I joined the company. It consists of driver VIs like initialize the slot along with topology, connect channels, disconnect channels, disconnect all channels. I use this three in my program. Like someone just told I copied everything to the user.lib folder so that I can use it while programming instead of making multiple copies. And then I made the same program as the initial program which worked. Now I will explain this program. This program is configuring a digital input and turning it on and then reading the value of the register address using rs485. So I do everything and write the program to read values from the starting address of 512 to a total of 10 registers. In the initial program where it works 512 output is one which means its working properly. But in the new one which I made I am getting 512 as 0 but I am getting 514 as 1. Now 514 is the register for wire break. It becomes one if there is an open connection and in this case the connection is made by the switch matrix. So if it is showing an open connection then the switch matrix is not connecting properly. But both programs are exactly identical. Kindly do help me. 

0 Kudos
Message 9 of 14
(2,302 Views)

One more important point. We did change the 2352 module recently. The program that works I wrote before changing the module. I started having this problem after changing the 2352. Earlier was also 2352 but some switches in that got damaged and now we installed a new 2352 B module. Is this the reason why they are not connecting and even if it is the reason then why is the old program still working. I expect it to not connect as well. 

0 Kudos
Message 10 of 14
(2,298 Views)