Test and Measurement Forum

Using 3204 with GCC compiler

Post any questions you may have about our current range of oscilloscopes

Using 3204 with GCC compiler

Postby Dermot » Wed Apr 07, 2010 6:27 pm

Does anyone use the 3204 with the gcc compiler. I have tried to run a test program to open the usb port, flash the LED and close the port. This is just to prove connectivity.
Can anyone give me the initial command line for gcc and do I have to link libraries etc. All files are in the same folder and output exe file is directed there.

See attached code

#include <windows.h>
#include <stdlib.h>
#include <stdio.h>
#include <ps3000.h>
short handle;

/*
*
*/
int main(void) {
short handle;

handle = ps3000_open_unit();
printf("opened ");
Sleep(2000);
//handle = ps3000_open_unit(void);
printf("Handle = $%sd", handle);
ps3000_close_unit(handle);
Sleep(2000); /* keep cmd window open for 2 seconds*/
return(0);
}
Dermot
 

Re: Using 3204 with GCC compiler

Postby Erik » Mon Apr 12, 2010 8:32 am

To compile the example program the line is:

Code: Select all
gcc -lps3000 PS3000con.c -oPS3000con


-lps3000 includes the driver library
PS3000con.c should be changed to the name of your c-file
-oPS3000con specifies the name of the final binary

Have a look in the documentation for the linux SDK.
More specifically, the README and INSTALL files.
Erik
PICO STAFF
PICO STAFF
 
Posts: 52
Joined: Mon Oct 23, 2006 8:16 am
Location: Cambridgeshire, UK


Return to USB PC Oscilloscopes

Who is online

Users browsing this forum: No registered users and 0 guests