Test and Measurement Forum

Picolog 1012 with Matlab

Post your MATLAB discussions here

Re: Picolog 1012 with Matlab

Postby SE21733 » Wed Oct 17, 2012 12:54 pm

Thanks for the reply Hitesh. Indeed unloadlibrary solve the problem :)

I figuring how to get the value from the the data logger and display in on command window in Matlab.

what is the different between pl1000GetSingle and pl1000GetValue and why the latter does not have channel arguments.

how to define the channel when using pl1000GetSingle

appreciate for any helps

thank you so much.
SE21733
Newbie
 
Posts: 0
Joined: Fri Oct 05, 2012 12:42 am

Re: Picolog 1012 with Matlab

Postby Hitesh » Wed Oct 17, 2012 3:51 pm

Hi,

This is being answered through the Helpdesk system.

Edit

Following advice was given:

The programmer's guide provides a description of the functions.

pl1000GetSingle (section 3.3.3) - this just returns a single value reading for a specific channel

pl1000GetValues (section 3.3.5) - this returns an array of sample values. Depending on the channels that you select, the values will be interleaved.

e.g. if Channel 1, 2, 3 and 4 are enabled, the values in the buffer will be as follows:

[ch 1, ch 2, ch 3, ch4, ch 1, ch 2, ch 3, ch4, ch 1, ch 2, ch 3, ch4, ...]

To define the channel when using pl1000GetSingle simply use the channel number e.g. channel = 1. PL1000_INPUTS is an enumeration but you can use the numerical equivalent. Enumerations can be accessed if a prototype file is used but it might be easier for you to use the former approach.

It might be worth looking at the C code example in the SDK to help understand the sequence of function calls. Also, one of the other forum threads should give you some more guidance:

http://www.picotech.com/support/topic10797.html

Regards,
Last edited by Hitesh on Thu Oct 18, 2012 10:39 am, edited 1 time in total.
Reason: Update to message
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2058
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: Picolog 1012 with Matlab

Postby fthgngr55 » Thu May 01, 2014 10:59 pm

hi SE21733

i have same Project. can tou share your m files .. did you fixed your problems.?..

thanks
fthgngr55
Newbie
 
Posts: 0
Joined: Thu May 01, 2014 10:52 pm

Re: Picolog 1012 with Matlab

Postby Hitesh » Fri May 02, 2014 8:02 am

Hi,

I will send some files in response to your e-mail to our Support address.

Regards,
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2058
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: Picolog 1012 with Matlab

Postby fthgngr55 » Sat May 03, 2014 7:11 pm

Thank you soo much. hitesh....

i have someone problem about codes.. codes looking very true but giving error .. but i dont know how i can fix this. thats very easy problem..

i am running codes.. and ...

data =

unithandle: 0
nChannels: 1
nSamples: 30000
nSamplesPerChannel: 1000
usForBlock: 1000000
channels: 2
isReady: 0
scaleToMv: 1
maxValue: 0
TRUE: 1
FALSE: 0
pBuffer: [1x1 lib.pointer]
overflow: [1x1 lib.pointer]

??? Undefined variable "data" or class "data.scaleToMv".

Error in ==> pl1000adc2mv at 5
if data.scaleToMv == 1

Error in ==> pl1000_stream_1ch_1ks_30s_trigger_v2 at 65
trigger_threshold = pl1000adc2mv(1000, data.maxValue);


i did control 100 times. data is global looking but..undefined..

what are you think about this??

Regards...
fthgngr55
Newbie
 
Posts: 0
Joined: Thu May 01, 2014 10:52 pm

Re: Picolog 1012 with Matlab

Postby Hitesh » Tue May 06, 2014 9:25 am

Hi,

The scaleToMv parameter was removed from the function arguments but not from the function implementation - you only need to use the following code for converting the raw ADC counts to milliVolts:

Code: Select all
function millivolts = pl1000adc2mv( raw, maxValue )
%PL1000ADC2MV Converts milliVolt value to ADC count for PicoLog 1000 series
%   raw - raw ADC value
%   maxValue - maximum ADC count of the device

    millivolts = (double(raw) * 2500 / maxValue);

end


Hope this helps.
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2058
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Previous

Return to MATLAB

Who is online

Users browsing this forum: No registered users and 0 guests