Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Measurement Studio/LabVIEW interaction

Hello,
I am using Measurement Studio 8.1 on Visual studio c# and LabVIEW 8.5.
I'm interested in knowing whether data types (such as AnalogWaveform, XYCursor etc.) are common between Measurement Studio and LabVIEW.
I'm faced with the task of receiving a 'wave form' from a labview dll and displaying it in a WaveformGraph control in Measurement Studio, The data type required in Measurement Studio seems to be AnalogWaveform, Is there any way of receiving this data type by from a function in a labview dll using c# ?

I asked labview programmer for a function that does this and received this function signiture from him:
void __stdcall BuildWaveform(double frequency, uint16_t signalType, double amplitude, double phase, HWAVEFORM signalOut);

how do i now use this in c# to display the graph ?

Thanks.
0 Kudos
Message 1 of 9
(5,916 Views)

Hello,

One thing you could do to try and handle the waveform data type, is to create another LabVIEW dll which would break that waveform up into its parts (data array, dt, t0) and outputs those instead of a complete waveform.  This might make it easier to handle the data once you get it into C# also.  Despite this I think there is still a way to handle the waveform properly, its just a matter of converting it into something that C# will understand because the data types are actually unique to LabVIEW.  Therefore, even with MeasurementStudio installed, we still have to manipulate the data into a form it can recognize.  I have done some testing with this but I haven't come up with a solid solution so I will try to work on this and post something as soon as I can.

John B.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 9
(5,886 Views)
After some research it seems as though the HWAVEFORM data type is unique to LabVIEW.  Unfortunately the structure of this class is not accessible and therefore the only supported solution to get the data from your LabVIEW dll is to break up the waveform as mentioned in my previous post.  You can either do it in a separate dll or simply modify the original dll you were given, but either way you need to output those pieces from the dll and recombine them in C#.  This post mentions of a couple resources that might be helpful to reference.


Message Edited by herosphro on 03-04-2008 10:42 AM
John B.
Applications Engineer
National Instruments
0 Kudos
Message 3 of 9
(5,875 Views)
Thanks herosphro.
I eventually came to the same conclusion and split the waveform data to get it from the dll.
0 Kudos
Message 4 of 9
(5,872 Views)

HYE....I AM NEW TO MEASUREMENT STUDIO AND AM INTRESTED IN INTERACTION OF LABVIEW AND MEASUREMENT STUDIO...CAN YOU SEND ME THE SAMPLE CODE AS U DESCRIBED ABOVE...???

 

REGARDS

RITTIK.

0 Kudos
Message 5 of 9
(4,756 Views)

Hi Rittik,

 

In order to use LabVIEW and Measurement Studio, you can do two things either A) make a DLL from LabVIEW with the application builder and call it from Measurement Studio, or you can make a DLL in Measurement Studio and call it in LabVIEW.

 

Calling .NET Assemblies From LabVIEW

http://decibel.ni.com/content/docs/DOC-5921

 

Building a .NET Interop Assembly (Windows)

http://zone.ni.com/reference/en-XX/help/371361G-01/lvhowto/building_a_net_assembly/

 

Hope this helps!

Chris T.
Message 6 of 9
(4,736 Views)

Thanks Chris. it  was quite helpful to me..

 

Well  i am seeking some precise documenation with examples for measurement studio but i am unable to find it..the tutorials provide on the site does not tell about all the properties of modules of measurement stuido..So how can i get the relevant theoritical documentation with examples ??

 

Thanks in Advance...!!!!!!!!!!

0 Kudos
Message 7 of 9
(4,693 Views)

Hi RITTIK,

 

We don't have any examples on hand that show how to do the interoperability dll from LabVIEW into Measurement Studio (as this is more of a Visual Studio in general feature). What do you mean by properties of modules?

 

Thanks!

Chris T.
0 Kudos
Message 8 of 9
(4,662 Views)

Hye Chris,

 

Actually i forgot that its a topic about labview/measurement studio  interaction....

Actually  i  want the documentation regarding the proprties of components of measurement studio so that each and every property  can be optimumly used...newys thanks...

0 Kudos
Message 9 of 9
(4,643 Views)