05-29-2024 01:27 PM
Hi everyone,
I'm new in LabView, now my experiment need to acquire pixel data from 8 line scan CCD cameras synchronically and write them to text file, but I found my current Labview code seems to fail to do that. (The writing time of each text file is about 20 sec)
Attached is the Vi. files.
The 'For output single'.vi is for acquiring image from single camera.
The 'Multiple camera'.vi is for acquiring image from all 8 cameras at the same time.
My cotroller is pretty old so I'm wondering if it is the hard drive problem. Could anyone tell me if my codes correct? If not, it'd be
Frame grabber device: PCI-1428;
Chasis: NI PXI-1045
Embended Controller: PXI-8196
Frame grabber: PXI-1428 (with upload memory of 32MB each)
Camera: DALSA Piriha2
My research has been stucked for over 3 months because of this. If anyone can help me out, it would be really appreaciated!!!
Solved! Go to Solution.
05-31-2024 05:46 AM
The correct way would be to set up your cameras for (external) triggering, which the frame grabber seems to be able to.
https://www.ni.com/docs/en-US/bundle/pxi-pci-1428-seri/resource/372176a.pdf
Assuming Single camera.vi is not set as reentrant (you didn't include it) the images are now probably taken consecutively in an undetermined order.
06-06-2024 04:20 PM
Hi Ramon,
I've tried the triggering method you said, it worked out pretty well.
But instead of external triggering, I used RTSI/PXI backplane, I'm not sure which one it is. But I selected RTSI in the example.vi called 'HL Grab with two boards.vi'. It worked without timeout errors. But I checked the PXI-1428 frame grabber, I didn't see any RTSI cable in it.
So I'm confused.
Moreover, when I tried to extend this 'two boards' to 4 boards, the acquiring time got really slow. It is 0.187s/line (since I'm using all line scan camera) with only three boards (cameras/devices), but it goes to 20s/lin with 4. But the linerate I set is 10kHz for each camera. Do you have any idea with this problem?
Attached is my .vi for two cameras and three cameras.
Also I'm confused with the 'trigger number', which one should I use for each camera?
Here's my trigger bus routing:
It'd be a huge favor if you can help me with any of these confusions, thanks in advance!!
Trix
06-07-2024 03:24 AM
Hi Qian Ma,
I've never worked with a PXI chassis and it's been forever since i've use an NI frame grabber so you will have to search things.
The manual (http://download.ni.com/support/manuals/372862e.pdf) says: "The RTSI bus is integrated into the PXI system’s backplane for the NI PXI-1428", so no cable needed (only for PCI).
Not sure if you need to configure MAX to indicate which device are using the RTSI bus, but it looks like that is needed for PCI devices. You may to look around in MAX.
Concerning the images of your VI (which is not the same as attaching VIs)
From what I can tell from the example is that an external trigger used to drive a trigger over the RTSI bus to the other frame grabber. Changing it to RTSI might have unexpected behaviour.
08-29-2024 08:06 PM
Hi Ramon,
I can't say how thankful I am for your help. I've been improving my code according to your last message these months.
Now I finally can acquire images from all 8 cameras synchronized with the sampling rate of 1sample/sec. I use 'Wait Until Next ms Multiple' to determine the sampling rate. And indicators of each while loop iteration are used to see whether the acqusitions are sychronized.
Attached is my present code.
According to my frame grabber manual, one RTSI trigger can only synchronize 4 devices. So I used 2 different trigger line.
Now the problem is, I wanna increase the sampling rate up to 1sample/ms. But I can't. The indicators of each while loop iteration won't be the same after several iteration like this:
Could you please take a glanse of my code?
Thanks,
Qian
08-30-2024 01:37 AM
Hi Qian,
Can you save for previous version and select LabVIEW 2015?
1000 frames per second seems quite high, what is the size of each frame (X*Y*byte/pixel)?
It may require a ring buffer and a producer-consumer pattern.
08-30-2024 12:05 PM
Hi Ramon,
Here is the converted version of my code.
The size of each frame is 6144*1(X*Y), but I don't know the byte of each pixel yet. The data type I know is 10-bit though.
08-30-2024 01:57 PM
If your data is 10 bits, then U16 is probably used to represent the data unless the data stream is bit packed; so 6144 * 2 Bytes = 12288 Bytes/s. For eight cameras 98304 Bytes/s, this is not a huge amount.
A few things:
08-30-2024 03:43 PM
Hi,
I see your point, but I don't really understand what 'download' in your replying means. I modified the code as you suggested tho, do you mean by this?
08-30-2024 04:06 PM
qian.ma1@ucalgary.ca wrote:
Hi,
I see your point, but I don't really understand what 'download' in your replying means. I modified the code as you suggested tho, do you mean by this?
I forgot you were using LabVIEW 7.1; not sure if the parallel For loop was available then, probably not.
What I meant is you have an array of references for the images, put that array in a parallel For Loop and "download/acquire/etc" the images. But what you put in the For Loop is similar to what I said, only way you can do it without a Parallel For Loop.
If your cameras are waiting for a trigger, there is no need to put a Wait in the loop, they should only acquire when they get a trigger.