Renny Sadala Posted August 12, 2020 Report Share Posted August 12, 2020 Hi everyone, I have a myRIO that i try to use to implement a factory pattern of OOP. I have to classes that i need to load dynamically on the VI running in the RT target. Firstly, i saved my classes in the myRIO's memory on the path /home/lvuser/natinst/bin/Host_Class in the directory Host_Class. And i give to the VI "Get LV Class Default Value" this path but i had this error : Error 7 occurred at : Get LV Class Default Value.vi Possible reasons : LabVIEW: (Hex 0x7) File not found. The file may be in a different location or may have been deleted. Use the command prompt or file explorer to verify that the path is correct. ========================= GPIB interface not existing. LabVIEW tried to load the class this way: /home/lvuser/natinst/LabVIEW Data/Host_Class/Accelerometer/Accelerometer.lvclass But when i check this directory, my classes are there Quote Link to comment
Neil Pate Posted August 12, 2020 Report Share Posted August 12, 2020 (edited) I am a bit confused. You said you saved the classes to: /home/lvuser/natinst/bin/Host_Class but then you tried to load them from /home/lvuser/natinst/LabVIEW Data/Host_Class/Accelerometer/Accelerometer.lvclass These directories are different... Edited August 12, 2020 by Neil Pate Quote Link to comment
Renny Sadala Posted August 12, 2020 Author Report Share Posted August 12, 2020 Sorry, I saved my classes at /home/lvuser/natinst/LabVIEW Data/Host_Class Quote Link to comment
Neil Pate Posted August 12, 2020 Report Share Posted August 12, 2020 I have never actually tried to use the factory pattern on a cRIO. So much trouble getting it to work properly just under Windows I have never been brave enough. Do you absolutely have to do runtime instantiation using names? Have you tried a static VI reference? Quote Link to comment
Renny Sadala Posted August 12, 2020 Author Report Share Posted August 12, 2020 I'm coding some pretty complex software. That's why I choose the object-oriented approach. And the factory pattern will help to achieve the flexibility that i need. Quote Link to comment
Neil Pate Posted August 12, 2020 Report Share Posted August 12, 2020 Sounds interesting. Sorry I have never tried to dynamically load classes in RT, I have enough trouble these days just getting normal code to deploy without stupid un-explainable errors in LabVIEW. For some reason my RT VM is not cooperating and I cannot copy any files across to test. Have you tried to load a very simple class? I presume you have some kind of HAL with inheritance? Maybe the error is because it is missing some dependencies? (I know error 7 is missing file though, as you mentioned). Have you tried loading the class with the 0x10 option? Quote Link to comment
JKSH Posted August 13, 2020 Report Share Posted August 13, 2020 5 hours ago, Neil Pate said: For some reason my RT VM is not cooperating and I cannot copy any files across to test. As a workaround, you can transfer files into a USB stick from your host, and then attach the stick to your VM. Quote Link to comment
Renny Sadala Posted August 13, 2020 Author Report Share Posted August 13, 2020 I resolved my issue. I must placed my la class file (.lvclass) on the root of the folder /home/lvuser/natinst/bin/ that is the default directory that the RT reads. Quote Link to comment
Neil Pate Posted August 13, 2020 Report Share Posted August 13, 2020 I am not sure I follow you. Are you saying an absolute path on RT does not work when trying to load the class from disk? Can you not load the class from the /C/ or similar? That seems weird! Quote Link to comment
Renny Sadala Posted August 13, 2020 Author Report Share Posted August 13, 2020 (edited) Previously, i loaded the folder containing my all classes (for example the folder Host_Class). I had placed this folder in the path /home/lvuser/natinst/bin/. I.e I will had /home/lvuser/natinst/bin/Host_Class Now, i place directly my classes in the path /home/lvuser/natinst/bin/ and not via a directory like Host_Class. Apparently, By default, when RT target runs, the reading is limited only to the path specified in the RT target properties. In my case, this path is /home/lvuser/natinst/bin/ Edited August 13, 2020 by Renny Sadala Quote Link to comment
Jordan Kuehn Posted August 14, 2020 Report Share Posted August 14, 2020 18 hours ago, Renny Sadala said: Previously, i loaded the folder containing my all classes (for example the folder Host_Class). I had placed this folder in the path /home/lvuser/natinst/bin/. I.e I will had /home/lvuser/natinst/bin/Host_Class Now, i place directly my classes in the path /home/lvuser/natinst/bin/ and not via a directory like Host_Class. Apparently, By default, when RT target runs, the reading is limited only to the path specified in the RT target properties. In my case, this path is /home/lvuser/natinst/bin/ You might check the folder permissions for the folder you created. I have ran into issues with that before. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.