Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Using trigger signal to start & stop to acquires a window of data in Matlab with the PCI-MIO-16E-4

Hello, I need help to use daq in matlab.
I have a trigger channel and data channels. I want to acquire data during the trigger singal is above some level ( trigger singal can be a ttl level such as larger than 5v). In matlab I can only figure that use the trigger signal to start to acquire data but can't find how to use the stop trigger signal. Currently I use a temporary way: when the rising in trigger signal come I start the card, I keep read the temp data by using "peekdata" until the temp data in trigger channel is low I stop the card. But the problem is the trigger singal has already become low before I read back the temp data and stop the device. So I got more data then I expected. Tried to search in mathworks website and can't find any hint.
Thanks,
Arvin
0 Kudos
Message 1 of 4
(3,145 Views)
fanywx,

Thanks for posting to the NI Forums.  Hopefully I can give you some pointers to figure out how to accomplish this sort of aquisition.  I was able to locate an example that uses a start and stop trigger to acquire between two edges.  The example is written in C but I would imagine it will be a similar approach in The MathWorks Matlab API.  The example is located at:

http://forums.ni.com/ni/board/message?board.id=250&message.id=23687

Let me know if you have any questions about the example.  On a related note, I thought I would just point out that the new LabVIEW 8.20 released this week has the ability to run most .m files natively within LabVIEW.  If you used the PCI-MIO-16E-4 from within LabVIEW you would be able to use the NI-DAQmx API with a much more intuitive interface.  Most likely you will be able to take your .m scripts and run them directly in LabVIEW and interface with the additional LabVIEW code that does the data acquisition.

You can take a look at it at:

https://sine.ni.com/apps/utf8/nigb.confirm?p_gb_prof_id=10342&p_lang=US&p_dl_url=&p_dwnld=N&p_code=G...

Let me know if you have any questions and good luck with your application.

Regards,

Neil S.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 4
(3,135 Views)
Hello, Neil, Thank you very much for your kindly help. But the link you post to the c example doesn't work. It is actually the address of this message. Can you fix the  link? Thanks.
0 Kudos
Message 3 of 4
(3,130 Views)
fanywx,

Sorry.  I must have copied the wrong URL and didn't notice.  The real link is:

http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B45EACE3D9B556A4E034080020E74861&p_...

That should take you to the example I mentioned.

Regards,

Neil S.

Message Edited by Neil S. on 08-10-2006 02:16 PM

Message Edited by Neil S. on 08-10-2006 02:17 PM

0 Kudos
Message 4 of 4
(3,113 Views)