[Gambas-user] Did anybody try to run stepper motors through paralel port

Werner wdahn at ...1000...
Mon Apr 19 15:28:33 CEST 2010


On 19/04/10 04:17, Zelimir Ikovic wrote:
> I wanted to know how predictable and reliable GAMBAS is when a reaction to real-world events is required. 
>
> Let say that Java RealTimeSystem is intended only for suitable  operating systems, which means that only a 
> real-time operating system, such as QNX, is appropriate for implementing the JVM.
> So that means it depends on underlynig OS version ...
>  
>  Simply installing an RTS extension 
>  and renaming java.lang.Thread instances to 
>  javax.realtime.RealtimeThread will not turn the 
>  application into a real-time app.
>  
>  I just wanted to know what is Gamas reaction to real world compared under different underlyng OS.
>  FreeBSD, OpenBSD and Linux are not he same.
>  
>
> --- On Sun, 4/18/10, Les Hardy <les at ...2337...> wrote:
>
>   
>> From: Les Hardy <les at ...2337...>
>> Subject: Re: [Gambas-user] Did anybody try to run stepper motors through paralel port
>> To: "mailing list for gambas users" <gambas-user at lists.sourceforge.net>
>> Received: Sunday, April 18, 2010, 12:27 PM
>> Doriano Blengino wrote:
>>     
>>> Les Hardy ha scritto:
>>>    
>>>       
>>>> Zelimir Ikovic wrote:
>>>>    
>>>>      
>>>>         
>>>>> I have VB6 program that run CNC plasma
>>>>>           
>> machine. It work very well and smooth under win200, but in
>> WinXP machine motion is not good. 
>>     
>>>>> It doesnot help if I set REALTIME prority for
>>>>>           
>> the process ...
>>     
>>>>> How about Linux and Gambas? Daes it depent on
>>>>>           
>> version of Linux ...
>>     
>>>>> What is resolution for Gambas Timer? Can I
>>>>>           
>> wait 10 microsec do something wait 10 microsec and so on
>> ...
>>     
>>>>> Regards
>>>>>      
>>>>>        
>>>>>           
>>> Uhm... under linux, no matter what version, you can
>>>       
>> use the parallel 
>>     
>>> port and high resolution timers, but... 10 us? What is
>>>       
>> the speed of your 
>>     
>>> motor(s)?
>>> Anyway, I see it difficult to do it in gambas, mainly
>>>       
>> because of tight 
>>     
>>> GUI integration and impossibility to use interrupts;
>>>       
>> the best way would 
>>     
>>> be to separate hi-level logic from lo-level timing,
>>>       
>> perhaps through a 
>>     
>>> library written in C.
>>>
>>>    
>>>       
>> Yes, I agree. I did a lot of work with parallel ports in
>> the past, but I 
>> would not attempt a serious application for that job in
>> Gambas.
>>
>> Since I retired, I have been building my own hobby CNC
>> machines, but I 
>> just use EMC2. It is GPL, and very efficient, so I figured
>> I had no need 
>> to write my own app.
>>
>> Les Hardy
>>
>>     
To get a feeling what is doable you can use the timer command for
benchmarking. Example:

PUBLIC SUB Benchmark()
DIM startTime AS Float
DIM stoptime AS Float
DIM i AS Integer
  FOR i = 1 TO 10
    startTime = Timer
    'whatever you want to benchmark comes next
    'in this case we time a wait for an empty event queue
      WAIT
    'end of benchmarked code
    stoptime = Timer
    PRINT "Waiting took " & ((stoptime - startTime) * 1000) & " msecs"
  NEXT
END


The above benchmark takes between 8 and 18 microseconds on my machine.

Regards
Werner




More information about the User mailing list