질문,답변

글 수 1,629

[re] DAQmx 함수 사용법을 잘 모르겠습니다.

조회 수 5487 추천 수 0 2007.06.27 16:27:37
민경기 *.211.43.242
우선 님께서 NI_DAQMX 나 DAQ를 설치 하셨는지 모르겠습니다.
USB TYPE이라도 사셧을때 NI_DAQMX CD를 받으셨을텐데요...
아니면 NI에 들가셔서 NI_DAQMX최신으로받으세요.
그리고 PC에 NI장비가 연결이 되어야 겠지요..
그러면 PC 시작메뉴 "National Instruments -> NI-DAQ -> NI-DAQmx c reference Help가 생기는데 이걸 실행하셔서 위의 함수의 설명을 보십시오. (요넘을 찾아 보세요..DAQmxReadDigitalU8)

그리고 ni-daqmx를 까시면 labwinows폴더에 보시면 예제 샘플이 들어가 있습니다. 그걸 참조 하세요...


위의 함수 설명입니다. 도움 되시길....^^

DAQmxReadDigitalU8

int32 DAQmxReadDigitalU8 (TaskHandle taskHandle, int32 numSampsPerChan, float64 timeout, bool32 fillMode, uInt8 readArray[], uInt32 arraySizeInSamps, int32 *sampsPerChanRead, bool32 *reserved);

Purpose
Reads multiple 8-bit integer samples from a task that has one or more multiple digital input channels. Use this function for devices with up to 8 lines per port. The samples are returned in unsigned byte format.

Parameters
Input  
Name Type Description
taskHandle  TaskHandle The task to write samples to.
numSampsPerChan  int32 The number of samples, per channel, to read. The default value of -1 (DAQmx_Val_Auto) reads all available samples. If readArray does not contain enough space, this function returns as many samples as fit in readArray.

NI-DAQmx determines how many samples to read based on whether the task acquires samples continuously or acquires a finite number of samples.

If the task acquires samples continuously and you set this parameter to -1, this function reads all the samples currently available in the buffer.

If the task acquires a finite number of samples and you set this parameter to -1, the function waits for the task to acquire all requested samples, then reads those samples. If you set the Read All Available Samples property to TRUE, the function reads the samples currently available in the buffer and does not wait for the task to acquire all requested samples.
timeout  float64 The amount of time, in seconds, to wait for the function to read the sample(s). The default value is 10.0 seconds. To specify an infinite wait, pass -1 (DAQmx_Val_WaitInfinitely). This function returns an error if the timeout elapses.

A value of 0 indicates to try once to read the requested samples. If all the requested samples are read, the function is successful. Otherwise, the function returns a timeout error and returns the samples that were actually read.
fillMode  bool32 Specifies whether or not the samples are interleaved. Value  Description
DAQmx_Val_GroupByChannel   Group by channel (non-interleaved)
DAQmx_Val_GroupByScanNumber   Group by scan number (interleaved)

arraySizeInSamps  uInt32 The size of the array, in samples, into which samples are read.
reserved  bool32 *  Reserved for future use. Pass NULL to this parameter.
Output  
Name Type Description
readArray  uInt8 []  The array to read samples into, organized according to fillMode.
sampsPerChanRead  int32 *  The actual number of samples read from each channel.

Return Value
Name Type Description
status  int32 The error code returned by the function in the event of an error or warning. A value of 0 indicates success. A positive value indicates a warning. A negative value indicates an error.
List of Articles
번호 제목 글쓴이 날짜 조회 수
공지 이제부터 질문은 LabWindows/CVI 카페를 이용하면 더 좋겠습니다 운영자 2020-11-11 1235
공지 파일(특히 그림파일)을 올리실 때의 유의사항 운영자 2004-07-16 100157
1049 에러가 발생하는데 어찌 된일인지 모르겠습니다. file [1] 안종덕 2007-08-02 1814
1048 dll 호출 시 컴파일 오류 file 안광수 2007-07-23 2271
1047 [re] dll 호출 시 컴파일 오류 file 허창원 2007-07-23 2327
1046 [re] dll 호출 시 컴파일 오류 file [1] 안광수 2007-07-23 3273
1045 NewBitmap 함수에서 colortable, bits, mask 에 대해서 질문드립니다. file 박형민 2007-07-11 2536
1044 [re] 예전 비슷한 질문의 리플을 다시 올려드립니다. 이현호 2007-07-16 2144
1043 [re] 예전 비슷한 질문의 리플을 다시 올려드립니다. 박형민 2007-07-23 1514
1042 Table에서 체크박스 표현가능한가요? file [1] 윤두봉 2007-07-02 1597
1041 [re] Table에서 체크박스를 이미지로 만든 예 file [3] 허창원 2007-07-02 3217
1040 윈도우 비스타와 CVI와의 호완 문제 김창묵 2007-06-29 2200
1039 DAQmx 함수 사용법을 잘 모르겠습니다. file 김태원 2007-06-27 2772
» [re] DAQmx 함수 사용법을 잘 모르겠습니다. 민경기 2007-06-27 5487
1037 이런 질문을 올려도 되는지.......... [1] 김연승 2007-06-25 2496
1036 감사합니다. 김연승 2007-06-28 1513
1035 텍스트 스크롤기능 구현에 대해서... [2] 윤두봉 2007-06-22 2374
1034 [re] 텍스트 스크롤기능 구현에 대해서...(수평은 됩니다) file [1] 허창원 2007-06-23 1862
1033 반투명 기능이 있나요?(panel,button,chart...) [2] 윤두봉 2007-06-21 1782
1032 판넬에 있는 control모듈들을 어떻게 삭제를 하죠? [2] 윤두봉 2007-06-21 1564
1031 [re] 판넬에 있는 control을 제거하기 file [1] 허창원 2007-06-21 2250
1030 파일의 크기를 읽는 CVI 함수가 있나요? [2] 천종규 2007-06-04 2502