Welcome, Guest
Username: Password: Remember me

TOPIC: Motion Control USBIO

Re:Motion Control USBIO 13 years 10 months ago #773

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3170
  • Thank you received: 497
  • Karma: 133
Hi Dan,

There has been an unfortunate linebreak in the make example, the lines after # Modules should be

[code:1]$(pwrp_obj/ra_io_m_motioncontrol_usbio.o : \
$(pwrp_src)/ra_io_m_motioncontrol_usbio.c \
$(pwrp_inc)/pwr_cvolmerk1classes.h[/code:1]

I also want to point out that to run the MotionControl USBIO it is not necessary to do all these steps. You just need to create the USBIO rack and card objects as described in chapter 'MotionControl USB I/O' and create an .opt file. All the objects and methods are already present in the Proview release.

Another interesting issue is if the usbio driver is adapted to 64-bit linux. Please be back and tell me how it works.

/Claes
The administrator has disabled public write access.

Re:Motion Control USBIO 13 years 10 months ago #774

  • dannyboi83
  • dannyboi83's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 40
  • Karma: 0
Ok Thanks,

I am going to try to use the one in the otherIO which should hopefully be easier. There is a 64 bit library for the USB Device that needs to be renamed to libusbio.a which I have then copied into the /usr/lib folder and also the /usr/local/pwrp/processcontrol/bld/x86_64_linux/lib which is what the manual states.

The drivers for the device work fine and the sample programs are working fine for the test projects. I have also changed the read write access for the driver.

One initial question I have is that under the USB rack object it says to connect the object to a plc thread. I can only assume that these are the plcpgm that Ihave declared, but when I right click the Connect PlcThread option os not there.

Am I right in thinking that the channels that I declare should be connected to the the Ai, Ao, Di, and Do objects? I am trying this now and hopefully it should work.

Again thanks for help with this.

Dan
The administrator has disabled public write access.

Re:Motion Control USBIO 13 years 10 months ago #775

  • dannyboi83
  • dannyboi83's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 40
  • Karma: 0
Hi Claes,

I have added the Motion Control USBIO rack and card and connected them to the PlcThread under the node hier. I have connected a channel to the plant and built the program. When building the program i get the following problems:
[code:1]-- Building archive for volume: 000_001_001_001
-- Archive built for volume: 000_001_001_001

-- Working with load file volume 'VolProcesscontrol'...
-- Open file...
-- Successfully created load file for volume 'VolProcesscontrol'
-- 334 objects with a total body size of 77120 bytes were written to new file.
-- Creating bootfile for node dcarr-desktop
plc_dcarr-desktop_0999_00055
-- Plc thread generated priority 0, scantime 0.10000 s, 3 plcpgm's
-- Plc process compiled for x86_64_linux optimized -O3 Dummy
/usr/pwr47/os_linux/hw_x86_64/exp/lib/libpwr_rt.a(rt_io_m_motioncontrol_usb.o): In function `IoRackInit':
/data0/x4-7-0/pwr/otherio/lib/rt/src/os_linux/hw_x86_64/../rt_io_m_motioncontrol_usb.c:48: undefined reference to `USBIO_Open'
/data0/x4-7-0/pwr/otherio/lib/rt/src/os_linux/hw_x86_64/../rt_io_m_motioncontrol_usb.c:56: undefined reference to `USBIO_GetSerialNr'
/data0/x4-7-0/pwr/otherio/lib/rt/src/os_linux/hw_x86_64/../rt_io_m_motioncontrol_usb.c:68: undefined reference to `USBIO_Close'
/usr/pwr47/os_linux/hw_x86_64/exp/lib/libpwr_rt.a(rt_io_m_motioncontrol_usb.o): In function `IoRackClose':
/data0/x4-7-0/pwr/otherio/lib/rt/src/os_linux/hw_x86_64/../rt_io_m_motioncontrol_usb.c:92: undefined reference to `USBIO_Close'
/usr/pwr47/os_linux/hw_x86_64/exp/lib/libpwr_rt.a(rt_io_m_motioncontrol_usbio.o): In function `usbio_reconnect':
/data0/x4-7-0/pwr/otherio/lib/rt/src/os_linux/hw_x86_64/../rt_io_m_motioncontrol_usbio.c:81: undefined reference to `USBIO_Open'
/data0/x4-7-0/pwr/otherio/lib/rt/src/os_linux/hw_x86_64/../rt_io_m_motioncontrol_usbio.c:84: undefined reference to `USBIO_GetSerialNr'
/usr/pwr47/os_linux/hw_x86_64/exp/lib/libpwr_rt.a(rt_io_m_motioncontrol_usbio.o): In function `IoCardInit':
/data0/x4-7-0/pwr/otherio/lib/rt/src/os_linux/hw_x86_64/../rt_io_m_motioncontrol_usbio.c:135: undefined reference to `USBIO_SoftReset'
/data0/x4-7-0/pwr/otherio/lib/rt/src/os_linux/hw_x86_64/../rt_io_m_motioncontrol_usbio.c:159: undefined reference to `USBIO_ConfigDIO'
/data0/x4-7-0/pwr/otherio/lib/rt/src/os_linux/hw_x86_64/../rt_io_m_motioncontrol_usbio.c:194: undefined reference to `USBIO_ConfigDIO'
/data0/x4-7-0/pwr/otherio/lib/rt/src/os_linux/hw_x86_64/../rt_io_m_motioncontrol_usbio.c:205: undefined reference to `USBIO_ConfigAI'
/data0/x4-7-0/pwr/otherio/lib/rt/src/os_linux/hw_x86_64/../rt_io_m_motioncontrol_usbio.c:210: undefined reference to `USBIO_ConfigAI'
/data0/x4-7-0/pwr/otherio/lib/rt/src/os_linux/hw_x86_64/../rt_io_m_motioncontrol_usbio.c:247: undefined reference to `USBIO_ConfigDIO'
/data0/x4-7-0/pwr/otherio/lib/rt/src/os_linux/hw_x86_64/../rt_io_m_motioncontrol_usbio.c:253: undefined reference to `USBIO_ConfigAO'
/data0/x4-7-0/pwr/otherio/lib/rt/src/os_linux/hw_x86_64/../rt_io_m_motioncontrol_usbio.c:258: undefined reference to `USBIO_ConfigAO'
/data0/x4-7-0/pwr/otherio/lib/rt/src/os_linux/hw_x86_64/../rt_io_m_motioncontrol_usbio.c:261: undefined reference to `USBIO_ConfigCounter'
/data0/x4-7-0/pwr/otherio/lib/rt/src/os_linux/hw_x86_64/../rt_io_m_motioncontrol_usbio.c:273: undefined reference to `USBIO_ConfigWatchdog'
/usr/pwr47/os_linux/hw_x86_64/exp/lib/libpwr_rt.a(rt_io_m_motioncontrol_usbio.o): In function `IoCardRead':
/data0/x4-7-0/pwr/otherio/lib/rt/src/os_linux/hw_x86_64/../rt_io_m_motioncontrol_usbio.c:307: undefined reference to `USBIO_ReadDI'
/data0/x4-7-0/pwr/otherio/lib/rt/src/os_linux/hw_x86_64/../rt_io_m_motioncontrol_usbio.c:321: undefined reference to `USBIO_ReadDI'
/data0/x4-7-0/pwr/otherio/lib/rt/src/os_linux/hw_x86_64/../rt_io_m_motioncontrol_usbio.c:352: undefined reference to `USBIO_ReadADVal'
/data0/x4-7-0/pwr/otherio/lib/rt/src/os_linux/hw_x86_64/../rt_io_m_motioncontrol_usbio.c:376: undefined reference to `USBIO_ReadDI'
/data0/x4-7-0/pwr/otherio/lib/rt/src/os_linux/hw_x86_64/../rt_io_m_motioncontrol_usbio.c:393: undefined reference to `USBIO_ReadCounter'
/data0/x4-7-0/pwr/otherio/lib/rt/src/os_linux/hw_x86_64/../rt_io_m_motioncontrol_usbio.c:402: undefined reference to `USBIO_ConfigCounter'
/usr/pwr47/os_linux/hw_x86_64/exp/lib/libpwr_rt.a(rt_io_m_motioncontrol_usbio.o): In function `IoCardWrite':
/data0/x4-7-0/pwr/otherio/lib/rt/src/os_linux/hw_x86_64/../rt_io_m_motioncontrol_usbio.c:451: undefined reference to `USBIO_WriteDO'
/data0/x4-7-0/pwr/otherio/lib/rt/src/os_linux/hw_x86_64/../rt_io_m_motioncontrol_usbio.c:465: undefined reference to `USBIO_WriteDO'
/data0/x4-7-0/pwr/otherio/lib/rt/src/os_linux/hw_x86_64/../rt_io_m_motioncontrol_usbio.c:479: undefined reference to `USBIO_WriteDO'
/data0/x4-7-0/pwr/otherio/lib/rt/src/os_linux/hw_x86_64/../rt_io_m_motioncontrol_usbio.c:496: undefined reference to `USBIO_WriteAO'
/data0/x4-7-0/pwr/otherio/lib/rt/src/os_linux/hw_x86_64/../rt_io_m_motioncontrol_usbio.c:510: undefined reference to `USBIO_WriteAO'
collect2: ld returned 1 exit status
** Plc program link errors for x86_64_linux node plc_dcarr-desktop_0999
[/code:1]

I have copied the libusbio.a file to /usr/lib and $pwrp_lib. Do I need to copy the header file somewhere?

Dan
The administrator has disabled public write access.

Re:Motion Control USBIO 13 years 10 months ago #776

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3170
  • Thank you received: 497
  • Karma: 133
Hi,

You have to tell the linker to include the libusbio.a archive when linking the plc program. This is done by creating the file $pwrp_exe/plc_'nodename'_'busid'.opt, e.g. $pwrp_exe/plc_mynode_0999.opt with the content

[code:1]$pwr_obj/rt_io_user.o -lusbio[/code:1]

/Claes
The administrator has disabled public write access.

Re:Motion Control USBIO 13 years 10 months ago #777

  • dannyboi83
  • dannyboi83's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 40
  • Karma: 0
Hi,

This has been included in the file. The file is named:

plc_dcarr-desktop_0999.opt

if any other name is chosen then it will not build with the opt file so this must be correct.

I have followed the manual down to the letter but still the problem persists.

Dan
The administrator has disabled public write access.

Re:Motion Control USBIO 13 years 10 months ago #778

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3170
  • Thank you received: 497
  • Karma: 133
Hi Dan,

Try this

[code:1]$pwr_obj/rt_io_user.o -lpwr_rt -lusbio[/code:1]

/Claes
The administrator has disabled public write access.
Time to create page: 7.726 seconds