Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 23rd, 2024, 12:00 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: wait(approximately)
PostPosted: August 27th, 2008, 10:30 am 
Offline

Joined: November 25th, 2004, 1:24 pm
Posts: 512
Location: Scotland
Opus: 9.75
OS: Win 10
System: Asus i7-7700K 16Gb
I have an application running in real time which is measuring the temperature of a moulding tool.
The user can set the number of samples and the delay between samples.
I have a 'for' loop which has a wait() in the loop. I find that the wait time is variable, for example the user may set 100 samples, one every 10 seconds, but it seems to double the wait period to about 20 seconds.....but not every run, sometimes just the first wait?
I have a Debug trace (shows the loop count and the expected delay time), before and after the wait and a clock running to measure the delay, so I can 'calibrate' the wait. I have a ticker running in the background, but only at 1S interval. there is nothing really demanding in the application. I thought Opus was multithreaded, so a wait should be independent of other things.

If I reduce the problem to a simple script with loop and delay, it's OK.

Has anyone seen a problem like this before??

_________________
Whoever designed this, never actually used it!


For this message sandyn has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Yes, same problem
PostPosted: August 30th, 2008, 4:08 pm 
Offline

Joined: December 11th, 2004, 12:51 am
Posts: 36
Location: UK
Just to say, yes, I've got this problem on my latest project.

Opus script actually says "Function not found:check spelling and capitalisation" when it gets to a perfectly OK line saying:
wait(1)

I used the same solution as you and it works fine.

Thanks for the work-around.

Has this been fixed in later releases?.....I'm a bit behind the times with v4.5.

/Mark

Opus Pro v4.5


For this message markatnicebrook has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: August 30th, 2008, 5:37 pm 
Offline

Joined: November 25th, 2004, 1:24 pm
Posts: 512
Location: Scotland
Opus: 9.75
OS: Win 10
System: Asus i7-7700K 16Gb
I found a workaround, basicaally I insert 10 'wait(T/10)'. The problem seemed to happen mainly on the first time round the loop, then the delay settled. so inserting 10 delays of a tenth of the time has minimised the error. Everything points to the wait statement just not working properly, but I've never seen this happen before, so I think there is something really stupid in my code which I'm missing.

Function not found:check spelling and capitalisation is normally where a function is called, but doesn't exist.

I'm not sure what you did to cure your problem?? I would be interested to know.

Sandy

_________________
Whoever designed this, never actually used it!


For this message sandyn has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: August 30th, 2008, 8:28 pm 
Offline

Joined: December 11th, 2004, 12:51 am
Posts: 36
Location: UK
Sorry Sandyn,

Appologies for the confusion - it looks like I've replied to the wrong post, although it may be related to your problem:

My problem is that wait() just does not work!

After much sifting through the forum, I found a few posts where the wait() script was a problem - your's plus one other. I should have replied to the other. My error.

The post I meant to reply to (not sure how to put in a link) is named
'Wait function does not work' in the Basics forum.

The solution I used, was basically as suggested in that post, which was to:

- add an object to your page (say a frame with nothing in it) named, say, Frame_wait_solution

- then instead of using:
wait(2)
use:
Frame_wait_solution.SetTransparency(100,2,true)

i.e. it changes the frame transparency over 2 seconds and waits for the action to complete before carrying on to the next action....same as just waiting for 2 seconds.

This worked well for me.

I know this is not the same as your problem, as your's seems to be the timing, whereas mine was wait() not working at all, but it could be worth a try and check to see if your timings improve?

Regards
Mark


For this message markatnicebrook has been thanked by : mackavi


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 23 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group