12-11-2018 10:43 AM
We are using Matlab for controlling a DAQ 635.
We are suffering from extreme memory leaks, and we therefore want to switch to the newer toolbox based control.
However, we are having problem migrating our code... specifically, we are trying to define an edge count measurement, and we need to define both the sample clock input to one of the PFI lines and also the edge count term to another PFI line.
Previously, this was as simple as writing the following three commands:
DAQmxCreateCICountEdgesChan(task, 'dev1', '', edgeRising, 0, countDirection);
DAQmxCfgSampClkTiming(task, '/dev1/PFI5', sampleRate, edgeFalling, sampleMode, nCounts);
DAQmxSetCICountEdgesTerm(task, '/dev1/Ctr0', '/dev1/PFI1' );
However, in the toolbox, it seems that we can only ask what the terminal is - using the .Terminal property of the channel (Which I believe it is the count edge term) but we were not able to change it... And I couldn't find how to change the sample clock at all.
Any help would be appreciated.
12-13-2018 08:06 AM
Hey Yomach,
Sorry to hear about these troubles you are having. A couple questions for you:
1. What is the specific DAQ Device you are using? They normally have 4 numbers in the name.
2. Where are you migrating from/ to where are you migrating your code to?
Thanks!
Joseph
12-13-2018 01:07 PM
This may not be the main problem, but there appears to be a subtle little syntax issue.
The leading '/' character is needed when referencing terminals as in '/dev1/PFI1'
However, it shouldn't be present when referencing channels as in 'dev1/Ctr0'
I've never heard an explanation for why it's supposed to be a good idea to have that particular distinction.
-Kevin P
12-13-2018 03:29 PM
Hey Joseph,
1. Sorry, I missed a digit, it's 6351.
2. We're migrating from matlab (directly accessing the functions) to using matlab with the toolbox wrappers.
Kevin -
Thanks for the note, but this is just a misprint of me while copying the code.
In our code, these are represented by variables, so when I typed them into the forum, I inserted the syntax problem...
As a side note - we found out that our memory leak was unrelated... However the main question still hangs, is it possible to change the terminal for a counter measurement using the toolbox?