LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Automation Reference or Class in ActiveX Issue

Solved!
Go to solution

Hi, I’m trying to control a piece of external hardware called a Wallac PerkinElmer Envision Plate Reader using ActiveX.  The hardware comes with control software which works great, and extensive activeX controls.  The manual, which I have attached 2 versions of, indicates that every facet of the control software can be instead controlled via ActiveX control.  I see all the ActiveX reference components in the ActiveX class lists, can see properties and invoke methods, but am having some issues.  

 

I can do some simple things and they work.  For example, I can Open an Automation reference to “Envision 112. WMLR4 System Server”, invoke the function UnLoadPlate(), close the reference.  When I run this, the plate door to the machine opens and the plate is ejected as intended.

 

I can also log into the SQL database using the “Envision112. WMLR4SysDataAdv” reference, login with the username and password credentials, Initiate the system server, and pull information out of the database for simple things. 

 

However, I am having trouble crossing classes?…not sure how to describe it properly. 

 

What I am trying to actually do is, using active X, call a protocol from the database using either the protocol name or the protocol ID, create a new assay under system server, and start that assay.  Unfortunately to do this I have to Open the SQL database, pull the protocols, and then somehow pass those data/information into the “Envision112.WMLR4SDAssayProlocol” reference type, then pass that into the invoke method CreatAssay() under WMLR4 System Server. 

 

This is the piece of code I’m trying to translate (outlined as an example in the manual written in VB 2006)…

Code sample for starting an assay with System Server

 

' Declare necessary com objects

Private WithEvents m_SS As EnVision112.WMLR4SystemServer

Private WithEvents m_CurAssay As EnVision112.WMLR4Assay

Private m_SDA As EnVision112.WMLR4SysDataAdv

 

' Instantiate them

Set m_SS = New EnVision112.WMLR4SystemServer

Set m_SDA = New EnVision112.WMLR4SysDataAdv 

m_SDA.Logon "MLR4Admin", "MLR4Admin"

m_SDA.Init m_SS       ‘The SystemServer definition is a new feature of the EnVision112.dll

 

 

Private Sub StartAssay()

  Dim p As EnVision112.WMLR4SDAssayProtocol

  Dim Assay As EnVision112.WMLR4Assay

  On Error Resume Next 

 

  ' the system status can be requested

  ' If m_ss.InstrumentState = 4 or m_SS.InstrumentState = 5 then

       msgbox “Status is Idle”

  ' End if

 

  ' get the protocol to run from the database

  Set p = m_SDA.AssayProtocols("Protocol name or ID")

  ' create the assay to run on system server 

  Set Assay = m_SS.CreateAssay(p)

  If Not Assay Is Nothing Then

    ' start the given assay

    Assay.Start

  End If

  

My main issue is I don’t know how to connect the left part on my Vi (see attached vi or screenshot) to the right side of it.  I can invoke the method “getProtocols” from the System Data Advanced SQL server, which should pull all protocols from the DB.  But this getProtocols() function returns ADODB recordset type of data and I need to be able to feed that into the reference for WMLR4SDAssayProtocols Property, which only accepts a WMLR4SDAssayProtocols type automation reference. Similarly in can try and pull AssayProtocols() from properties from the initiated System Data Advanced server, but this only returns a cMovCollection output and I have the same issue with connecting this to WMLR4SDAssayProtocols.

 

I have searched through every function and property I could think of to see if something would take an ADODB reference as an input and WMLR4SDAssayProtocols reference as an output and no such luck.  I have contacted the company as well and am still waiting on a response.  It’s probably going to be hard for you to open the Vi meaningfully as you don’t have the reference libraries installed needed to see things live.  But any suggestions would be appreciated been trying to figure this out for a week and am going nowhere.   

 

I have attached 2 software manuals for automation integration of the plate reader.  One of them is a newer version but still has most of the same commands and definitions.  I have attached a pic of my vi in its current state, and shot of the database i'm pulling. Any help is appreciated.

0 Kudos
Message 1 of 2
(2,531 Views)
Solution
Accepted by topic author acidburn

SOLVED it...

Vi posted attached.  Used property node function Assay Protocols(), returning a cMov collection.  Pumped that into a cMov collection item, and input the index value. The index number corresponds to the protocol in the Array of protocols returned by the Assay Protocols() function/property node.  Log into the SQL database, and find which protocol ID corresponds to what the array position should be..(ie the first protocol is 0, the second in the SQL list is 1, so on and so on).  This is the index number of the cMov item and was the critical step in linking these 2 halves of my vi.  Match that index number with the Protocol ID number, (also only visible in the SQL database, dbo.protocols).  Convert the variant output of cMov collection to data, and match the input type Automation reference class WMLR4SDAssayProtocols.  

 

I want to stress it's not possible programming an Envision Plate reader without using an SQL database viewing tool and logging in with the hardware credentials to see the database. Input items for many of the hundreds of functions are simply provided nowhere else.  

 

Really obscure issue I know but maybe some day someone will be trying to do this and can avoid pulling their hair out.  

 

Thanks.

0 Kudos
Message 2 of 2
(2,365 Views)