06-09-2024 01:58 AM
I've been developing an RT/FPGA application for a cRIO-9068 that needs to talk to 4 or 5 different Modbus devices. I've got a couple loops to read my Modbus RTU devices via the 9068's onboard RS232/485 ports, and then 3 more independent loops to read the Modbus TCP devices on the network. This particular development setup uses LabVIEW 2015 SP1 on a Win7 Professional SP1 laptop. I have accumulated a few different Modbus libraries over the years testing the pros and cons of each.
The other day, I was modifying and testing some of those Modbus TCP loops and encountered a noncontinuable exception (0xc0000025) that crashed LV. I restarted/recovered and was greeted with a slew of dependency errors:
I figured since this class name turned up in multiple libraries, I probably have a duplicate, older library of some sort. The dependencies were very time-consuming to resolve, so I ended up just deleting one of the libraries in the file system window. After a lot of attempts, I finally got back into my RT_Target VI that runs the application, which in my experience is pure luck. I don't remember changing any VIs/subVIs to use new references from different libraries, and honestly didn't check. Long story short, I don't really know what just happened and can't discern it between a simple dependency mixup versus a major shortcoming in my code.
At the time, I was working on the parallel loops that query the slave devices (TCP):
I may be overthinking it, but is there anything wrong with communicating with these devices like this? Both loops use the same libraries/functions in this case, but the Modbus VIs are of course non-reentrant nor store data on shift registers to my knowledge, so anything I pass in comes from my own loops/shift registers. Should I still be managing multiple TCP slave device connections within the same loop? I feel like the application took a dump and started all this when I began testing the data these functions are returning.
Right now I'm reevaluating the use of this library above anyway because it has a lot of locked VIs that I would like to modify MBAP headers for. One of my TCP slaves is a Modbus TCP/RTU gateway and I may need Unit ID to access/switch between its RTU devices if it doesn't systematically address them somehow in the MB range.
12-04-2024 01:24 PM
12-04-2024 01:31 PM
####
#Date: Wed, Dec 4, 2024 1:16:52 PM
#OSName: Windows 10 Enterprise
#OSVers: 10.0
#OSBuild: 19045
#AppName: LabVIEW
#Version: 15.0.1f10 32-bit
#AppKind: FDS
#AppModDate: 1/01/2017 20:02 GMT
#LabVIEW Base Address: 0x00400000
InitExecSystem() call to GetCurrProcessNumProcessors() reports: 8 processors
InitExecSystem() call to GetNumProcessors() reports: 8 processors
InitExecSystem() will use: 8 processors
starting LabVIEW Execution System 2 Thread 0 , capacity: 24 at [3816184614.23401310, (13:16:54.234013081 2024:12:04)]
starting LabVIEW Execution System 2 Thread 1 , capacity: 24 at [3816184614.23401310, (13:16:54.234013081 2024:12:04)]
starting LabVIEW Execution System 2 Thread 2 , capacity: 24 at [3816184614.23401310, (13:16:54.234013081 2024:12:04)]
starting LabVIEW Execution System 2 Thread 3 , capacity: 24 at [3816184614.23401310, (13:16:54.234013081 2024:12:04)]
starting LabVIEW Execution System 2 Thread 4 , capacity: 24 at [3816184614.23401310, (13:16:54.234013081 2024:12:04)]
starting LabVIEW Execution System 2 Thread 5 , capacity: 24 at [3816184614.23401310, (13:16:54.234013081 2024:12:04)]
starting LabVIEW Execution System 2 Thread 6 , capacity: 24 at [3816184614.23401310, (13:16:54.234013081 2024:12:04)]
starting LabVIEW Execution System 2 Thread 7 , capacity: 24 at [3816184614.23401310, (13:16:54.234013081 2024:12:04)]<DEBUG_OUTPUT>
12/4/2024 1:28:33.544 PM
Crash 0x00000000: Crash caught by NIER
File Unknown(0) : Crash 0x00000000: Crash caught by NIER
minidump id: 8f2158e4-ad96-4e1f-97e6-246359a6216f
ExceptionCode: 0xC0000025</DEBUG_OUTPUT>
0x74991632 - nierInterface <unknown> + 0
0x749964E4 - nierInterface <unknown> + 0
0x749959F4 - nierInterface <unknown> + 0
0x7417CCD5 - MSVCR90 <unknown> + 0
0x01816103 - <unknown> <unknown> + 0
0x018164B7 - <unknown> <unknown> + 0
0x01840BC7 - <unknown> <unknown> + 0
0x018146BD - <unknown> <unknown> + 0
0x010177CA - <unknown> <unknown> + 0
0x0101914E - <unknown> <unknown> + 0
0x0155337C - <unknown> <unknown> + 0
0x0155770C - <unknown> <unknown> + 0
0x0155779E - <unknown> <unknown> + 0
0x00D12824 - <unknown> <unknown> + 0
0x00E28993 - <unknown> <unknown> + 0
0x00D12824 - <unknown> <unknown> + 0
0x00E28993 - <unknown> <unknown> + 0
0x00D12824 - <unknown> <unknown> + 0
0x00E28993 - <unknown> <unknown> + 0
0x00D12824 - <unknown> <unknown> + 0
0x0097B43E - <unknown> <unknown> + 0
0x0097C6FD - <unknown> <unknown> + 0
0x00F8A500 - <unknown> <unknown> + 0
0x010AB2B2 - <unknown> <unknown> + 0
0x00F87CB2 - <unknown> <unknown> + 0
0x00F8811B - <unknown> <unknown> + 0
0x00F88B93 - <unknown> <unknown> + 0
0x01838081 - <unknown> <unknown> + 0
0x012654CD - <unknown> <unknown> + 0
0x01287CEA - <unknown> <unknown> + 0
0x01288256 - <unknown> <unknown> + 0
0x012FF755 - <unknown> <unknown> + 0
0x01300AC5 - <unknown> <unknown> + 0
0x13DEAA47 - lvMax <unknown> + 0
0x13DEA8A2 - lvMax <unknown> + 0
0x01265DF4 - <unknown> <unknown> + 0
*** Dumping Bread Crumb Stack ***
*** LabVIEW Base Address: 0x00400000 ***
#** prop types: "C:\Source\NI\Automated Fuel - MRU\gui\Production.vi"
#** Loading: "C:\Source\NI\Automated Fuel - MRU\gui\Production.vi"
*** End Dump ***
lvlog above.
dmp available.
12-05-2024 04:17 AM
You obviously had installed two different versions of the NI Modbus Library, that installed into two separate paths. As they are basically the same library with some changes, the VIs are mostly having the same names. And somehow during your edits you started to reference VIs from the other library, possibly by selecting a VI from the "wrong" place. That starts to pull in the dependencies of that VI and since they are class based pretty much pulls in the whole class, clashing with the other class being already used.
While properly configured VIPM packages could prevent that from happening, by specifying that they are not compatible to an older version of that package, so that the user is forced to remove the old package first, NI was not entirely familiar with all the features of VIPM at the time they created this package and most likely overlooked that possibility or the need for using it when they changed the target location in the LabVIEW directory.
The conclusion is: Make sure you always only have one version installed of any particular library. And be aware that some libraries may choose to use a different library name rather arbitrarily, making it impossible for VIPM to detect that it should remove a previous installation before installing the new one, without the package specifying that it is incompatible with the earlier package installation.
01-07-2025 10:34 AM - edited 01-07-2025 10:57 AM
Thank you for your reply, and sorry for the delay in response. Would there be any reason why removing all packages involved and then adding only the latest, single package would still present this issue? I'm pretty sure I removed all of them instead of just the one library I wanted to use in an attempt to better filter out any bad reference on the block diagram in hopes of it appearing as a broken wire. The class definitions and their implementations should disappear with the removed package, so is it foreseeable that any wires remaining could themselves contain a trail of the improperly defined class data and allow these conflicting data definitions to continue to cause some sort of environment crash?
I do think there is a probable likelihood, as you say, that something with the same name got saved and improper class data was pulled. It seems relatively painless to just remove all packages and reinstall one, but in the scenario where I've already done that and still experience crashes, I am concerned that scouring every VI that's utilizing a Modbus library throughout the entire project to inspect data disable diagrams, control inputs tied to connector panes, or loose wires that were perhaps missed by LabVIEW (as a broken wire), will be a bit more daunting. Perhaps there is already a primitive tool in LabVIEW for this that I am unaware of?
I'll try removing all Modbus packages again and then re-adding the one today just to be sure.