취소
다음에 대한 결과 표시 
다음에 대한 검색 
다음을 의미합니까? 

Changing an indicator value using an event structure

해결 완료!
솔루션으로 이동

Greetings,

 

I have counter trigger by an external instrument, but this one resets every certain time which I cannot change. So I'm trying to store the number of trigger in a different indicator using a an event structure and the value change of the previous indicator (Event counterere). My idea is that each time the value changes the new counter (Event counter) should add 1 but  running the program keeps the value in zero always.

 

Thank  you,

R. Monarrez

모두 다운로드
0 포인트
1/14 메시지
6,479 조회수

Hi roberto,

 

some notes:

- the LabVIEW help describes when an event is triggered. Did you read this?

- the value in the shift register will stay at zero forever as long as you only add zero to it…

- the value in the shift register will also not increment when the code handling your device will only run once…

 

Your code:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 포인트
2/14 메시지
6,462 조회수

(On phone, can only look at picture)

 

99% of your code makes no sense at all.

The indicator belongs inside the loop

The result of 0+1 is always the same

Indicators don't fire events (except with Val(sgnl)).

0 포인트
3/14 메시지
6,460 조회수

Please use Block Diagram Cleanup.

 

Your Event "Counterere" is an indicator.  So there is no user interaction that would trigger a value change.  And there is no Value Signalling property node to programmatically fire the event.

 

Even if it did run, Event Counter (with proper spelling) will only be updated when that while loop ends.

 

Gerd already pointed out things about +0 and your device code only executing once.

 

I would recommend you learn more about LabVIEW from here. How to Learn LV

0 포인트
4/14 메시지
6,456 조회수

Hi.

Since you pointed out that I cannot use an event structure with an indicator, I change the code to the following. But while the counter goes up, it doesn't count properly when comparing it to the external counter plug into the same trigger, after a while the Labview counter is always behind the actual number of events that have occur, not sure if this is  related to the way the feedback works.

 

Thank you.

0 포인트
5/14 메시지
6,373 조회수

Sounds more like your application is not keeping up with the pulses.  This is common in software.  That is why we rely on the hardware to keep track of the number of pulses have occurred.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 포인트
6/14 메시지
6,363 조회수

Hi roberto,

 

I would guess your VI is too slow because of all those bended wires in it.

This way tha data cannot flow as fast as it needs to!

😄

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 포인트
7/14 메시지
6,344 조회수

@robertomp09 wrote:

Since you pointed out that I cannot use an event structure with an indicator, I change the code to the following.


You need to stop attaching meaningless truncated pictures and show us the entire code instead. In your first VI, the "instrument IO train" is a single shot, starting with the configuration and closing at the end. Are you using "continuous run" mode to run all this?

 

We don't have your instrument subVIs. What do they all do? Please explain in detail how everything is connected, how you are running it, what you expect to get, and what you get instead.

0 포인트
8/14 메시지
6,339 조회수

Here is the full VI, the subVIs are provided as part of the instrument, I attach a .zip with all the libraries and the subVI, the instrument is a VME TDC wired using a USB bridge, the instrument works since I have tested it using a C program, but I need a DAQ using Labview.

 

Right now I'm trying to get the event counter working, but the provided counter (Labeled 'Event counterer') reset every few events, since I need to keep track of this, I did what is shown in the previous screenshot, which does go up most of the time according to the external counter, but after a while the Labview counter starts to get behind, since the LED does turn on  after every event, I'm not sure why the counter doesnt count certain events.

모두 다운로드
0 포인트
9/14 메시지
6,332 조회수

So where is the loop that keeps this thing running?  As it is right now, this runs in a single shot initializing, setting channels, getting events, then closing out.  You are only going to get 1 count (if circumstances are right) when this VI runs.

0 포인트
10/14 메시지
6,316 조회수