Jump to content
  • 0

Analog Discovery Pro : USB and Ethernet


Guest

Question

Hello,

I have an ADP3450. If I connect it both through USB and Ethernet, the device is found twice during device enumeration; but as far as I can tell the enumeration tAPI provides no documented way to distinguish between both connection types. The Waveforms software is able to do it, somehow, however. How does it do that?

 

Second, I'm running some stress tests to see if I will be using USB or Ethernet for my application. Our application involves streaming playback data to the analog-out device. Using USB this is reliable (I can have it running for many hours on end without issue) but if I use an Ethernet connection, the connection misbehaves; after some time (typically seconds to minutes) the DwfAnalogOutStatus call returns some random status value, without warning or obvious cause.

(To reproduce, run the AnalogOutSpinningGlobe example of the pydwf package).

Can you comment on the relative robustness of the Ethernet vs USB connection in the 3.16.3 version of DWF?

 

 

 

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hi @reddish

I run your example with Ethernet connection for 2 hour without any issues.
You could try the Linux boot mode. This is recommended for embedded use but also supports USB and Ethernet device connection. It boots slower and has a bit lower rates but the Ethernet support may be better than with the Standard boot mode (bare-metal USB and Ethernet device).

 

The device enumeration can be filtered by connection type like: FDwfEnum(enumfilterType|enumfilterUSB, &cDev)

The connection type (DTP) of a device is only available with the following:
DWFAPI BOOL FDwfEnumEDVC(int idxDev, EDVC* pedvc);

dpcdecl.h

typedef DWORD DTP;
const DTP dtpUSB        = 0x00000001;
const DTP dtpEthernet   = 0x00000002;

typedef DWORD   PDID;       // device product id
typedef WORD    FWVER;      // device firmware version number
typedef DWORD   DCAP;   //capabilities bitfield

#pragma pack(16)
typedef struct tagDVC{
    
    char        szName[cchDvcNameMax];
            //in dvctable:  Alias
            //not in dvctable:  user assigned name in device
            //not in dvctable, no user defined name:  device type with identifier

    char        szConn[MAX_PATH+1];
            //in dvctable:  connection string in dvctable
            //not in dvctable:  USB:   PATHNAME
            //                  Eth:    IP:192.168.1.1
            //                  Ser:    COM1:9600,N,8,1
            //                  EPP:    EPP:0x378
    DTP     dtp;

} DVC;

typedef struct tagEDVC{
    DVC     dvc;
                // standard DVC, may be used anywhere a DVC is required
    char    szUsrName[cchUsrNameMax+1];
                // user name string returned by the device
    char    szProdName[cchProdNameMax+1];
                // product name string returned by the device
    char    szSN[cchSnMax+1];\
                // serial number string returned by the device
    char    szMAC[cchMacMax+1];
                // MAC Address (EUI-48) returned by the device
    char    szIPV4[cchIpv4Max+1];
                // IPV4 address returned by the device
    char    szIPV6[cchIpv6Max+1];
                // IPV6 address returned by the device
    char    szPort[cchPortMax+1];
                // port number network device is listening on
    PDID    pdid;
                // product identifier returned by the device
    FWVER   fwver;
                // firmware version returned by the device
    DCAP    dcap;
                // device capabilities returned by the device
    INT32   cOpen;
                // count of handles open for this device on this system
    union {
        struct {
            WORD    discovered:1;
                        // 0: device was not discovered during enumeration
                        // 1: device was discovered during enumeration
            WORD    table:1;
                        // 0: device is not in the device table
                        // 1: device is in the device table
            WORD    pdidIsValid:1;
                        // 0: pdid field is invalid
                        // 1: pdid field is valid
            WORD    fwverIsValid:1;
                        // 0: fwver field is invalid
                        // 1: fwver field is valid
            WORD    dcapIsValid:1;
                        // 0: dcap field is invalid
                        // 1: dcap field is valid
            WORD    v2FieldsValid:1;
                        // 0: V2 fields  are not valid
                        // 1: V2 fields (ctlsSupported, dtlsSupported,
                        //    authSupported, and authEnabled) are valid
            WORD    ctlsSupported:1;
                        // 0: device does not support TLS on the control channel
                        // 1: device supports TLS on the control channel
            WORD    dtlsSupported:1;
                        // 0: device is not in the device table
                        // 1: device is in the device table
            WORD    authSupported:1;
                        // 0: client authentication is not supported
                        // 1: client authentication is supported
            WORD    authEnabled:1;
                        // 0: client authentication is disabled
                        // 1: client authentication is enabled

            WORD    rsv:6;
                        // reserved for future use
        };
        WORD    fs;
    };
} EDVC;
#pragma pack()


 

Link to comment
Share on other sites

  • 0

Hi Atilla,

Running the device in Linux boot mode does indeed make a difference, it seems. I've been running it for 15 minutes now without issue. I'll leave it running overnight to make sure.

(EDIT: yup, still going strong 12 hours later. So the issue only occurs in Standard mode.)

Not sure if you tried in standard boot mode. On my side (running Ubuntu, DWF 3.16.3, and pydwf 1.0.7; with a single Netgear switch between the computer and the device) it's pretty reproducible, really within a minute or two, tops.

As to the extended API: I've only been using 3.16.3 so far, I assume this functionality is available in the latest beta / future stable release. I'll look into it when I have the time, thanks for the pointer.

 

Edited by reddish
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...