LabVIEW为什么NI 6602的两个计数器中只能有1个工作

简介: LabVIEW为什么NI 6602的两个计数器中只能有1个工作

LabVIEW为什么NI 6602的两个计数器中只能有1个工作



问题: 在使用PCI-6602的两个计数器,不过看起来只有一个在工作,请问该如何解决这个问题?


解答: 产生这个问题可能是因为在设置计数器的时候没有指定计数器组(counter group)。E系列的数据采集卡和基于NI-TIO的板卡(例如PCI-6602)不支持多个计数器的组,因此,需要设置每个计数器为一个单独的组。如果不为每个计数器设置单独的组,那么,当为下一个计数器调用Counter Group Config,vi,就会覆盖前面一个计数器的信息。


例如:


想设置两个计数器(0和1),用Counter GroupConfig.vi 来配置计数器0,但是,没有配置计数器组,因为这是个选用的输入。正因为没有设置计数器组,所有计数器0被默认放置在0组。


如果要调用CounterGroup Config.vi再来配置计数器1,并且也没有配置计数器组。不能在同一个计数器组中有。


多于一个计数器,因此当计时器1默认配置为计时器组0,这样将替换掉计数器0的信息。因此,虽然配置了计数器0和计数器1,只能使用计数器1。


解决方法是给“countergroup”输入端指定值,给每个计数器分配不同的计数器组(从0开始,按1递增)。


I wantto measure frequency, period, pulse width, semi period, two edge separation,position, velocity, duty cycle, or count edges


with myNI hardware. How do I wire up or connect my encoder to a counter?


Theencoder has five outputs: Channel A Out, Channel B Out, Channel A Inverse Out,Channel B Inverse Out and Z-Index.


Connectingthe encoder to a single counter:


1.Choose Channel A and Channel B or Channel A Inverse and Channel B Inverse. Donot connect a non-inversed and an inversed


channelto the same counter. For example, Channel A Out and Channel A Inverse Outshould not be connected to the same


counter.


2.After selecting a valid pair of inversed or non-inversed channels, make one ofthe following connections configurations


dependingon the channel pair selected:


Configuration1


ChannelA to Source


ChannelB to AUX


Z-Indexto Gate


Configuration2


ChannelA Inverse to Source


ChannelB Inverse to AUX


Z-Indexto Gate


An easyway to find the pin connections to these counters is to right click the devicein Measurement & Automation Explorer (MAX)


andselect Device Pinout.


Connectingthe encoder to two counters:


In somecritical applications, a single encoder is connected to two counters to keeptrack of precise counting. To do this, make the


followingconnections:


1.Connect the non-inversed pair of channels and the Z-Index to Counter 1 inConfiguration 1 above.


2.Connect the inversed pair of channels and the Z-Index to Counter 2 inConfiguration 2 above. The Z-Index is connected to both


counters.


AdditionalInformation


Someencoders require a pull-up resistor to work properly with a DAQ device. Reviewthe specification sheet for the cDAQ and the


encoderto confirm if the resistor is needed and the value of it


需要说明的是,上述的例程和文档,都是可以下载的,双击即可打开,其中压缩文件是可以采用粘贴复制的方式,拷贝到硬盘上。这不是图片,各位小伙伴看到后尝试一下,这个问题就不用加微信咨询了。有关LabVIEW编程、LabVIEW开发等相关项目,可联系们。附件中的资料这里无法上传,可去公司网站搜索下载。


LabVIEW程序,如下附件所示。

相关文章
|
19天前
|
数据格式
LabVIEW编程LabVIEW开发控制安东电子LU-926U04Y四路调节模例程与相关资料
LabVIEW编程LabVIEW开发控制安东电子LU-926U04Y四路调节模例程与相关资料
15 1
|
19天前
LabVIEW编程NI 6602计数器DMA冲突例程与相关资料
LabVIEW编程NI 6602计数器DMA冲突例程与相关资料
26 7
|
19天前
|
传感器 异构计算
LabVIEW编程LabVIEW开发NI 7851R同步到背板时钟 例程与相关资料
LabVIEW编程LabVIEW开发NI 7851R同步到背板时钟 例程与相关资料
24 10
|
19天前
|
算法 安全 Linux
LabVIEW编程LabVIEW控制NI cRIO-9066例程与相关资料
LabVIEW编程LabVIEW控制NI cRIO-9066例程与相关资料
13 1
|
19天前
|
编译器
proteus计数器8253的应用
proteus计数器8253的应用
25 1
|
19天前
|
API Windows
LabVIEW安装多个NI软件产品时的安装顺序
LabVIEW安装多个NI软件产品时的安装顺序
|
19天前
LabVIEW编程LabVIEW开发 控制NI9472例程与相关资料
LabVIEW编程LabVIEW开发 控制NI9472例程与相关资料
14 0
|
19天前
|
数据采集 传感器 人工智能
LabVIEW编程LabVIEW开发NI PCI-6255消除鬼影 例程与相关资料
LabVIEW编程LabVIEW开发NI PCI-6255消除鬼影 例程与相关资料
26 7
|
19天前
|
数据采集 API
LabVIEW为NI-DAQmx设备创建任务
LabVIEW为NI-DAQmx设备创建任务
13 1
|
19天前
|
数据采集 人工智能
LabVIEW编程设置NI6251DAQmx物理通道例程与相关资料
LabVIEW编程设置NI6251DAQmx物理通道例程与相关资料
24 2