Pokeys
24 May 2017 10:02 #93585
by borisz
Hi!
If you'll have some questions or problems with PoKeys, please open a ticket in the support section on the www.poscope.com.
You'll get an answer from the hardware developers.
If you'll have some questions or problems with PoKeys, please open a ticket in the support section on the www.poscope.com.
You'll get an answer from the hardware developers.
Please Log in or Create an account to join the conversation.
- juanelo1221
- Offline
- New Member
Less
More
- Posts: 7
- Thank you received: 0
07 Aug 2017 23:43 #97135
by juanelo1221
Replied by juanelo1221 on topic Pokeys
Hi, my name is Juan and I have some troubles follow the Fixer steps.
I'm new using HAL and some configurations on LINUX, I can't compile linuxcnc pokeys component with: sudo halcompile ./pokeys.comp the terminal send me an error "halcompile: command not found."
I run the sudo apt-get install linuxcnc-dev to install the HAL components but that don't solve the problem.
And I have a doubt in this part:
"These will also install the library in /usr/lib folder and copy the header file to /usr/include. Sudo is required to gain write access to these two folders"
I have to copy the library installed in /usr/lib and paste it in /usr/include? And the file is libPokeys.so?
Sorry but really I don't undestand.
Thank you so much for your time and patience.
I'm new using HAL and some configurations on LINUX, I can't compile linuxcnc pokeys component with: sudo halcompile ./pokeys.comp the terminal send me an error "halcompile: command not found."
I run the sudo apt-get install linuxcnc-dev to install the HAL components but that don't solve the problem.
And I have a doubt in this part:
"These will also install the library in /usr/lib folder and copy the header file to /usr/include. Sudo is required to gain write access to these two folders"
I have to copy the library installed in /usr/lib and paste it in /usr/include? And the file is libPokeys.so?
Sorry but really I don't undestand.
Thank you so much for your time and patience.
Please Log in or Create an account to join the conversation.
- juanelo1221
- Offline
- New Member
Less
More
- Posts: 7
- Thank you received: 0
08 Aug 2017 00:08 #97141
by juanelo1221
Replied by juanelo1221 on topic Pokeys
Thank you andypugh.
Now the terminalshowme this:
gcc -Os -g -I. -I/usr/realtime-3.4-9-rtai-686-pae/include -I. -I/usr/realtime-3.4-9-rtai-686-pae/include -I/usr/include/i386-linux-gnu -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -fno-math-errno -funsafe-math-optimizations -fno-rounding-math -fno-signaling-nans -fcx-limited-range -mhard-float -DRTAI=3 -fno-fast-math -mieee-fp -fno-unsafe-math-optimizations -DRTAPI -D_GNU_SOURCE -Drealtime -D__MODULE__ -I/usr/include/linuxcnc -Wframe-larger-than=2560 -URTAPI -U__MODULE__ -DULAPI -Os -o pokeys /tmp/tmpyQnOT4/pokeys.c -Wl,-rpath,/lib -L/lib -llinuxcnchal
/tmp/ccukRjQY.o: In function `user_mainloop':
/tmp/tmpyQnOT4/pokeys.comp:27: undefined reference to `PK_ConnectToDeviceWSerial'
/tmp/tmpyQnOT4/pokeys.comp:31: undefined reference to `PK_DigitalIOGet'
/tmp/tmpyQnOT4/pokeys.comp:31: undefined reference to `PK_AnalogIOGet'
/tmp/tmpyQnOT4/pokeys.comp:37: undefined reference to `PK_DisconnectDevice'
collect2: error: ld returned 1 exit status
make: *** [pokeys] Error 1
why send me an error?
Thank you
Now the terminalshowme this:
gcc -Os -g -I. -I/usr/realtime-3.4-9-rtai-686-pae/include -I. -I/usr/realtime-3.4-9-rtai-686-pae/include -I/usr/include/i386-linux-gnu -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -fno-math-errno -funsafe-math-optimizations -fno-rounding-math -fno-signaling-nans -fcx-limited-range -mhard-float -DRTAI=3 -fno-fast-math -mieee-fp -fno-unsafe-math-optimizations -DRTAPI -D_GNU_SOURCE -Drealtime -D__MODULE__ -I/usr/include/linuxcnc -Wframe-larger-than=2560 -URTAPI -U__MODULE__ -DULAPI -Os -o pokeys /tmp/tmpyQnOT4/pokeys.c -Wl,-rpath,/lib -L/lib -llinuxcnchal
/tmp/ccukRjQY.o: In function `user_mainloop':
/tmp/tmpyQnOT4/pokeys.comp:27: undefined reference to `PK_ConnectToDeviceWSerial'
/tmp/tmpyQnOT4/pokeys.comp:31: undefined reference to `PK_DigitalIOGet'
/tmp/tmpyQnOT4/pokeys.comp:31: undefined reference to `PK_AnalogIOGet'
/tmp/tmpyQnOT4/pokeys.comp:37: undefined reference to `PK_DisconnectDevice'
collect2: error: ld returned 1 exit status
make: *** [pokeys] Error 1
why send me an error?
Thank you
Please Log in or Create an account to join the conversation.
- juanelo1221
- Offline
- New Member
Less
More
- Posts: 7
- Thank you received: 0
08 Aug 2017 00:17 #97144
by juanelo1221
Replied by juanelo1221 on topic Pokeys
In the files downloaded from pokeyslib I have this file PoKeysLib.h, do I have to move it to a specific address?
Thank you
Thank you
Please Log in or Create an account to join the conversation.
- juanelo1221
- Offline
- New Member
Less
More
- Posts: 7
- Thank you received: 0
08 Aug 2017 01:03 #97150
by juanelo1221
Replied by juanelo1221 on topic Pokeys
Yes, I first installed:
sudo apt-get install libusb-1.0-0
sudo apt-get install libusb-1.0-0-dev
Then in the folder downloaded I ran the "sudo make -f Makefile.noqmake install"
and the terminal show me
cp libPokeys.so/usr/lib
cp PokeysLib.h /usr/include
then I tray to compile pokeys.comp
I created the file pokeys.comp with the code posted by FIXER in the first post:In the same folder where I have the downloaded files, is this correct?
Thank you.
sudo apt-get install libusb-1.0-0
sudo apt-get install libusb-1.0-0-dev
Then in the folder downloaded I ran the "sudo make -f Makefile.noqmake install"
and the terminal show me
cp libPokeys.so/usr/lib
cp PokeysLib.h /usr/include
then I tray to compile pokeys.comp
I created the file pokeys.comp with the code posted by FIXER in the first post:
component pokeys "PoKeys IO driver, by Mit Zot";
option userspace yes;
pin out bit in-# [55];
pin out unsigned ain-# [3];
pin out bit err;
pin in unsigned devSerial;
pin out bit alive;
license "GPL";
;;
#include "PoKeysLib.h"
#include <unistd.h> /* UNIX standard function definitions */
sPoKeysDevice * dev=0;
int i=0;
void user_mainloop(void)
{
while(0xb){
FOR_ALL_INSTS() {
while(dev == NULL)dev = PK_ConnectToDeviceWSerial(devSerial, 2000); //waits for usb device
alive=1;
if ((PK_DigitalIOGet(dev) == PK_OK) && (PK_AnalogIOGet(dev) == PK_OK)){ //gets IO data and checks return value
err=0;
for(i=0;i<54;i++)in(i)=!dev->Pins[i].DigitalValueGet; //just transfers values
for(i=0;i<3;i++)ain(i)=dev->Pins[i+44].AnalogValue;
}
else{ //on connection error
PK_DisconnectDevice(dev);
dev=NULL; //tries to reconnect
err=1;
for(i=0;i<54;i++)in(i)=0;
for(i=0;i<3;i++)ain(i)=0;
}
alive=0;
usleep(40000);
}
}
exit(0);
}
Thank you.
Please Log in or Create an account to join the conversation.
Time to create page: 0.272 seconds