Go to Post Is it legal? Yes. Is it Graciously Professional? Yes. Is it smart? No. - dlavery [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Spotlight this post!  
Unread 04-10-2010, 23:30
Radical Pi Radical Pi is offline
Putting the Jumper in the Bumper
AKA: Ian Thompson
FRC #0639 (Code Red Robotics)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2010
Location: New York
Posts: 655
Radical Pi has a spectacular aura aboutRadical Pi has a spectacular aura aboutRadical Pi has a spectacular aura about
Re: Several questions (language comparison)

Quote:
Originally Posted by flameout View Post
In the C++ WPILib, is there a way to set thread priorities? I believe it can be done in both LabVIEW and Java.
Use the class Task. In the constructor: Task("myTask", function, priority), where function is a pointer to the thread's main and priority is thread priority (100 is default). Call Start with any arguments to the main function to start the task.

Quote:
Originally Posted by flameout View Post
What about UDP communication? I know LabVIEW contains primitives, but is this doable in Java and C++?
vxWorks implements the socket system in C++. You can see how it's used in the CANJaguar SpeedControl example or in Vision/PCVideoServer.cpp (the former copy-pasted the latter)

Quote:
Originally Posted by flameout View Post
Is there some sort of event handling available? Could I, for example, run a section of code whenever a new image is available from the camera, or run a section of code when a digital input changes without polling?
I don't have the exact code in front of me, but I can push you in the right direction on how to do this. Team 639 used a rotating kicker and had a IR sensor that pulsed a Digital Line whenever the kicker reached a certain angle.
Any class that inherits from InterruptableSensorBase (That means DigitalInput, but not AnalogChannel) can interrupt the code. I think the code was somewhere along the lines of this:

Code:
DigitalInput *sensor;

void InterruptFunction() {
//do stuff here
}

Init() {
//blah
sensor = new DigitalInput(1);
sensor->RequestInterrupts( (tInterruptHandler)InterruptFunction);
sensor->EnableInterrupts();
//blah
}
I'm unsure of the line with the RequestInterrupts function, other than that I'm sure of everything.

No idea if an equivalent exists in Java
__________________

"To have no errors would be life without meaning. No strugle, no joy"
"A network is only as strong as it's weakest linksys"
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Several questions... elbuo NI LabVIEW 0 16-02-2010 02:14
joystick comparison within percentage IceStorm NI LabVIEW 4 20-03-2009 00:19
Aluminum sprockets for drive train - several questions M. Mellott Technical Discussion 16 16-12-2008 15:53
Several questions Amittt 3D Animation and Competition 8 02-02-2006 18:21
Comparison Paper ? Steve W General Forum 13 09-11-2004 16:37


All times are GMT -5. The time now is 03:33.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi