From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.



获得继电器位置



硬件: Switches

问题:
我如何能够获得开关模块中继电器的位置?


解答:
在LabVIEW中,可以通过NI-SWITCH API中的niSwitch Get Relay Position.vi或者NI-DAQmx API中的DAQmx Switch Get Relay Position.vi获得继电器的位置。


你需要循环的调用该VI从而扫描所有的继电器。如果希望一次返回所有继电器的位置,可以使用NI-DAQmx API中的DAQmx Switch Get Relay Position.vi


安装了NI-DAQ和NI-SWITCH的驱动程序之后可以在LabVIEW的Help文档中找到以上两个VI的相关文档。C语言编程的参考帮助可以在附件中的NI-DAQmx C Reference Help 和 NI Switches Help中找到。以上VI的编程相关例子如下:



NI-SWITCH
ViStatus niSwitch_GetRelayPosition (ViSession vi, ViConstString relayName, ViInt32* relayPosition);

NI DAQmx
int32 DAQmxSwitchGetMultiRelayPos (const char relayList[], uInt32 relayPos[], uInt32 relayPosArraySize, uInt32 *numRelayPosRead);


相关链接: Product Manuals: NI-DAQmx Help


Product Manuals: NI Switches Help

附件:


LV_niSwitch.JPG - LV_niSwitch.JPGLV_niDaq.JPG - LV_niDaq.JPG
cdaqmx.chm - cdaqmx.chm



报告日期: 03/14/2005
最近更新: 02/06/2013
文档编号: 3JD7PDLE