Re: [Tutor] Hello! Questions

2016-02-19 Thread Marco Soldavini
On Fri, Feb 19, 2016 at 3:32 PM, Peter Otten <__pete...@web.de> wrote: > > > Also, after reading http://openopc.sourceforge.net/api.html I wonder if it > wouldn't be better to go with the timestamp provided by the server > > bool1.append(opc.read(".watchdog")) > yes but my next

Re: [Tutor] Hello! Questions

2016-02-19 Thread Peter Otten
Marco Soldavini wrote: Random remarks about your code: > #While loop - scanning and storing OPC values at scan rate > while (abort == 0): The loop continues to work if you change it to while True: > # ESC pressed? > if msvcrt.kbhit() and ord(msvcrt.getch()) == 27: > abort = 1

Re: [Tutor] Hello! Questions

2016-02-19 Thread Alan Gauld
On 19/02/16 07:51, Marco Soldavini wrote: > Sorry, Here my code in plaintext > ... thanks >> Better is to use a dictionary with your "variables" >> data[keyName].append(value) > Ok so I will look more into dictionaries, it is like hash tables? Exactly. -- Alan G Author of the Learn to Progr

Re: [Tutor] Hello! Questions

2016-02-19 Thread Marco Soldavini
Sorry, Here my code in plaintext #While loop - scanning and storing OPC values at scan rate while (abort == 0):     # ESC pressed?     if msvcrt.kbhit() and ord(msvcrt.getch()) == 27:         abort = 1         break     # Server up     if opc.ping():         if opc['.run_batch'] == True and re

Re: [Tutor] Hello! Questions

2016-02-18 Thread Alan Gauld
On 18/02/16 21:17, Marco Soldavini wrote: > *# While loop - scanning and storing OPC values at scan rate **while *(abort == 0): > > > *# ESC pressed? **if *msvcrt.kbhit() *and *ord(msvcrt.getch()) == 27: > abort = 1 > > As you can see your code is all messed up. You need to post

Re: [Tutor] Hello! Questions

2016-02-18 Thread Marco Soldavini
On Wed, Feb 17, 2016 at 11:13 AM, Alan Gauld wrote: > > My first question is about data types, data structures in general and how > > to organize an efficient loop for recording data. > > > while (stop condition false) > >read data > >write data into local array or something > >wait

Re: [Tutor] Hello! Questions

2016-02-17 Thread Alan Gauld
On 16/02/16 20:19, Marco Soldavini wrote: > Is this the right place to knock down problems one by one? Yes, although we are limited in scope to Python language and standard library so for anything specific to openopc you will probably need to ask on its support forum/list. > I already tested thi

[Tutor] Hello! Questions

2016-02-17 Thread Marco Soldavini
Hi, I am almost new to python and I am trying to build a not so easy app (but very neat and useful) related to industrial automation. Is this the right place to knock down problems one by one? Basically my app has several interactions but the most important is reading values from an embedded machi

[Tutor] Hello! Questions

2016-02-17 Thread Marco Soldavini
I hit the send button too early. anyway Basically something like while (stop condition false) read data write data into local array or something wait sample time Thanks marco ___ Tutor maillist - Tutor@python.org To unsubscribe or change