02-22-2010 01:44 PM - edited 02-22-2010 01:45 PM
Mark, i definitely agree with the usefulness of modular code. regarding the 'modular' aspect of this vi, by looking at the screen shot that i posted, any suggestions on how can this be made into a more reuseable code? it is a quite simple vi and the problem is that the data which is being sent is different for each of the 20 vi's i was referring to earlier.
02-25-2010 02:23 PM
02-25-2010 02:32 PM
We have developed a GOOP (developed prior to native LVOOP) object that is essentially a wrapper around the VISA VIs. This object allows our applications to easily support multiple interface types without requiring code modification. In addition, we have developed various methods for this object that allow us to specialize our connectivity tasks. We use quite a few polymorphic VIs (methods) which allow us to have a common API for various types of tasks. For example, we have a polymophoric data write method that will accept a string control, a file path or a file reference as input. It also accepts the connection reference. In this manner we use a common API for our code yet we have the flexibility to have the actual task of transmitting the data behave in different ways depending on our particular need. We also provide separate read and write timeout attributes on our objects. VISA only provides a single timeout value.
With your specific code I would eliminate the port initialization everytime you send data. This should be done once in the beginning and not called for every write.
02-25-2010 02:49 PM
so it seems like sending the data char by char seems to work so far. *fingers crossed*
attached is the screen shot of the vi i had created to do this. i created a vi for the data which is going to be common amongst all vi's and use that as a sub vi for the highlevel vi's. also, the sub vi write..vi writes to the port char by char.
02-25-2010 03:02 PM