Remote Timer Start and Stop

About Truespace Archives

These pages are a copy of the official truespace forums prior to their removal somewhere around 2011.

They are retained here for archive purposes only.

Remote Timer Start and Stop // Archive: Tech Forum

1  |  

Post by 50CalCrazy // Feb 21, 2007, 9:59am

50CalCrazy
Total Posts: 16
I am trying to develop a timer activity that allows me to start a timer remotley using a Control In input. I am able to create an activity that will start a timer, but at this time I am limited because I am forced to use a manual operation whereby I push a "Start" button. I need to be able to start the time using a Control In or some other remote triggered input. Does anybody have one? Or know how to do this?


I have already tried dissassembling the Engine provided in the Base Activities library and it will not work. The Control In input for this engine goes internal to the engine to operate a VBScript object for initial time into the Tom Interpolater.


My goal is to be able to control multiple timers which will then in turn be the drive motors for robotic axis. I will have 10 separate axis with complete autonomous control and trying to use one timer to run them all will not work.


My ultimate goal is to create an interactive robot simulator for the semiconductor industry equipment my company sells. We will be using it in our training program.

Post by trueBlue // Feb 21, 2007, 12:40pm

trueBlue
Total Posts: 1761
pic
It sounds like you need Offsets or maybe Triggered Loop. You have Dele's Triggered switches shown, do you have his Offsets too? I hope that he does not mind but here is a link to his web site that has all his tools that he made with trueSpace7 and shows instructions on how to use them.
http://www.deledesigns.com/index.htm (http://www.deledesigns.com/index.htm)

Post by 50CalCrazy // Feb 21, 2007, 1:29pm

50CalCrazy
Total Posts: 16
Hi trueBlue,


I want to be able to start the timers using triggers such as those shown in the capture of my posting. For example, I have a robot arm that I want to raise for 3 seconds, move left for 5 seconds, move right for 4 seconds and then down for 2 seconds.


At the same time, I have a robot leg that will move forward 1 second, then stop. Then move back for one second and stop.


These two robot components will be moving at the same time. I have tried using just one timer to control all of this movement, but it is way too complicated for me to create all the different actions off one timer. I think I can use a separate timer for each axis movement.


The offsetter is nice, and I have tried to use it, however it will not allow enough individualized control of each axis. I need to be able to stop, reverse and basically have absolute control, and I think individual timers will do it. A single master timer is like trying to run all the mechanical movements of an airplane using the jets alone. It won't work. You need individual drives for each component.


Thanks for the link to Dele's site. I already have all those tools because I bought the Procedural Animation video course.

Post by Emma // Feb 22, 2007, 8:42am

Emma
Total Posts: 344
pic
In my Chess tutorial I used a self programmed timer in the following way:



// delay of 500 milliseconds for shift around

b = Space.NodeMatrixElement(tmp,'pitch');

for (i=1; i<7; i++)

{ b= b + 60;

secondsvar = new Date();

mm = secondsvar.getMilliseconds();

nn = mm;

while (mm == nn)

{ secondsvar = new Date(); // necessary to update the time

nn = secondsvar.getMilliseconds();

nxm = nn -mm;

if (nxm > 500)

{ break;}

}

Space.NodeMatrixElement(tmp,'pitch') = b;


D3DView.Rescan();

D3DView.Refresh();

}


In six steps it increases the pitch value with a delay of 500 milliseconds. Start of this as a subroutine coud be programmed to depend on an input. In worst case with very long delays you could even add a file access routine where data is stored and gets read back again when needed (as kind of a hand shake mechanism). Would be interesting if the "controled process" for example contiunes over several days.


That is the theory, in reality it doesn't look as if it always works correct. My problem is I couldn't figure out thr reason, update of the view or any other circumstances. There are other values possible too:


getFullYear

getHours

getMinutes

getSeconds

getDay

getDate

getTime

if you put afterwards: System.Alert(var assigned to above getXXX) you will find out the format data is returned


a quick and dirty layout could look like this


function .....

{

params.conValue("LEblockOUTPUT") = false;

LEblockINPUT = params.conValue("LEblockINPUT");

if (LEblockINPUT == true)

{

params.conValue("LEblockOUTPUT") = true;

--> above code for the timing delay

}

params.conValue("LEblockOUTPUT") = false;

}



with the input LEblockINPUT you could control start of the timing which is given to the outside over the output LEblockOUTPUT

Both are here used as boolean, if you need other type you just would have to define the variables different in the Attributes tab and of course use it different in the code itself. As said just quick and dirty, has to be checked for correctness.
Awportals.com is a privately held community resource website dedicated to Active Worlds.
Copyright (c) Mark Randall 2006 - 2021. All Rights Reserved.
Awportals.com   ·   ProLibraries Live   ·   Twitter   ·   LinkedIn