Jump to content

What Design Pattern should I use (this is very basic)


Recommended Posts

Hello All

I have been away from LV programming for some time other than some quick DAQ stuff to solve a problem , well , I am back into a couple of projects and since I am starting anew I will go the LVOOP route. I used LVOOP in its early days and drove Stephen nuts back then , so , to spare him even more frustration I will ask the experts here. This is very basic , but , my memory isn't so good anymore so I need a re-fresher.

What I am doing is taking data using my DAQ Class from three sensors , Temperature , Flow and DUT output , I need to do a little processing on the data and was going to have each type be its own class , especially since I am sure the sensors and processing will change down the road. But , as I got into it , no matter what route i went down (via LVOOP) it seemed to be awkward whatever way i was approaching it and stopped and decided to see what you guys suggest , I know it is very basic but what is the best approach (design pattern) to use for something this simple.

In addition to the processing the data I also need to Graph it , save it to file etc... all the usual stuff we do with data...

thoughts...

Dan

Edited by Dan Bookwalter N8DCJ
Link to comment

Hello All

I have been away from LV programming for some time other than some quick DAQ stuff to solve a problem , well , I am back into a couple of projects and since I am starting anew I will go the LVOOP route. I used LVOOP in its early days and drove Stephen nuts back then , so , to spare him even more frustration I will ask the experts here. This is very basic , but , my memory isn't so good anymore so I need a re-fresher.

What I am doing is taking data using my DAQ Class from three sensors , Temperature , Flow and DUT output , I need to do a little processing on the data and was going to have each type be its own class , especially since I am sure the sensors and processing will change down the road. But , as I got into it , no matter what route i went down (via LVOOP) it seemed to be awkward whatever way i was approaching it and stopped and decided to see what you guys suggest , I know it is very basic but what is the best approach (design pattern) to use for something this simple.

In addition to the processing the data I also need to Graph it , save it to file etc... all the usual stuff we do with data...

thoughts...

Dan

From my experience that is a good sign.

In order to avoid Highly Coupled objects, we have to do some things that seem awkward in a non-LVOOP context. I have a set of hardware Classes that can have different channel types. So the agregating class has an array of channels that can vary depending on which flavor of hardware i am using today. Since the parent hardware classes do not know what kind of cchannles their children will have, the channels seem distant and useless in the parent classes. This is actually good (I think) becuase this is a lack of coupling and makes the parents flexible.

Now the children that know what type of channels they expect are responsible for interacting with the channel detials so they have to do thing like casting the channel classes such that they can invoke the method appropriate for each.

THe "Factory" Design pattern maybe good for you to look at.

Ben

Link to comment

Hello All

I have been away from LV programming for some time other than some quick DAQ stuff to solve a problem , well , I am back into a couple of projects and since I am starting anew I will go the LVOOP route. I used LVOOP in its early days and drove Stephen nuts back then , so , to spare him even more frustration I will ask the experts here. This is very basic , but , my memory isn't so good anymore so I need a re-fresher.

What I am doing is taking data using my DAQ Class from three sensors , Temperature , Flow and DUT output , I need to do a little processing on the data and was going to have each type be its own class , especially since I am sure the sensors and processing will change down the road. But , as I got into it , no matter what route i went down (via LVOOP) it seemed to be awkward whatever way i was approaching it and stopped and decided to see what you guys suggest , I know it is very basic but what is the best approach (design pattern) to use for something this simple.

In addition to the processing the data I also need to Graph it , save it to file etc... all the usual stuff we do with data...

thoughts...

Dan

A design pattern may be appropriate here. (Keep in mind not everything warrants a design pattern.) If what you want to do is, for example, process data appropriately for each type of sensor, or graph the results, or save it, and the algorithm varies according to the type of sensor, then consider the Strategy Pattern.

Link to comment

But , as I got into it , no matter what route i went down (via LVOOP) it seemed to be awkward whatever way i was approaching it and stopped and decided to see what you guys suggest

Can you describe the route you went down and what seemed awkward about it?

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.