Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Some question about idaqmx low level function & Problem of low frame rate.

Solved!
Go to solution

Hi,

 

Here is a program getting data from a GigE camera, then do some caculation for each frame, then display it.

 

I have set it MAX, that the camera works in a frame trigger mode, so it should snap a frame each time it receive a trigger.

 

But I have several questions, please help me out.

low level

 

First Question: Dose the program run as:   1, continuously get image following the trigger, then put them into the buffer. At the same time, the calculation loop get one frame after another frame at its own speed.  

Or 2, the program will wait for the calculation to complete, and then wait for trigger to get frame, so in this case, if the calculation last long, it may miss trigger.

 

Second Question: I am confused about how it calculate frame rate, what dose the saying "frame rate in a  Ioop" mean? I check the help, it saids to average on 1000ms, but I still do not understand.

 

2.PNG

Third Question: My calculation loop is very slow, it takes about 160 ms per loop. But I want to achieve a frame rate of 20Hz. Is there a solution?

 

Thank you, I also attached my code, please see it.

0 Kudos
Message 1 of 7
(4,141 Views)

Hey ustcmiaor,

 

Can you attach the subVIs?

 

Regards,

A. Zaatari

National Instruments
Applications Engineer
0 Kudos
Message 2 of 7
(4,103 Views)

Sorry, I forget that. Here it is~

0 Kudos
Message 3 of 7
(4,088 Views)

Hey, ustcmiaor,

 

Since you have the start vi outside the loop, this means that the internal buffer is being updated with the most recent triggered image independent of what is going on inside the while loop. However, to reach a higher rate of acquisition, you could just create a producer consumer loop to buffer that data through. The problem is you probably wont be able to acquire for a very long time before your memory runs out, so I would be careful, also you will not be able to see the image update in real time. 

 

Regards,

A. Zaatari

National Instruments
Applications Engineer
0 Kudos
Message 4 of 7
(4,067 Views)

Hi, A. Zaatari,

 

Thank you very much for your reply.

 

I do know something about the producer consumer loop, but since the queue deal with single data operation, while my data is a 1204 array, I don't know how to add or remove 1024 data at a time.

 

A simple for loop of 1024 times seems do not work, can you show me how to do that?

 

Miao Zhang

0 Kudos
Message 5 of 7
(4,056 Views)
Solution
Accepted by topic author ustcmiaor

Hey Miao,

 

Are you refferring to the data type? are you asking how to queue an array with 1024 elements? 

 

Obtain Queue

0 Kudos
Message 6 of 7
(4,025 Views)

Yes, I am referring the data type, so I just need to wire a array constant. Thank you.

0 Kudos
Message 7 of 7
(4,018 Views)