cpubbs论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

LabVIEW+单片机学习套件全套教程资料下载[免费]LabVIEW论坛精华列表贴USB0816数据采集卡《LabVIEW宝典》
LabWindows/CVI论坛精华贴NET0816以太网数据采集卡RC0210远程设备授权系统 关闭关停锁定打开设备 户外分布式数据采集
NET1624低速高精度以太网数据采集卡WIFI0824SD无线WIFI网络数据采集卡脱机运行 SD存储 小尺寸微型 串口采集远程采集 安卓 手持移动采集 纪录仪
查看: 1073|回复: 4

[labview求助] 求各位一个labviewDAQmx定时脉冲生成问题!

[复制链接]
发表于 2018-10-12 16:15:17 | 显示全部楼层 |阅读模式
我想用labview生成一个脉冲用于控制步进电机,同时还采集光栅尺信号,都是用计数器功能。框图可见图片。但是在DAQmx定时设置时,采样模式设置为连续采样程序可以正常运行,但是采样模式改为有限采样程序会报错,“指定资源已保留,无法按指定方式完成该动作”。请问各位大佬怎么解决?很急!谢谢!

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
发表于 2018-11-12 08:55:30 | 显示全部楼层
发表于 2018-11-12 08:56:01 | 显示全部楼层
Error -50103 when Using NI-DAQmx with Support for LabVIEWUpdated Oct 19, 2018





Reported In


Software
  • LabVIEW

Driver
  • NI-DAQmx





Issue DetailsWhy do I get the following error when I do not explicitly use the same resources when using NI-DAQmx with support for LabVIEW?
Error -50103 occurred at DAQmx Start Task.vi: 7220001 Possible Reason(s): The specified resource is reserved. The operation could not be completed as specified.



SolutionThis error is the result of NI-DAQmx recognizing a physical resource conflict. Because the error can be observed in a variety of situations, we describe several possible cases below:
  • Case 1: Continuously starting and clearing a DAQmx task (in a loop) for an extended period of time.
  • Case 2: Having counter tasks that need two counters and one of them is being used by another task on the same device.
  • Case 3: Using multiple DAQ Assistant Express VIs to access channels on the same data acquisition board.
  • Case 4: Using multiple SubVIs that run without any error independently, but generate an error when called from a top-level VI.
  • Case 5: Concurrently running more analog input or analog output tasks than the DAQ device allows.
  • Case 6: Failing to properly clear a task and release its resources.

Case 1: Continuously creating, configuring, starting, and clearing a DAQmx task (in a loop) for an extended period of time.

To avoid this problem, configure and start your task once before the loop, then call the read/write function in the loop as needed and clear the task after the loop.

For examples on how to do this, take a look at the examples for DAQmx and the NI Community page. To find examples, launch LabVIEW and go to Help»Find Examples. Browse by task and select Hardware Input and Output»DAQmx.

Incorrect:


Correct:



Case 2: Using multiple counter tasks on the same device.

For any task that requires two counters, the second counter is reserved based on the counter that is wired to create channel vi. The counters are always paired with the counter next to it, so ctr 0 is paired with ctr 1 and ctr 2 is paired with ctr 3. Some counter tasks require multiple counters.

Case 3: Using multiple DAQ Assistant Express VIs to access channels on the same data acquisition board.

It is not possible to have multiple DAQmx tasks attempting to access the same physical device. Thus, it is necessary to clear each task after the data acquisition has completed. The stop input of the DAQ Assistant Express VI stops the task and releases device resources when the Express VI completes execution.
  • For single point or finite data acquisition the default value for the stop input is true so you do not need to wire a True Boolean constant to this input.
Top prevent this error with multiple Express VIs in the same loop:
  • Wire the Error Out terminal of one DAQ Assistant to the Error In terminal of the second DAQ Assistant.
  • If performing multiple instances of the same measurement, you can simply use a single DAQ Assistant configured for multiple channels.

Case 4: Using multiple SubVIs that run without any error independently, but generate an error when called from a top-level VI.

Error -50103 is likely to occur when you have multiple NI-DAQmx VI's that call the same task again without clearing the previously opened task. To prevent this error from occurring:
  • Clear the task before you open it again in another SubVI, or just pass the DAQmx task from one SubVI to another to avoid having to open the task again.

Case 5: Concurrently running more analog input or analog output tasks than the DAQ device allows.

This error can also be thrown when a program explicitly calls multiple tasks performing the same type of operation at the same time. As with the other two previous cases, this produces a situation where multiple independent tasks are concurrently attempting to access the same resource. There is a limit to the number of concurrent hardware timed tasks that can be run with PCI/PCIe cards as well as cDAQ chassis. Even though the tasks might be using different channels, this is still a conflict because they require use of the same analog to digital converter and sample clock.
  • To resolve this issue, combine all operations of the same type into the same task. For DAQmx 7.3 and later, it is possible to do this even with multiple types of analog input if you use multiple DAQmx Create Channel VIs.

Case 6: Failing to properly clear a task and release its resources.

When a DAQmx task starts or otherwise enters the Reserved or Committed states resources associated with that task such as clocks, channels, trigger lines, or buffer memory are acquired exclusively by the task.

You can resolve this by doing one of the following:
  • Add a DAQmx Clear Task.vi at the end of the task
  • Add a DAQmx Control Task.vi at the end of the task, and set its action to unreserve
Don't abort the execution using the abort button if you are using a while loop to read or write and the Clear task is executed after the loop. Use the Stop Button attached to the conditional terminal of the Loop instead.

Additional InformationTraditional NI-DAQ Case: Running a DAQmx application after a Traditional NI-DAQ (Legacy) application without first resetting the Traditional NI-DAQ (Legacy) driver. Follow the steps below to reset the Traditional NI-DAQ (Legacy) driver:
  • Go to Measurement & Automation Explorer
  • Expand Devices and Interfaces
  • Right Click Traditional NI-DAQ (Legacy) Devices
  • Select Reset driver for Traditional NI-DAQ (Legacy)
This releases the resources previously reserved for Traditional NI-DAQ (Legacy), and lets you use the DAQmx driver for your data acquisition.




Note: Case 5 is common when trying to perform multiple tasks of the same type using a cDAQ-9172 chassis. Keep in mind that this chassis only has one timing engine. To avoid this problem, consolidate all of your analog acquisition into a single task to make proper use of the single timing engine. The cDAQ-9174 and 9178 chassis have three analog input timing engines and thus can support three concurrent analog input tasks if all tasks are on separate modules.



WAS THIS ARTICLE HELPFUL?





发表于 2018-11-12 08:56:28 | 显示全部楼层
发表于 2018-11-12 08:56:48 | 显示全部楼层
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|cpubbs论坛. ( 粤ICP备09171248号 )

GMT+8, 2025-5-4 12:35 , Processed in 0.702230 second(s), 6 queries , Gzip On, File On.

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表