Search found 9 matches

by atnilag
Sun Nov 03, 2013 11:42 pm
Forum: Pre-Sales Advice
Topic: picolog current data logger python cod
Replies: 16
Views: 15381

Re: picolog current data logger python cod

Hi Martyn
Now that this is working, is there a way to do the same on a Linux box?
As the dll is a windows dll, I can't see how this can work, or am I wrong
Roland
by atnilag
Sun Nov 03, 2013 2:54 pm
Forum: Pre-Sales Advice
Topic: picolog current data logger python cod
Replies: 16
Views: 15381

Re: picolog current data logger python cod

Hi Martyn, at long last, the last hint was great, it is working now and i can now build my application. Thanks for your help. Roland My code: import ctypes from ctypes import * from time import * import numpy as np intermed2=[] from ctypes import * values = np.zeros( (1,), dtype=np.int16) i=0 handle...
by atnilag
Thu Oct 31, 2013 1:53 pm
Forum: Pre-Sales Advice
Topic: picolog current data logger python cod
Replies: 16
Views: 15381

Re: picolog current data logger python cod

Hi Martyn i have changed the code (see below) but i am still getting exceptions. i am only using the values in the GetValue calls and nowhere else. i am sorry to be such a pain. Roland import ctypes from ctypes import * from time import * import numpy as np values = np.zeros( (9,), dtype=np.int16) v...
by atnilag
Thu Oct 31, 2013 10:23 am
Forum: Pre-Sales Advice
Topic: picolog current data logger python cod
Replies: 16
Views: 15381

Re: picolog current data logger python cod

Hi Martyn, i have implemented your last suggestion but it creates an exception import ctypes from ctypes import * from time import * import ctypes import numpy as np from ctypes import * value = np.zeros( (9,), dtype=np.int16) i=0 handlePointer = c_short() mydll = ctypes.windll.LoadLibrary('PLCM3.dl...
by atnilag
Thu Oct 31, 2013 9:23 am
Forum: Pre-Sales Advice
Topic: picolog current data logger python cod
Replies: 16
Views: 15381

Re: picolog current data logger python cod

Hi Martyn,
i think the problem might be with the definition of my value variable, i have defined it as an integer, but i think the dll wants to return an array. but I am not sure how to resolve this.
thanks

Roland
by atnilag
Thu Oct 31, 2013 8:54 am
Forum: Pre-Sales Advice
Topic: picolog current data logger python cod
Replies: 16
Views: 15381

Re: picolog current data logger python cod

Hi Martyn, i really appreachiate your help in this, i have started coding in pythen about a year ago an this is the first time i have come across accessing external hardware. i have added a 5 second sleep command between setting the channel and requesting the data but as a result i am getting an acc...
by atnilag
Wed Oct 30, 2013 3:55 pm
Forum: Pre-Sales Advice
Topic: picolog current data logger python cod
Replies: 16
Views: 15381

Re: picolog current data logger python cod

Hi Martyn, thanks for the quick reply, i have now changed my code to the following: import ctypes from ctypes import * value=0 handlePointer = c_short() mydll = ctypes.windll.LoadLibrary('PLCM3.dll') status = mydll.PLCM3OpenUnit(byref(handlePointer), 'AP853/071') print 'open unit status:',status if ...
by atnilag
Wed Oct 30, 2013 3:03 pm
Forum: Pre-Sales Advice
Topic: picolog current data logger python cod
Replies: 16
Views: 15381

Re: picolog current data logger python cod

Hi Martyn i have changed the code as follows: import ctypes value=0 i=0 mydll = ctypes.windll.LoadLibrary('PLCM3.dll') mydll.PLCM3CloseUnit('AP853/071') status = mydll.PLCM3OpenUnit('AP853/071', 0) if status==0: print 'unit accessed' mydll.PLCM3SetChannel('AP853/071', 2, 1) status = mydll.PLCM3SetCh...
by atnilag
Tue Oct 29, 2013 7:33 pm
Forum: Pre-Sales Advice
Topic: picolog current data logger python cod
Replies: 16
Views: 15381

picolog current data logger python cod

Hi All, i have just purchased a picolog current data logger and want to write an application in python. i have got some basic code: import ctypes value=0 i=0 mydll = ctypes.windll.LoadLibrary('PLCM3.dll') mydll.PLCM3CloseUnit('AP853/071') status = mydll.PLCM3OpenUnit('AP853/071', 0) if status==0: pr...