질문,답변

글 수 1,629

NI 9234를 사용해서 가속도를 측정해보신 고수님 도움좀...

조회 수 3710 추천 수 0 2010.01.11 16:14:23
신종찬 *.28.136.46
말그대로 NI 9234를 사용해서 가속도를 측정해보신 고수님 도움바랍니다.

제가 NI사 및 CVI라는게 있는지 안지도 몇일되지 않아서 완전히 올빼미 하고 놀고 있습니다.

여쭈어 보고 싶은 것은 두가지 입니다.

1. SamplesPerChannel과 Rate 입니다
    - 제가 생각하기로 1초에 채널당 Rate만큼 샘플링해서 SamplesPerChannel 를 리턴한다고 알고있는데 실제로 테스트를 해보니 Rate개의 데이타가 나오고 SamplesPerChannel은 스트립차트의 한화면에 표현되는 갯수가 되는 것 같습니다.
예) 하나의 채널일 경우 Rate를 1000, SamplesPerChannel을 100 으로 했을때 데이타를 저장해보면 1000개가 저장되고 마지막 100개의 데이타를 엑셀에서 열어 그래프를 그려보면 스트립차트와 동일한 그래프그 나옵니다.

제가 구하고 싶은 것은 Rate번 샘플링을 해서 마지막 결과는 SamplesPerChannel 갯수 만큼의 데이타입니다. (Rate를 조절하면 안돼냐고 하실분이 있으실 것 같은데 Rate를 20, 10으로 넣으면 초당데이타가 아닌것 같아 사용할 수 없을 것 같습니다.)

- 타이머를 사용하면 된다고 하는 것 같던데 타이머를 사용하더라도 구해진 데이타가 정상적인 SamplesPerChannel 개의 데이타가 측정되는 예제라도 주시면 감읍하겠습니다.


2. 가속도를 측정할 때 예제에 나오는 함수 중
DAQmxErrChk (DAQmxCfgAnlgEdgeStartTrig (taskOut,triggerSource,triggerSlope,triggerLevel));
                        
DAQmxErrChk (DAQmxSetTrigAttribute (taskOut, DAQmx_AnlgEdge_StartTrig_Hyst,triggerHyst));
                                
DAQmxErrChk (DAQmxSetChanAttribute(taskOut, "", DAQmx_AI_Lowpass_CuteoffFreq, filterCutoffFreq));

이 세개의 함수를 모르겠습니다.
화면이 나오는 예제라도 있으면 잡아서 값이라도 찾아볼텐데 처음 접하는 것이라 어디에 뭐가 있는지도 모르겠습니다.

고수님들 줄창 날밤하는 초보를 구제해 주세요.

명관범

2010.01.14 12:50:11
*.198.128.82

안녕하세요. 명관범 입니다. 이해를 잘 못하고 계실수도 있습니다. 만약 한 채널만 1kHz의 sampie rate로 돌린다면 이채널은 1kHz로 샘플링 하겠지만 만약 2채널을 돌린다면 각 채널당 500Hz로 나누어서 샘플링 할겁니다. 5채널을 돌린다면 채널당 200Hz가 될겁니다.

명관범

2010.01.14 12:58:42
*.198.128.82

그리고
DAQmxCfgAnlgEdgeStartTrig
int32 DAQmxCfgAnlgEdgeStartTrig (TaskHandle taskHandle, const char triggerSource[], int32 triggerSlope, float64 triggerLevel);

Purpose
Configures the task to start acquiring or generating samples when an analog signal crosses the level you specify.

Parameters
Input
Name Type Description
taskHandle TaskHandle The task used in this function.
triggerSource const char [] The name of a channel or terminal where there is an analog signal to use as the source of the trigger. For E Series devices, if you use a channel name, the channel must be the first channel in the task. The only terminal you can use for E Series devices is PFI0.
triggerSlope int32 Specifies on which slope of the signal to start acquiring or generating samples when the signal crosses triggerLevel. Value Description
DAQmx_Val_RisingSlope Trigger on the rising slope of the signal.
DAQmx_Val_FallingSlope Trigger on the falling slope of the signal.

triggerLevel float64 The threshold at which to start acquiring or generating samples. Specify this value in the units of the measurement or generation. Use triggerSlope to specify on which slope to trigger at this threshold.

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.


DAQmxSetTrigAttribute
int32 DAQmxSetTrigAttribute (TaskHandle taskHandle, int32 attribute, ...);

Purpose
Sets the value of the specified triggering attribute.

This function requires three parameters. If you do not pass the correct number of parameters, the behavior of this function is undefined.

Parameters
Input
Name Type Description
taskHandle TaskHandle The task used in this function.
attribute int32 The triggering attribute value to set.

In the function panel, when you click the control or press <Enter>, <Spacebar>, or <Ctrl-down arrow>, a dialog box appears containing a hierarchical list of the available attributes. Attributes whose values cannot be obtained are dimmed. Help text is shown for each attribute. To select an attribute, double-click it or select it and then press <Enter>.
value any type (passed by value) The value to which to set the triggering attribute.

If the attribute shown in this control has named constants as valid values, you can open a list of them by pressing <Enter>. The Attribute Values dialog box displays the values and value help for the constants.

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.


DAQmxSetChanAttribute
int32 DAQmxSetChanAttribute (TaskHandle taskHandle, const char channel[], int32 attribute, ...);

Purpose
Sets the value of the specified channel attribute.

This function requires four parameters. If you do not pass the correct number of parameters, the behavior of this function is undefined.

Parameters
Input
Name Type Description
taskHandle TaskHandle The task used in this function.
channel const char [] The channel for which to set this attribute. You can pass an empty string ("") or NULL to set the attribute for all of the channels in the specified task.
attribute int32 The channel attribute value to set.

In the function panel, when you click the control or press <Enter>, <Spacebar>, or <Ctrl-down arrow>, a dialog box appears containing a hierarchical list of the available attributes. Attributes whose values cannot be obtained are dimmed. Help text is shown for each attribute. To select an attribute, double-click it or select it and then press <Enter>.
value any type (passed by value) The value to which to set the channel attribute.

If the attribute shown in this control has named constants as valid values, you can open a list of them by pressing <Enter>. The Attribute Values dialog box displays the values and value help for the constants.
bufferSize any type (passed by value) If the attribute you pass is an array, this parameter is the size of the array in bytes.

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 100156
» NI 9234를 사용해서 가속도를 측정해보신 고수님 도움좀... [2] 신종찬 2010-01-11 3710
1268 [질문] 고수님들께 질문있습니다. 신종찬 2010-01-11 3237
1267 [re] [질문] 고수님들께 질문있습니다. 정재용 2010-01-11 3197
1266 [re] 정재용님 감사합니다. 궁금한점이 있는데요... [2] 신종찬 2010-01-11 4655
1265 TIMER 동작중에 타이틀바를 클릭하면 멈추는 것에 대하여 야리싸내 2010-01-08 12659
1264 [re] TIMER 동작중에 타이틀바를 클릭하면 멈추는 것에 대하여 [1] 허창원 2010-01-08 10867
1263 [re] TIMER 동작중에 타이틀바를 클릭하면 멈추는 것에 대하여 [1] 정재용 2010-01-08 11135
1262 Numeric Control에 관한 질문입니다. file 정재용 2010-01-05 3725
1261 [re] Numeric Control에 관한 질문입니다. [1] 궁금이 2010-01-05 4188
1260 아래 답변감사합니다. 그런데 [1] 이중훈 2009-12-24 4731
1259 webcam 관련하여 [1] 이중훈 2009-12-18 5399
1258 야라싸내님 감사합니다.^^ 정재용 2009-12-01 11292
1257 [re] 자답임당~ [1] 정재용 2009-12-03 11353
1256 카메라에 관한 질문입니다. 정재용 2009-11-30 3731
1255 [re] 카메라에 관한 질문입니다. file 야리싸내 2009-12-01 10488
1254 윈도우 창조절 질문입니다. 이정호 2009-11-27 5332
1253 [re] 윈도우 창조절 질문입니다. file [1] 허창원 2009-11-28 5004
1252 테이블 기능에 대한 질문입니다. 우준혁 2009-11-05 3024
1251 CMD 버튼 누루고 있을때 타이머 동작 도와주세요 [2] 김창환 2009-10-31 4926
1250 [re] CMD 버튼 누루고 있을때 타이머 동작 도와주세요 정재용 2010-01-11 3402