03-21-2007 11:26 AM
Hi everyone!Very helpful thread!
I'm new in using a NI USB-6009 card with Matlab.I want to know if it is possible to use an S-function (in C code) with Real Time Windows Target toolbox from Matlab?Has anybody tried this?Could you please give me some hints in doing this? I followed the instructions in the Matlab help but it didn't work at all with an implemented S-function.
Thank you very much
Christine
03-21-2007 01:00 PM
03-22-2007 02:02 PM
03-27-2007 03:48 PM
04-05-2007 05:35 AM
04-05-2007 12:20 PM
04-05-2007 08:00 PM
Warning: Warnings messages were produced while parsing. Check the functions youI've isolated the problem to prototypes.pl version 1.1.6.20.4.1, included with R2007a. If I replace this version with prototypes.pl 1.1.6.10 from R14sp2 then the loadlibrary command completes without warnings on R2007a. I've submitted a support request to Mathworks about the warnings generated by prototypes.pl 1.1.6.20.4.1. Replacing version 1.1.6.20.4.1 with version 1.1.6.10 is thus a potential workaround for what appears to be a bug in Matlab's prototypes.pl code in the R2007a release.
intend to use for correctness. Warning text can be viewed using:
[notfound,warnings]=loadlibrary(...)
> In loadlibrary at 277
Use of uninitialized value at C:\Program Files\MATLAB\R2007a\toolbox\matlab\general\private\prototypes.pl line 420, <INFILE> chunk 1574.
Use of uninitialized value at C:\Program Files\MATLAB\R2007a\toolbox\matlab\general\private\prototypes.pl line 443, <INFILE> chunk 1574.
Use of uninitialized value at C:\Program Files\MATLAB\R2007a\toolbox\matlab\general\private\prototypes.pl line 420, <INFILE> chunk 1649.
Use of uninitialized value at C:\Program Files\MATLAB\R2007a\toolbox\matlab\general\private\prototypes.pl line 443, <INFILE> chunk 1649.
[...]
Failed to parse type '...' original input ' ...'
Found on line 1574 of input from line 1576 of file C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\nidaqmx.h
Failed to parse type '...' original input ' ...'
Found on line 1649 of input from line 1651 of file C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\nidaqmx.h
[...]
04-06-2007 07:19 AM
You can use the Data Acquisition Toolbox blocks in Simulink that were added in R2006b. They support NI-DAQmx devices like these. However, It's only supported in host mode, not any of the real time targets.
-Rob
04-13-2007 01:25 PM
Hello all,
I've been following your thread. Here is my scenerio: I built an application that uses the two general purpose counters on a PCI-6035E board for two seperate purposes:
1) Counting TTL events.
2) Creating a pulse train.
The application ran fine on Windows 98, Matlab 6.5.1, and used the 16 bit generic driver nidaq.dll. The application ran on a realtime target.
For several reasons we built our new system using the PCI-6221 DAQ, Windows XP, and Matlab 2007a. The following respective problems arose:
1) Simulink will no longer read the counter value using the counter input block, claiming that the PCI-6221 does not have a counter input (????).
2) As Rob points out, we can't access the NI-DAQmx through the real-time targets.
I was able to access the counters using the DAQmx library from the command line in a fashion similar to that proposed here. I do get the slew of warning messages with the current dll, but am still able to operate.
My questions are:
- Does anybody have an idea how to control the counters from a real-time target. It is weird to me that this functionality would be lost.
- Any reason why the counters are no longer supported in current versions?
- Rob, do you know Matlab plans to improve it's support of NI-DAQ features in the near future?
Thanks to all of you for the help so far.
05-02-2007 08:43 PM