Mass Compilers

cancel
Showing results for 
Search instead for 
Did you mean: 

.LVclass

Hi All:

I am trying to create a Labview class for RS-485 Master side communication.  I would like to use as much as code possible from an already developed  Labview class for  RS-485 Slave side... My question is How do I create a copy this slave side .lvclass so that I can make changes to it to make it master side .lvclass... There are virtual folders in the class.. I tried copying the whole class files (.VIs files) into a folder but when I open in LV, all the links are referencing to old one... How do I detach these two...

regards,

Leela.

0 Kudos
Message 1 of 3
(5,459 Views)

Hello Leela,

What are the methods from RS-485 Master that you want to copy into RS-485 Slave?  What do you need to do to these methods to modify them to work on the Slave side?  Depending on the answers to those two questions you may want to create an RS-485 parent class and make Master and Slave children of this parent.  That way you can give parent all the shared abilities as dynamic dispatch methods and then override the methods that need to be modified per Master/Slave in the children classes.  The goal of LVOOP is to reduce code duplication, so if you find yourself copying and pasting out of a Class then it should be a red flag that there is a better way to solve the problem.

-Jon

0 Kudos
Message 2 of 3
(3,791 Views)

Some examaple: In the Communication Protocol, few layers (Physical and Link Layers; ) are same  for Master and  Slave;  these are the methods I want to copy from Master to Slave... Network and Presentation layer implementation is different for Master and Slave, so I need to modify them to work on the slave side... I like your idea of creating a Parent Communication class and Master and Slave as child classes... Could you tell me how I place methods in the labview project structure for below scenario.

Physical Layer_Comm.VI and LinkLayer_comm.Vi common for Master and Slave

Presentation Layer_Comm.Vi and NetworkLayer_Comm.VI have different implementation on the Master and Slave...Could you please explain me how I dump these VIs in the project structure between 3 classes...

Thanks for your help.

Leela.

0 Kudos
Message 3 of 3
(3,791 Views)