Jump to content

Custom Lung Simulator under LabVIEW control


PeterB

Recommended Posts

G'day fellow wire workers,

where I work, we own a few of these nifty Breathing Simulators: http://www.ingmarmed.com/asl5000.htm

In the process of customising their operation I will be integrating some external feedback modelling previously developed in a language called VisSim.

VisSim does have a rather archaic and clunky user interface, but at the time the lung models were written, LabVIEW really only had the GSim toolit to offer (GSim could do the job, but this kind of modelling was VisSim's forte and plus the person involved probably didn't look too hard into the GSim option at the time).

After much discussion, my proposal was to write a LabVIEW ActiveX server which could be called up from VisSim thus allowing easier upgrade paths for the lung models, while also retaining the existing look and feel of the VisSim GUIs.

This post is to share a learning experience with you in the world of ActiveX servers, just in case you ever have to take a similar journey and plus, I simply could not find any worked examples on any of my usual LabVIEW search sites (Searchview, ni.com etc). It's also possible that by reading the LabVIEW user manuals (which I surely did!), others may say "well that was obvious", but to me it wasn't - so here goes.

I assumed that the ActiveX server would allocate memory for its output parameters, however it is necessary to reserve space on the input side at the client level. It took me about 2 days to nut this one out. As reiterated recently on Info-LabVIEW, a Picture/LabVIEW diagram is worth 1000 words so I'll let you look at it and see if it's how you would have done it.

post-1272-1114754169.png?width=400

post-1272-1114756411.png?width=400

post-1272-1114756103.png?width=400

post-1272-1114756106.png?width=400

Maybe I could forego all the variant conversions, but at least I got rid of all the coercion dots. If anyone can show me where the manual mentions having to reserve memory please let me know (without referring to all the VB , .NET or Visual C examples, 'cause I'm a LV diehard!!)

One other thing I wanted to try was to see which method is faster for transferring data "Call2" or {setcontrolvalue,run,Getcontrolvalue}. I'll post back my results after testing the relative speeds.

Anyway, knowing that this now works for me in principle, it should hopefully be easy to call an ActiveX server I write in LV from VisSim.

regards

Peter Badcock

Validation Engineer

Certified LabVIEW Developer

Product Development

ResMed Ltd.

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.