| 查看: 875 | 回复: 0 | ||
[求助]
使用session-based interface CounterOutputChannel控制电机移动
|
|
以前用老版本的interface编程思路是: 对电机发脉冲,通过设定步数来使让电机走几步。 但现在使用session-based interface后里面的属性都变了。 s = daq.createSession('ni'); ch = s.addCounterOutputChannel(DevicesID, 'ctr0', 'PulseGeneration'); 这是我的建立通道代码 我看了下s的属性 s.NumberOfScans, s.DurationInSeconds, s.Rate, s.IsContinuous, s.NotifyWhenDataAvailableExceeds, s.IsNotifyWhenDataAvailableExceedsAuto, s.NotifyWhenScansQueuedBelow, s.IsNotifyWhenScansQueuedBelowAuto, s.Vendor, s.Channels, s.IsRunning, s.IsLogging, s.IsDone, s.RateLimit, s.ScansQueued, s.ScansOutputByHardware, s.ScansAcquired 这些属性中我所使用的一个是s.NumberOfScans, s.DurationInSeconds, s.Rate三个。 我的问题是:之前我使用 s.DurationInSeconds, s.Rate来控制电机的移动,但是总是存在误差,后来改用s.NumberOfScans虽然设定了数量,但是误差依然存在。 matlab帮助文档里面对NumberOfScans的描述是这样的: When working with the session-based interface, use the DurationInSeconds property to change the duration of an acquisition. When the session contains output channels, DurationInSeconds becomes a read only property and its value is determined by s.scanQueued/s.Rate. 这又是什么意思。 我在想是不是不管我设置什么,matlab都会自动折算成时间。 |
» 猜你喜欢
面上有专家说实验设备不是我们单位的
已经有8人回复
科研求助
已经有4人回复
博士去二本高校当辅导员,如何调整心态?
已经有11人回复
江苏省自然基金 什么时候出结果
已经有6人回复
闲聊
已经有3人回复
初秋的晨风
已经有6人回复









回复此楼