View Single Post
  #2   Spotlight this post!  
Unread 16-02-2009, 17:13
EricVanWyk EricVanWyk is offline
Registered User
no team
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Boston
Posts: 1,597
EricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond repute
Send a message via AIM to EricVanWyk
Re: timer help with labview

I've attached a picture of two simple examples. I'm sure a labview expert could do better.

In the top one I used a stacked sequence inside a while loop. This [sets the motor speed to 1, waits a millisecond], [sets the motor speed to 0, waits 11 milliseconds] repeat.

The top one uses the system timer. It grabs the current time in milliseconds (Tick Count), computes the remainder of that divided by 12 (Quotient and Remainder), and checks if the answer is 0 (Equal to 0?). (Select) is used to pass 1 if the remainder is 0 and 0 if the remainder isn't 0 to (Set Speed). This code would need to be run in a loop more often than once per millisecond.


For reference, the Jaguars are updated every 5ms, and the victors and spikes are updated slower. It is likely that this code will not behave as expected due to this. 12 milliseconds is a very short amount of time: why do you need to control them like this?

More to the point, why don't you simply set the speed to 1/12?
Attached Thumbnails
Click image for larger version

Name:	alternating motor.JPG
Views:	418
Size:	29.3 KB
ID:	7484