Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

compactrio

 
the system I am working on has a fpga vi running on an analog input module.  I have a real time vi running on the compact rio controller.
I also have a vi to run on the pc.  the real time vi and the pc vi are basically the same.  I would like to let the real time vi run, retrieving data from the analog module and doing some processing.  I like to take the data generated in the real time vi and read it with a VB6/Measurement studio program.  I think what I need to do is get the processed data into shared variables and then use the datasocket server to read the data into vb6/ms.  I have not been able to get any of that to work up to this point.  Can anyone point me in the right direction?
 
Thanks.
 
JFM
 
 
0 Kudos
Message 1 of 6
(8,370 Views)
JFM,

Using DataSocket and Shared Variables is the correct method for communicating between VB6 and LabVIEW.  You can use the standard DSReader example that ships with Measurement Studio to read Shared Variables.  However, you must use the 'psp' protocol to access the Shared Variables.  Your connection string should have a format of "psp:\\IP_Address\Library\Variable_Name".  Where "IP_Address" is the location of the machine, "Library" is the LabVIEW Library where the Shared Variable resides, and "Variable_Name", is the name of the Shared Variable.  You should see this connection string when your Shared Variables are published from LabVIEW.  I am attaching an example that demonstrates reading Shared Variables from VB6.

Let me know if you have any further questions.

Thanks,

Tyler Tigue
Applications Engineer
National Instruments

Message Edited by Tyler T. on 03-09-2006 11:19 AM

Message Edited by Tyler T. on 03-09-2006 11:19 AM

0 Kudos
Message 2 of 6
(8,366 Views)
Tyler,
Thanks for the code.  I can now read a shared variable with vb6 and measurement studio.  I have one more problem to solve regarding a Real Time shared variable residing on a CompactRIO controller.  If I configure that shared variable to be network published, I get an error in the Real Time vi, and no data is written to the variable.  I am now working with Tech Support to resolve this.  Thanks again.

John

0 Kudos
Message 3 of 6
(8,351 Views)

Dear Tyler,

I am afraid this request would be so late,

but to me a very urgent matter.

I cannot temporarily open the attached vi because

I've not yet had version up to 8, so could you

send me a down-versioned(7.1)?

This is for a running manufacturing line to production

flow improvement. Using LabVIEW is my fastest

resolution in software development.スマイリを挿入する

Any of your prompt actions will greatly help me.

Regards,

Tom Ito

   

Tom(Tomoya) Ito, Japan
0 Kudos
Message 4 of 6
(8,153 Views)
Tom,

The shared variable was not introduced until LabVIEW 8.0.  So if you do not have LabVIEW 8.0 or greater, then it will be impossible to use shared variables for your application.

If you have Measurement Studio for Visual Basic 6 and LabVIEW 7.1, then you can use data socket to communicate between the two applications.  There are several data socket examples in LabVIEW (search for "data socket" in the Example Finder).  Data socket examples for Measurement Studio can be found in <National Instruments>\MeasurementStudio\VB\Samples\DataSocket.  I hope you will find that it is not too difficult to communicate between LabVIEW and Measurement Studio using data socket.  In fact, you can still use the VB 6 portion of my example, but be sure to use "dstp" in the connection string instead of "psp" because you are using the data socket protocol instead of the shared variable protocol.

Regards,

Tyler Tigue
0 Kudos
Message 5 of 6
(8,141 Views)

Hi Tyler, 

 

Can you send me your VB project file. 

 

Thanks

0 Kudos
Message 6 of 6
(6,270 Views)