LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

API counter problem

Hello everyone 

 

Would you please help me to know about my problem on attached VI

 

I programed a digital counter on my USB6009 with Daq assist and it was ok but with the same hardware it is not ok for the API program.

 

Sml2010_0-1616585605705.png

 

 

What is my fault?

0 Kudos
Message 1 of 9
(5,097 Views)

Hi sml,

 

this is how I create a counter task on a simple USB6008:

"CI - Flankenzählung" is German for "CI - counting edges", with looking for falling edges ("Fallend").

I use the physical channel "ctr0"…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 9
(5,093 Views)

Hi GerdW

 

Thank you for your time, But I didn't quit catch. I used "CI counter edge" but there is still a problem. 

Would you please see my attached VI and tell me where is the problem?

 

 

0 Kudos
Message 3 of 9
(5,073 Views)

Hi sml,

 


@Sml2010 wrote:

I used "CI counter edge" but there is still a problem. 

Would you please see my attached VI and tell me where is the problem?


Right now I cannot open your VI, see my signature line. Mind to convert to LV2017?

 

Which problem do oyu encounter? Any error messages?

(Delete the DAQAssistent before trying to access the very same channel using the DAQmx API!)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 9
(5,069 Views)

please try ne attached file (LV2017).

 

I have counter with Daq assist but with the same hardware and configuration I don't have any counter by API programming method. There is no error or massage.

I am new in Labview and I try to learn.

 

Thank you for your help

0 Kudos
Message 5 of 9
(5,055 Views)

Hi Sml,

 


@Sml2010 wrote:

I have counter with Daq assist but with the same hardware and configuration I don't have any counter by API programming method. There is no error or massage.


You cannot use the very same hardware resource in two DAQmx tasks!

Delete the DAQAssistent!

 

(Right now you try to access "ctr0" with the DAQmx functions and with your DAQAssistent. This will not work…)

 


@Sml2010 wrote:

I am new in Labview and I try to learn.


Did you notice those "Training resources" in the header of the LabVIEW board?

Did you learn from all those example VIs in the example finder?

Did you learn from converting the DAQAssistent by using the right-click menu entry "Generate NI-DAQmx code"?

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 9
(5,040 Views)

Hi GerdW

 

Yes, I deleted the Daq assist already, but it still not working.

Yes, I passed one of NI training course.

 

With NI examples I have an error and with changing active change, the error is still existing.

Sml2010_0-1616595842385.png

 

0 Kudos
Message 7 of 9
(5,032 Views)

Hi Basjong,

 


@Sml2010 wrote:

Yes, I deleted the Daq assist already, but it still not working.

 

With NI examples I have an error and with changing active change, the error is still existing.


Why don't you read the error message? It clearly tells what is wrong in your code…

 

You are using very simple, old, and cheap DAQ hardware with very limited capabilities. So it only allows to count for falling edges -  as mentioned in the error message!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 9
(5,030 Views)

Dear GerdW

 

Thank you for your reply 

 

Sml2010_0-1616658481046.png

in comparison with first reply, I just needed to define edge direction.

 

Thank you dear Gerdw  🌷

 

0 Kudos
Message 9 of 9
(4,948 Views)