Go to Post you should see my scout sheet its the bomb diggity - Mirza95vx [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 01-06-2010, 16:11
Swan217's Avatar
Happy Birthday! Swan217 Swan217 is offline
RoboShow Producer
AKA: DJ Royal Fusion
no team (RoboShow)
Team Role: Engineer
 
Join Date: Jan 2003
Rookie Year: 1999
Location: Detroit Raised, Orlando Adopted
Posts: 568
Swan217 has a reputation beyond reputeSwan217 has a reputation beyond reputeSwan217 has a reputation beyond reputeSwan217 has a reputation beyond reputeSwan217 has a reputation beyond reputeSwan217 has a reputation beyond reputeSwan217 has a reputation beyond reputeSwan217 has a reputation beyond reputeSwan217 has a reputation beyond reputeSwan217 has a reputation beyond reputeSwan217 has a reputation beyond repute
Send a message via AIM to Swan217
Help - Selfish library functions... (Won't share)

I'm doing a non-competition project involving using the joystick to send a keyboard output to a drivers station computer file. I'm using a case structure reading the joystick values, which initializes a keybd_event from the user32.dll library on a pc. The problem I have is that when trying to deploy the program, labview wants to load user32.dll from the crio, so I get this error:

Quote:
Failed To Download Main.vi
LabVIEW: Failed to load shared library user32.dll:
keybd_event:C on RT target device.
Deployment completed with errors
My question is do I have to/can I preload the dll file to the cRIO, or somehow keep it from needing the dll on the crio? The dll has nothing to do with how the robot functions; it's just used for reading joystick input.

Thanks!
__________________
Orlando Regional Planning Committee & Cohost of The RoboShow & RoboVision

Follow The RoboShow on Twitter @RoboShowLive & check out our website, www.theroboshow.net

Follow RoboVision on Twitter @RoboVisionOD & check out our website, www.robovisionod.com





"As president, I believe that robotics can inspire young people to pursue science and engineering. And I also want to keep an eye on those robots in case they try anything."
— President Barack Obama
Reply With Quote
  #2   Spotlight this post!  
Unread 01-06-2010, 20:06
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,563
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Help - Selfish library functions... (Won't share)

user32.dll is a windows dll, compiled for x86. It won't run on the cRIO, which runs vxworks on a power pc.

I can't tell from your post what you're actually trying to do. Do you want to attach a joystick directly to the cRIO? Thats what it sounds like the code you wrote is expecting.

Are you using the FRC cRIO image? Are you planning to use the FRC driver station? Where do you really want the joystick to attach?
Reply With Quote
  #3   Spotlight this post!  
Unread 01-06-2010, 20:55
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,751
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Help - Selfish library functions... (Won't share)

As Joe pointed out, the VI you've written is attempting to read the joystick directly from the cRIO. The joystick VIs make calls directly to the OS they are on, Windows, Mac, or linux, but will not work on VxWorks.

For the control system, the joystick is read by the driver station, then sent to the cRIO via UDP.

If you want more help, you will need to give more info about what you really want it to do.

Greg McKaskle
Reply With Quote
  #4   Spotlight this post!  
Unread 03-06-2010, 13:25
Swan217's Avatar
Happy Birthday! Swan217 Swan217 is offline
RoboShow Producer
AKA: DJ Royal Fusion
no team (RoboShow)
Team Role: Engineer
 
Join Date: Jan 2003
Rookie Year: 1999
Location: Detroit Raised, Orlando Adopted
Posts: 568
Swan217 has a reputation beyond reputeSwan217 has a reputation beyond reputeSwan217 has a reputation beyond reputeSwan217 has a reputation beyond reputeSwan217 has a reputation beyond reputeSwan217 has a reputation beyond reputeSwan217 has a reputation beyond reputeSwan217 has a reputation beyond reputeSwan217 has a reputation beyond reputeSwan217 has a reputation beyond reputeSwan217 has a reputation beyond repute
Send a message via AIM to Swan217
Re: Help - Selfish library functions... (Won't share)

My apologies for not being more clear. I have attached some screen shots.

When I asked the question, my program was as in the Main 3.0 shot. It's essentially a modified Arcade Drive Example. As both of you pointed out, I was having issues because I was trying to read everything from the cRIO, which due to my lack of understanding of how the system reads joystick information, was wrong.

What I'm attempting to do is on the driver's station, be able to read the joystick position and turn it into a keyboard command. I got confused regarding the Joystick VI's being on the cRIO, on how the system reads the joysticks. So I pulled out all of the guts and put it into a separate VI under My Computer.

Now my question is - how do the VI's communicate between My Computer and the cRIO? To be more specific, if I run my 3.5 VI's, the Main VI on the cRIO still reads, but how do I send that information to the My Computer VI? Do I have to make the inputs/outputs into shared/global variables?
Attached Thumbnails
Click image for larger version

Name:	Main 3.0 (On CRIO)-1.jpg
Views:	30
Size:	143.6 KB
ID:	9136  Click image for larger version

Name:	Main 3.5 (Arcade Rev)-1.jpg
Views:	22
Size:	142.8 KB
ID:	9137  Click image for larger version

Name:	Dashboard 3.5 (Joystick In)-1.jpg
Views:	19
Size:	143.9 KB
ID:	9138  
__________________
Orlando Regional Planning Committee & Cohost of The RoboShow & RoboVision

Follow The RoboShow on Twitter @RoboShowLive & check out our website, www.theroboshow.net

Follow RoboVision on Twitter @RoboVisionOD & check out our website, www.robovisionod.com





"As president, I believe that robotics can inspire young people to pursue science and engineering. And I also want to keep an eye on those robots in case they try anything."
— President Barack Obama
Reply With Quote
  #5   Spotlight this post!  
Unread 03-06-2010, 14:50
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Help - Selfish library functions... (Won't share)

Quote:
Originally Posted by Dan Swando View Post
What I'm attempting to do is on the driver's station, be able to read the joystick position and turn it into a keyboard command.
What will you do with it at that point? The cRIO doesn't have a keyboard, so it's not expecting any keyboard commands.

Quote:
Now my question is - how do the VI's communicate between My Computer and the cRIO?
They communicate using the proprietary (but not exactly secret) DS-to-cRIO data exchange protocol implemented by the Driver Station application. Four joysticks (each with up to six axes and twelve buttons) are supported, along with a small number of analog and digital values associated with the Cypress interface board, and a bunch of control information such as robot mode and alliance color. There is no provision I'm aware of for general keyboard input.


I don't have any idea what you want to use a joystick-to-keyboard translation for. If what you want to do were possible, can you describe how you would use it? Give an example of what the operator would do, and what the result would be.
Reply With Quote
  #6   Spotlight this post!  
Unread 04-06-2010, 02:05
Swan217's Avatar
Happy Birthday! Swan217 Swan217 is offline
RoboShow Producer
AKA: DJ Royal Fusion
no team (RoboShow)
Team Role: Engineer
 
Join Date: Jan 2003
Rookie Year: 1999
Location: Detroit Raised, Orlando Adopted
Posts: 568
Swan217 has a reputation beyond reputeSwan217 has a reputation beyond reputeSwan217 has a reputation beyond reputeSwan217 has a reputation beyond reputeSwan217 has a reputation beyond reputeSwan217 has a reputation beyond reputeSwan217 has a reputation beyond reputeSwan217 has a reputation beyond reputeSwan217 has a reputation beyond reputeSwan217 has a reputation beyond reputeSwan217 has a reputation beyond repute
Send a message via AIM to Swan217
Re: Help - Selfish library functions... (Won't share)

Quote:
Originally Posted by Alan Anderson View Post
What will you do with it at that point? The cRIO doesn't have a keyboard, so it's not expecting any keyboard commands.
I don't have any idea what you want to use a joystick-to-keyboard translation for. If what you want to do were possible, can you describe how you would use it? Give an example of what the operator would do, and what the result would be.
What I want is to make the joysticks tell the computer that I'm pressing a key instead. For a simplified example, Pinball in Windows accepts keyboard inputs, so if I push the joystick right, the case loop outputs "Right Arrow" to the user32.dll, simulating the pressing of the key "<-" For a robotics application, you could open up a text file and have the program give you a history of the directions you gave to the robot. If you pushed the joystick right for 5 iterations, the case loop outputs "RRRRR"

Of course, this is all irrelevant to my question, which is:
How can I intercept the joystick input and send the value to a VI running on the computer? Looking at my second attachment, which is essentially the arcade drive with its input wires cut, how do I make the "Joystick Get Axis" tell the VI on the computer I'm running (NOT on the cRIO) what the values from the Joystick are?

Once again, this is NOT competition-related. I'm simply deploying the modified arcade drive example to the cRIO. What needs to take the place of "X in / X out" on the example to make this work?
__________________
Orlando Regional Planning Committee & Cohost of The RoboShow & RoboVision

Follow The RoboShow on Twitter @RoboShowLive & check out our website, www.theroboshow.net

Follow RoboVision on Twitter @RoboVisionOD & check out our website, www.robovisionod.com





"As president, I believe that robotics can inspire young people to pursue science and engineering. And I also want to keep an eye on those robots in case they try anything."
— President Barack Obama
Reply With Quote
  #7   Spotlight this post!  
Unread 04-06-2010, 08:36
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,751
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Help - Selfish library functions... (Won't share)

I'm still not 100% sure, but I'll throw out a couple things you can do.

Since this is offseason, and there are no rules, you can write a VI for the PC which reads the joysticks and keyboard directly. This is most easily done using the VIs in the Connectivity palette -- Connectivity>>Input Device Control. The VIs are a little bit old and all three devices are combined, but they work fine. You init the joystick and/or keyboard, and Query for the current state. Now you can do what you want with this info, essentially build your own DS or a supplement to the DS.

To get data to the robot, your low level approach is to use TCP or UDP. Until you have performance problems, start with TCP from Data Connectivity>>Protocols. You'll want one device to do a TCP Listen and the other device to Open a connection. Think about what you want to happen before both devices are booted.
Do you want the loop on the PC to block until the robot boots?
Do you want the loop on the robot to block until the PC boots?
There are some subtleties about which does the Open and which does the Listen, but it is pretty easy to switch later and I don't think you'll care in your application. Once the Open and Create succeed, you'll then want to enter a loop to Write your data on the PC and a loop to read it on the robot.

If you have difficulties with TCP, be sure to use the Help>>Find Examples to look at TCP usage. And if this is way off the mark, post a simple explanation of the problem you are trying to solve.

Greg McKaskle
Reply With Quote
Reply


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
Source code for the Easy C Pro library functions? bobpskier Programming 3 05-02-2007 21:39
NEED HELP RUNNING MULTIPLE FUNCTIONS AT SAME TIME!! rushrtr3 Programming 1 12-02-2006 02:01
They won't let me help!! rachakate General Forum 4 20-02-2005 03:38
Share or not to share CA submissions Rich Wong Chairman's Award 31 29-03-2004 21:47
You Share Photos-We share Data Wayne C. General Forum 8 02-03-2002 20:21


All times are GMT -5. The time now is 11:06.

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