I am writing a program for laser beam scanning with TI LightCrafter for an optical microscopy research project at Koc University, Istanbul. When bitmap images are displayed on LightCrafter, and setup accordingly each pixel can be controlled. LightCrafter is connected through HDMI and is DVI complied. It is handled as a second monitor to the Windows OS (mine is Win7). Frame refresh rate 60Hz, and gets RGB data stream.
What I do, is very basically, generating a white pixel and let it move accross the mxn pixels screen. This is the basis of scanning I am after. All of the required processes are very well handled under LabView & IMAQ. However I am stuck into a serious condition:
I am unable to guarantee the displayed pixel's persistance time on the screen, and whether each pixel is displayed or not. Well, I am trying to use Wait function within IMAQ WindDraw procedure, in agreement with the frame rate (about 16.6 ms total for 60Hz rate). Still my application requires exact operation, and I need to make sure that each active/ highlighted pixel is displayed once (or preset number), and all of those pixels are displayed when they are commanded.
I understand that video monitor runs itself, and whenever a new frame is sent to the screen with WindDraw, it is displayed. And will continue to be displayed until a new frame/ image is sent. For this operation I have no feedback and no data.
My question is: Do any of you have an idea how to realize this operation with LabView tools, or external code?
I will appreciate your advise a lot.
PS. I will post a similar message to TI E2E Forum to get their advise as well.
PSS. I am attaching my vi, for the sake of completeness. Sorry for the spaghetti code, but written for testing the principles and tools.
I think you best described the issue when you said "I understand the video monitor runs itself". You don't have control as to when or for exactly how long a pixel is displayed.
It seems to me that this is the main issue - controlling the monitor. Perhaps the company that made the monitor would be a good resource to contact.
Thanks for your reply. Once again, I've thought about the process. And I think I've found a solution: I am disposing each image after a frame period+delta (i.e. 17mS) with IMAQ Dispose function. Then the image sequence becomes a controlled flow, I suppose. I will measure the pixel scan, and will be sure about the result.
I have checked the operation. Unfortunately, I have not succeeded in using IMAQ Dispose function. It did not work with this problem. I still need an advise on how to "clear video buffer" in LabView. Or a technique to sync to the monitor frame operations.
Based on your VI, it looks like you only ever have one IMAQ image. What are you referring to by "video"?
I am using an image, but changing color of a single pixel at each run, and have the pixel sweep on the screen. That is achieved by displaying the image at the frame rate of the monitor, and each frame has a different pixel location activated.
If not clear, I may try giving more detail. What is crucial is not to miss a frame, or repeat a given frame without control.
PS. I am trying to call Directx functions in order to use getverticalblankstatus or a similar method, such as WaitForVerticalBlank. However, I have faced with a problem in calling Directx class from .Net constructor node. It returns "An error occured while loading assembly...". I have tried installing newer versions of Directx, did not help. My LV is 32bit, and Windows7 is 64bits. I do not know whether it is the cause.
Anyway, I will try to get VerticalBlank information, hoping that might help. I am referring to this message thread: http://forums.ni.com/t5/LabVIEW/Implenting-WaitForVerticalBlank/td-p/432112
From your VI, I see that you’re working with a second image which you modify repeatedly. Before I only saw the first image near the top of your Block Diagram. I'm guessing this second image is what you're referring to as the video since you're changing it quickly and drawing each iteration. Could you attach updated code showing how you are now using IMAQ Dispose?
Is your main concern / question still regarding the timing of an image’s display?
"I'm guessing this second image is what you're referring to as the video since you're changing it quickly and drawing each iteration." Yes, that is exactly the issue.
"Could you attach updated code showing how you are now using IMAQ Dispose?" Unfortunately, IMAQ Dispose did not work. I am trying to get some understanding of DirectX. I wonder whether I can command using DirectX .dll's within LabView, and control video swap chains.
"Is your main concern / question still regarding the timing of an image’s display?" Yes, I am still trying to program the display with precision timing and get vertical scan trigger from the windows OS. I am referring to these sources mainly:
Here's a good overview of how to call DLLs in LabVIEW. Here's a more detailed guide, and here's an example program that shows calling a DLL in action. I'm not familiar with DirectX functions, but perhaps someone else on this forum is. I'm not sure if they will help you accomplish your goal of controlling the scan trigger in Windows OS, but based on the research you've done / links you've posted, it looks like they might.
Andrew thanks for your efforts in support. Those documents I've had and studied a long time ago, and they are good to have. I am on understanding and using DirectX SDK. It is very complicated and lots of things to study. I am also looking to SDL library. I hope to find a robust answer. If I can succeed, then will post the details here for reference.