REDHAWK UHD设备使用情况 [英] REDHAWK UHD device usage

查看:152
本文介绍了REDHAWK UHD设备使用情况的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已成功在REDHAWK版本1.8.3旁边安装了UHD设备.对于我来说,如何将波形中的组件连接到由设备管理器管理的设备并不十分清楚.我还不清楚IDL接口和USRP设备上的数据端口之间的相互作用.

我无法找到一个简单的示例来发送和接收利用USRP设备的波形(例如,将正弦波发送到USRP的信号发生器组件).有人对此有任何建议或经验吗?

解决方案

在运行环境中将组件连接到设备的一种方法是通过REDHAWK python模块.它能够附加到正在运行的域,查询任何已启动的应用程序,并将端口从组件连接到设备.以下是一个示例python脚本示例(请注意,端口必须为相同类型,才能使连接成功):

from ossie.utils import redhawk
from ossie.cf import CF

# Connect to the running domain
domain = redhawk.attach("REDHAWK_DEV")

# Gets a reference to the running application
for app in domain.apps:
    # Find desired application
    if app.name == 'desired_name':
        application = app

# Gets the component from the application
for comp in application.comps:
    # Find desired component
    if comp.name == 'desired_name':
        component = comp

# Gets the device to connect
for devMgr in domain.devMgrs:
    for dev in devMgr.devs:
        # Find desired device
        if dev.name = 'desired_name':
            device = dev

# Gets the references to the input and output ports
comp_port = component.getPort('port_name')._narrow(CF.Port)
dev_port = device.getPort('port_name')

# Makes the actual connection
comp_port.connectPort(dev_port, 'ConnectionID')

# Make sure device is started
device.start()

# Start application
application.start()

# To disconnect:
# Stop device and application
application.stop()
device.stop()
comp_port.disconnectPort('ConnectionID')

I have successfully installed the UHD device along side REDHAWK version 1.8.3. It isn't obvious to me how to connect a component in a waveform to a device being managed by a device manager. I am also unclear on the interplay between the IDL interfaces and the data ports on the USRP device.

I was unable to find a trivial example to send and receive waveform that utilizes the USRP device (e.g. a signal generator component sending a sine wave to the USRP). Does anyone have experience with this or any suggestions?

解决方案

One way to connect a Component to a Device in a running environment is through the REDHAWK python module. It is able to attach to a running domain, query any launched Applications and connect Ports from Components to Devices. The following is an example python script (Note the ports must both be the same type in order for the connection to succeed):

from ossie.utils import redhawk
from ossie.cf import CF

# Connect to the running domain
domain = redhawk.attach("REDHAWK_DEV")

# Gets a reference to the running application
for app in domain.apps:
    # Find desired application
    if app.name == 'desired_name':
        application = app

# Gets the component from the application
for comp in application.comps:
    # Find desired component
    if comp.name == 'desired_name':
        component = comp

# Gets the device to connect
for devMgr in domain.devMgrs:
    for dev in devMgr.devs:
        # Find desired device
        if dev.name = 'desired_name':
            device = dev

# Gets the references to the input and output ports
comp_port = component.getPort('port_name')._narrow(CF.Port)
dev_port = device.getPort('port_name')

# Makes the actual connection
comp_port.connectPort(dev_port, 'ConnectionID')

# Make sure device is started
device.start()

# Start application
application.start()

# To disconnect:
# Stop device and application
application.stop()
device.stop()
comp_port.disconnectPort('ConnectionID')

这篇关于REDHAWK UHD设备使用情况的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆