Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
R2012b Data acquisition toolbox session based in deployed application

Subject: R2012b Data acquisition toolbox session based in deployed application

From: Eric Keller

Date: 7 Dec, 2012 21:50:12

Message: 1 of 7

When I run my program that does data acquisition from the matlab command line, it runs fine and I can take data. When I run it as a deployed application daq.getDevices reports that there are no devices installed.

I am using NI USB based devices that are supported by the session based interface.

Any hints?

Subject: R2012b Data acquisition toolbox session based in deployed application

From: Eric Keller

Date: 8 Dec, 2012 00:58:10

Message: 2 of 7

I modified the code to run diagnostics if it failed.

On a 64 bit system the driver was too old, so I'm updating and hopefully that fixes it. Will update after NI gets done having their way with my computer.

On a 32 bit system it runs through a batch of tests using the legacy interface (thanks!) and then says everything is a legacy device and no session based hardware is available. Obviously the hardware works under session-based when not being driven from a deployed application. The device I have hooked up to it is a NI USB 6212, which supports the session based architecture.

Subject: R2012b Data acquisition toolbox session based in deployed application

From: Eric Keller

Date: 10 Dec, 2012 16:02:10

Message: 3 of 7

Turns out that it doesn't work on a 64 bit system either

Subject: R2012b Data acquisition toolbox session based in deployed application

From: Eric Keller

Date: 12 Dec, 2012 19:39:09

Message: 4 of 7

"Eric Keller" <keller.ee@gmail.com> wrote in message <k9toak$4v1$1@newscl01ah.mathworks.com>...
> When I run my program that does data acquisition from the matlab command line, it runs fine and I can take data. When I run it as a deployed application daq.getDevices reports that there are no devices installed.
>

Turns out that the daq.getDevices and daq.getVendors don't work from a function in a deployed application. However, it does work from a script.

Matlab support suggested the following workaround, which works for me:

mygetdevices.m
function [deviceIDs] = mygetdevices.m
%script
deviceIDs = [];
 getdevscript;
%
end

%script in separate file
%getdevscript.m
deviceIDs = daq.getDevices;
%

Subject: R2012b Data acquisition toolbox session based in deployed application

From: Marc

Date: 12 Mar, 2013 18:42:07

Message: 5 of 7

Thanks for posting that Matlab support suggestion. I'll give it a shot. But it still does not make sense and I hope Mathworks is working on fixing this...

Subject: R2012b Data acquisition toolbox session based in deployed application

From: jenni

Date: 1 Aug, 2013 04:19:09

Message: 6 of 7

"Eric Keller" <keller.ee@gmail.com> wrote in message <kaamgt$m5h$1@newscl01ah.mathworks.com>...
> "Eric Keller" <keller.ee@gmail.com> wrote in message <k9toak$4v1$1@newscl01ah.mathworks.com>...
> > When I run my program that does data acquisition from the matlab command line, it runs fine and I can take data. When I run it as a deployed application daq.getDevices reports that there are no devices installed.
> >
>
> Turns out that the daq.getDevices and daq.getVendors don't work from a function in a deployed application. However, it does work from a script.
>
> Matlab support suggested the following workaround, which works for me:
>
> mygetdevices.m
> function [deviceIDs] = mygetdevices.m
> %script
> deviceIDs = [];
> getdevscript;
> %
> end
>
> %script in separate file
> %getdevscript.m
> deviceIDs = daq.getDevices;
> %

The following program is not working for me when i convert it into an application using mcc.
mygetdevices.m
function mygetdevices
 deviceIDs = [];
getdevscript;
 end

%script in separate file
 %getdevscript.m
 deviceIDs = daq.getDevices;
%
It gives an error ' indefined variable daq or function daq.getDevices'. I am using matlab version 2011b in a 32 bit system. I am unable to figure out the reason. Any help?

Subject: R2012b Data acquisition toolbox session based in deployed application

From: Eric Keller

Date: 1 Aug, 2013 05:40:28

Message: 7 of 7

"jenni" wrote in message <ktcnjt$lag$1@newscl01ah.mathworks.com>...

> It gives an error ' indefined variable daq or function daq.getDevices'. I am using matlab version 2011b in a 32 bit system. I am unable to figure out the reason. Any help?

This code works for the session-based data acquisition. 2011b did not have support for most data acquisition cards in the session-based system. I suppose it's possible you have one of those systems. Otherwise, you should look at the legacy data acquisition methods. They worked fine, and I was perfectly happy with them. The only reason I changed was that they didn't support 64 bit operations.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us