12-14-2022 01:17 PM
Hey drjdpowell
The idea is to implement this to scan and acquire images of the samples on the conveyor belt. The acquisition can sometimes be at short intervals therefore, do not want them in the same loop resulting in queuing situation. Hence, opting for Producer Consumer architecture.
Thanks
Anand
12-14-2022 02:43 PM
Hello, Anand. More Information!!! Thank you.
Here is a hint: the next time you have a question about LabVIEW routines that don't work "for mysterious reasons" (and they almost always are "mysterious", at first), save yourself and those of us trying to help you by doing the following:
I had no idea that you were trying to do this on a myRIO. It would totally surprise me if you could get this to work without involving the Host (PC). However, I'm prepared to try to help you there, as well -- it may have to wait a day or so, as I'm not near my myRIO at the moment.
As you probably know, the myRIO is designed as a Real-Time Target, which means that it is designed to do primarily a single task (though with its FPGA, it can do a number of operations in true parallel fashion), and is not optimized for file I/O (to say nothing of having multiple TCP/IP simultaneous targets, such as your PC and a Google Drive).
I'm going to try to do a "Proof of Principle" where I use my PC's Web Cam to take a short video and save it to my PC's Desktop as a series of PNGs (I might try to simply save it as an AVI, as that's slightly simpler, as I recall, but I haven't played with images for a few years ...). I will use Network Streams to fashion a simple Message Handler, Host->Target of Commands, and Target->Host of Images. Oops -- I'm not thinking straight, can't plug the PC's Web Cam into the myRIO, but I've got another "Zoom" Web Cam on top of a Desktop Monitor that I'll plug into the myRIO. Never tried to do Images with the myRIO -- I wonder if I have it set up for that? Oops, this keeps getting more complicated ...
So let's go back a step. Tell me about your Microscope WebCam. Specifically, plug it into your PC (I assume it uses USB), open MAX, and tell me how it is identified. For example, I just grabbed a WebCam from the next desk, plugged it in, and MAX called it HD Pro Webcam C920 "cam1", and told me its serial number was 23C218F1A47988D0 (which, I'm sure, you recognized as a 16-digit Hex number designed to be a "unique ID"). While it is plugged in, set the Acquisition Attributes to 640x480 MJPG 30 fps (which is what I think you are probably using) , Output Image Type as RGB (U32), and do a Grab. Does the Image look OK? [This shows that the camera, at least, works].
Double-oops -- the myRIO doesn't (yet) have Vision installed. Fortunately, I think I have the Software Bundle (I'm currently using 7.0, LabVIEW 2019). I hope this goes smoothly. Will check back and let you know.
Bob Schor
12-14-2022 03:02 PM
Hello, again, Anand. I think I figured out the likely cause of your problem. Here is the question I forgot to ask (because I wasn't thinking "myRIO"):
To what device is the myRIO connected? Is it a laptop (which is what I am using)? If so, of course it will fail, because you have no way to reach the G: drive, which lives "on the network", and (in this case) the "network" is comprised of two machines, your Laptop (as the Host) and the myRIO (as the Target), probably living on You the non-routable IP address 172.22.11.1 and .11.2. If your Host is a desktop PC, unless you had another Ethernet card installed, you had to plug the myRIO into the (only) Ethernet Port, and tell LabVIEW to find the myRIO at 172.22.11.2, which again disconnects you from "the wall".
The Good News is that the Host PC (whether Desktop or Laptop) is an excellent place to save (some) data (Megabytes, even Gigabytes, but not Terabytes). You can back it up to the G: drive when the myRIO gives you back Internet access.
Do let me know if I missed something about your setup. You'll notice I've been making "assumptions" and trying to "fill in the blanks" to understand your problem. I'm going to see what I can do tomorrow about getting a "Acquire on myRIO, save on PC Host" routine outlined for you.
Bob Schor
12-14-2022 03:20 PM
@anandr05 wrote:
Hey drjdpowell
The idea is to implement this to scan and acquire images of the samples on the conveyor belt. The acquisition can sometimes be at short intervals therefore, do not want them in the same loop resulting in queuing situation. Hence, opting for Producer Consumer architecture.
Thanks
Anand
If you want a queue of images waiting to be saved then you need multiple IMAQ images to hold them. You are only creating one location, and thus can never have more than one image in existence.
12-14-2022 03:39 PM
Hello Bob,
Thanks a lot for taking the time to help. Very much appreciated.
I am sorry, as I am new to the forum and a LabView newbie. I will attach all the files and associated information as you suggested going forward. Apologies again for having you assume things that I could have laid out.
Giving a little bit of context of what I have explored with myRIO related to imaging before working on this question/exercise can help a little bit in answering some of the questions you posed:
______________________________________________________________________________
Since I need more control over the imaging process, instead of directly using the "Vision Acquisition," I am trying to use the NI-IMAQdx high/low-level functions (I started working/ learning it since last week. So, I am super new. Excuse me If I am not clear and please correct me as required). I have tried to view live images using high-level functions (IMAQ- Open, config, grab, close). I am gradually moving to save the images required for my project( summarized below). I think Producer-Consumer architecture will suit my project requirement, which is what I am trying to do and I posed a question here for help:)
My tools specifications:
MyRIO-1900
Sorry if I am missing any further info. Will be glad to share as required.
Attaching my project file:
VI file : producer consumer - imaq (2)
______________________________________________________________________________
The short summary of what I am looking to do. This summary can also help in letting you know what I want to do is feasible or not.
Objective:
Thanks a lot for your time and consideration.
Anand
12-15-2022 07:58 AM
Aaarrrggghhh. You sent a .zip file that included only the .lvproj file, but none of the VI.
Here's what I just did:
When I was done, I had a Folder called "Test myRIO FPGA Project, inside of which was the Project file of the same name along with a dummy "RT Main.vi" Top-Level myRIO VI, as shown below (I'm just showing pictures, since you can easily do this yourself -- there's no "content" here as I haven't opened the Project except to take a Screen Shot of it, shown below).
As you can see on the left, the Project Folder contains several sub-Folders (actually full of demo code, I imagine -- I haven't really looked) as well as a 3-frame Initialize - Acquire - Close sequence for you to "fill in the blanks" to make a Custom FPGA myRIO routine.
What I wanted you to do was to find the Folder containing all the files (including the .lvproj file) in the Project, right-click the Folder and do the "Send-to" bit to create a .ZIP file that has the entire Project, including all the VIs, TypeDefs, and the Project File that you are using.
I'll be patient ...
Bob Schor
12-15-2022 09:46 AM
Hi Bob,
Apologies and thanks for being patient and walking me through this. I have followed the steps that you laid out to generate the zip file. Please see attached. Wanted to let you know that, to ensure, I opened the zip file and tried to access the project, I see the below warning/ error.
12-15-2022 10:34 AM
Bob,
I just noticed this message from you. Sorry! I just verified by saving the code to the laptop local drive and executed the code with laptop cam by choosing a local destination. The code is working as expected. I think you have rightly identified the issue yesterday itself. Sorry for the tardiness.
Thanks
Anand