LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus library not working...

Hello everyone...

 

I made a PID controller software program using Modbus interface. I installed Modbus library version v1.2.1.42 for my Labview 2017. Previously my program was working fine, but now I am getting errors like, read_P.vi, write_P.vi (I am using them as a subvi in my main program) is not executable. Later on I came to know that it is because of the Modbus library incompatibility. I tried uninstalling & installing the Modbus library again using VI package manager, but it showing the same error. I just checked that all the function palettes of the Modbus library have been modified. Previously the palettes were coming up in yellow color, but now they are showing in purple color (see attached pics). How can the functions get changed for the same version? My whole program is not working because of this issue. Somebody plz help me out. 

 

Download All
0 Kudos
Message 1 of 9
(4,451 Views)

When your VIs become broken and are "not executable", the Errors List window can be helpful in troubleshooting the cause. Clicking the Run arrow, or pressing Ctrl-L on Windows, will open this window.

 

It's also possible to check for the locations of VIs loaded into your project by switching to the Files view (tab near the top, next to "Items") and then check whether part of the library are loaded from different places.


GCentral
0 Kudos
Message 2 of 9
(4,424 Views)

It's not that they are incompatible.  They are two different modbus libraries.

 

The purple ones are under Data Communications >> Modbus Library

The yellow ones are under Data Communications >> Modbus

There is also a white group under User Librarires >> Modbus.

 

It depends which of these you have installed.  Have you moved your code from one PC to another where you might have had one library installed on the original PC but it is not installed on the next PC?  I think the yellow ones come with the DSC module.

 

It's possible that if it can't find the original library, it found another library since the subVI names would tend to be similar.

0 Kudos
Message 3 of 9
(4,418 Views)

I got to know that it is because of some issue in Modbus Library. No 'Modbus' is coming under 'Data Communication', only 'Modbus Library' is coming up (attached pics). Whereas on my laptop both the palettes are showing up. I tried uninstalling & installing the Modbus library (attached file). I just don't understand what's the exact issue. Previously my Labview program was running absolutely fine, but when I restarted the PC and tried to run the program, I am facing this error. DSC module is also installed properly. Can you tell me what went wrong?

0 Kudos
Message 4 of 9
(4,402 Views)

RavensFan is telling you there are multiple different libraries with similar VIs and names, which have nothing to do with one another.

 

That is, you need to install a different library (not a different version) if you want to use the same code in the second location/computer.

 

According to your latest post, your laptop has two different Modbus libraries installed, and you're using one of those (say Modbus-A.lvlib).

Your other computer has Modbus-B.lvlib installed, and does not have Modbus-A.lvlib at all. Consequently, it cannot find the correct library and breaks your code.

 

Please note that the names "Modbus-A" and "Modbus-B" are made up to clarify intent/ease reading. It appears from your images that the VIP file you linked, "ni_lib_modbus_library", corresponds to "Modbus-B" in the above description.

 

A lot more useful information can be found in another post by RavensFan here: https://forums.ni.com/t5/LabVIEW/Some-question-about-the-Modbus-library/td-p/3886312

 


GCentral
0 Kudos
Message 5 of 9
(4,388 Views)

@rajesh111 wrote:

. DSC module is also installed properly. Can you tell me what went wrong?


I'm not so sure it is installed properly because if it was, the palette should show the library.  You should double check that in License Manager.  Also, does the DSC module show up in the splash screen that PC?

 

Capture5

 

I would consider just replacing the ones that are missing with the ones that you have.  The subVI's with the yellow headers from the DSC module are pretty much wrappers for the subVI's with purple headers.

0 Kudos
Message 6 of 9
(4,384 Views)

I am on the same boat with you. I also have both libraries, yellow and purple ones and it is causing a lot of trouble. I installed purple one from VI package manager. Yellow one came with LV2019 installation. I like purple ones better because when you create a MODBUS instance, purple library allows you to input "Time Out" value but yellow library does not. I had both libraries before when I had LV2018 and never had an issue but when I upgraded to LV2019, I started getting lots of broken lines because labview uses whatever MODBUS library loaded first to the memory and brakes all VIs which happen to use the unloaded MODBUS library. You also need to be careful since purple library "Create MODBUS Instance" has IP, PORT and Time-Out input, however yellow one has only IP and PORT input which will cause a problem because your timeout input on the purple one turns out to be a port input on the yellow one. I believe NI has to use only one library and remove all others.

Senior Software Developer
0 Kudos
Message 7 of 9
(4,287 Views)

1.

I Have the same problem: I have both libraries installed: Yellow library by default when installing Labview2018, purple library installed by VIPM.

I created a project using the purple library. When opening the same project on a different computer, which also has both libraries installed, (same versions of LabVIEW), it loads using the yellow library instead of purple.

 

The "Load with selected" and "browse"-buttons is unavailable, thus i am not able to override LabVIEW's decition to use the wrong library.

On the PC where the correct library is loaded, i have checked (In dependencies) that only the "Purple" library is listed, thus there should be no mix of yellow and purple library calls. 

 

I attempted replacing all the Library VI's to in the code to "Purple" manually, until i realized that most of the purple VIs are also broken, as Labview seems to mix in some items from the other Modbus library when lioading those 😕

 

Both libraries are present in the palette, so the Purple one (installed by VIPM) is installed properly.

Is there any way i can override LabVIEW's choice which of the two libraries it loads?

 

 

 

0 Kudos
Message 8 of 9
(3,783 Views)

I had the same issue. I had to switch everything over to the newer "white&yellow" library. Initially I was unable to replace several functions, I would select the "white&yellow" function from the pallet and nothing would happen. 

 

In order to do this, I had to delete the folder that contained the "purple library" and restart LabVIEW.


C:\Program Files (x86)\National Instruments\LabVIEW 2020\vi.lib\NI\Modbus Library

Then I was able to replace all the Modbus functions with the newer white&yellow library. 

0 Kudos
Message 9 of 9
(1,968 Views)