DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I read realtime data from a data socket using DIAdem

I am currently routing data from an instrument using LabView 7.1 to a data socket. I was trying to figure out how to access that data in real time in DIAdem through the data socket. Another option would be to use the downloaded LabView/DIAdem VI package, but I haven't figured out how to get that to work either, despite the forums here. I would prefer to access it through the data socket, if possible, as the amount of information being transferred is negligable (a string and a double).
Thank you,
Sinan Sutcu
0 Kudos
Message 1 of 7
(4,081 Views)
Hello,

Unfortunately, DIAdem does not own a datasocket client. For that reason I would recommend to use the toolkit to exchange data between LabVIEW and DIAdem. But if this really is convenient depends on your application.
Since you are talking of "realtime data" it sounds like you are looking for an opportunity to exchange single value data inside a loop with a certain timing.
What do you want to do with the data insisde DIAdem at that moment? Are you trying to synchronise a LabVIEW with DIAdem DAC? There might be a possibility to do this with a Script DAC Block and lowlevel TCP/IP communication; depends on the speed you need.

So, tell me a bit more about what your application is and I will try to recommend a way how you can do it.

regards
Ingo Schumacher
Systems Engineering Manager CEERNational Instruments Germany
0 Kudos
Message 2 of 7
(4,053 Views)

I currently have a GPS unit, which I can only access using a LabVIEW script which pulls the speed of the unit out as a string and a double. I'm basically trying to feed this data to DIAdem, which is also pulling other data from other sensors at the same time. Thus I basically want to have a measurment of the speed at the time of the other measurments. I don't think the update speed has to be that great, possibly not even more then once per second on the slower side. Any suggestions would be appreciated.

Thanks,

Sinan

0 Kudos
Message 3 of 7
(4,037 Views)
If you cannot access the GPS unit from DIAdem directly I would choose the following method to exchange data.
Within the Script DAC block in DIAdem you can connect to ActiveX servers. LabVIEW offers ActiveX server functionality via the VI server methods and properties. This works even with a LabVIEW executable you created with the application builder. Using this interface you can exchange data between frontpanel controls or indicators and the DIAdem script.

Please have a look at the Knowledge Base Calling LabVIEW Applications from Visual Basic Using ActiveX to get an idea how to implement the code.
This man page describes how to activate the server functionmality: Activating LabVIEW as an AcxtiveX server

regards

Ingo Schumacher
Systems Engineering Manager CEERNational Instruments Germany
0 Kudos
Message 4 of 7
(4,035 Views)
Thank you, but also how do I connect to an active X server using DIAdem?
0 Kudos
Message 5 of 7
(4,033 Views)
You have to use one of the ScriptDAC blocks. In your case, as you would like to fetch data from a LabVIEW vi, choose the out of the driver input palette. Inside the configuration dialog you can generate a sample script, which is then copied to the windows clipboard. It contains a lot of function prototypes which will be automatically called later during the measurement.

Basically, the init functions are called during the start of the measurement - here you should connect to the activeX server, the deinit functions are called when stopping the measurement - disconnect from the server here.

Then there is the function SFD_Readchannel, which is called once for eych tact and each channel you configured. Here, you should exchange the data with your VI.

I am attatching an example I wrote to control a LabVIEW vi (doing a counter output operation)- that is why the data exchange works the other way around, but I hope it explains the principle.

Additionally I am adding documentation about the ScriptDAC driver interface.

Regards
Ingo Schumacher
Systems Engineering Manager CEERNational Instruments Germany
Download All
0 Kudos
Message 6 of 7
(4,026 Views)
My DIAdem instillation made it so the dll files were not active, and I was wondering which DLL files i need to correctly run the DAC scripts.
0 Kudos
Message 7 of 7
(3,993 Views)