Test and Measurement Forum

streaming data to Excel

Post any questions you may have about our current range of USB data loggers

streaming data to Excel

Postby richardgriffin » Tue Jan 24, 2012 3:12 pm

I am building a test system that measures the output of a sensor as a voltage with a Picolog 1216 (using one input channel). The device being tested is put through its paces by a pneumatic actuator driven by a PLC. The PLC also generates a trigger signal to another channel on the Picolog. I am running PLW Recorder and calculating a third data output from the input voltage. (Actually measuring a gas pressure).
The test runs for 26 seconds, taking 2600 readings which are transferred to the Pico spreadsheet window at the end of the test and displayed as four columns of readings (Time, trigger voltage, sensor voltage, pressure) in the spreadsheet window. The user then copies and pastes the data to another excel spreadsheet for analysis.

I'd like to automate the data transfer process but I'm not a software engineer. I can use DDE to transfer live data to one excel cell but haven't got it to tranfer the whole formatted data array. Is there a simple application that can do this for me or am I going to have to learn to write software?
richardgriffin
Newbie
 
Posts: 0
Joined: Tue Jan 24, 2012 2:55 pm

Re: streaming data to Excel

Postby Martyn » Wed Jan 25, 2012 8:27 am

If you download the sdk for this device there is an Excel VBA example which should help you to do what you want with a little tweaking.

The sdk can be downloaded from http://www.picotech.com/software.html by selecting PicoLog 1216 at Step1 and the Software Development Kit R10.1.1.1 at Step2
Martyn
Technical Specialist
Martyn
Site Admin
Site Admin
 
Posts: 2355
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: streaming data to Excel

Postby richardgriffin » Fri Feb 10, 2012 9:49 am

Thanks for this, got the Excel VBA example working fine as far as transferring data is concerned, without too many problems.
Now I want to go on and use the digital outputs to turn indicator lights on and off but I'm having trouble using the pl1000SetDo routine within the Excel macro. It doesn't seem to matter where in the program I put the pl1000SetDo routine or how I declare the variables I cannot get the Picolog 1216 to react. Analogue signals into Ch0 are logged into the spreadsheet correctly whenever I use a routine that runs but D0 never changes (or it does so quickly and I can't see what is happening - I'm monitoring it with a DVM).

Can anyone give me hints on syntax or a simple routine to activate the digital output?

Alternatively, just to build up confidence, is there any way of connecting a terminal emulator to the selected COM port and driving the Picolog directly with Command instructions?

I'm a hardware engineer thats struggling with software.
richardgriffin
Newbie
 
Posts: 0
Joined: Tue Jan 24, 2012 2:55 pm

Re: streaming data to Excel

Postby Martyn » Fri Feb 10, 2012 10:43 am

The declaration should be something like

Code: Select all
Declare Function pl1000SetDo Lib "pl1000.dll" (ByVal handle As Integer, ByVal state As Integer, ByVal channel As Integer) As Long

If this isn't working post your code here and we can take a look.
Martyn
Technical Specialist
Martyn
Site Admin
Site Admin
 
Posts: 2355
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: streaming data to Excel

Postby richardgriffin » Fri Feb 10, 2012 4:27 pm

Thanks for the example code, made me look again at the syntax I was using and the names I was giving to variables.

I think I made the mistake of using the same name for a variable that the compiler was using as a place-holder which stopped the program compiling correctly.

Everything does what I want it to now.
richardgriffin
Newbie
 
Posts: 0
Joined: Tue Jan 24, 2012 2:55 pm


Return to USB PC Data Loggers

Who is online

Users browsing this forum: No registered users and 0 guests