Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I'm trying to Output a Digital Pulse through Matlab.
Because this signal is too Small for matlab, I figured I must write a C++ Source Code and calling it from MATLAB.
I have a Data Acquisition Board (a PCI-Card on my PC) which connected to an external Board with a Sensor. this sensor must be Clocked with this Pulse (about 40 kHz - so 13µs High and 13µs Low) through a Digital Output from the DAQ-Board, eventually to acquire Data through an Analog Input to the DAQ-Board.

I hope someone can help.

I will be pleasured to hear any tips or suggestions.

Regards.
Posted
Updated 1-May-10 5:23am
v2

Generating 40 kHz square waves by software on a PC is typically not easy to do (frequency accuracy will vary widely based on how busy or not your PC is). And i'm not even sure if 40 kHZ is possible.

But depending on the DAQ board you should be able to generate such a signal by using timers/counters on the board. If your DAQ board does have such a feature, it should be described in the manual.
 
Share this answer
 
By reading your post it seems that you need some kind of real-time feature; unfortunately this is not available on Windows, both using Matlab, C/C++ or any other language. This is due to the operating system architecture: Microsoft Windows is not able to ensure strict timing performances (i.e. in the order of microseconds).
To do it you should use real-time extensions from a third-party; the most famous are RTX from Venturcom and you can find more details on it on this web-site:

<ahref="http: www.intervalzero.com="" rtx.htm"="">http://www.intervalzero.com/rtx.htm[^]

However be aware that such extensions require a developer license and runtime royalties (I don't know the prices but someone told be that they we talk about some tousand dollars for the developer license and about 200 dollars for each runtime).
 
Share this answer
 
@r.ps

Thank you both for the answer.
Yes my DAQ-Board support the Clock/timer. But MATLAB don´t.
I already asked MATLAB Support, they told me I must use a C++ Source and make MEX-File from it to workaround this Problem.
I have many examples in C++/VB/ActiveX installed with the DAQ-Board driver as APIs.
Shound work with them to realize this Output Signal ? If it is possible.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900