|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#5
|
||||
|
||||
|
Re: Switching between two webcams on the dashboard
Hey Teku14,
We successfully (after 5 hours!) managed to switch webcams. I will post the relevant VI snapshots and try to explain them the best I can. Here is a link to the code we tried and some annotated screenshots. https://drive.google.com/folderview?...&usp=sha ring Vision Processing: We created two cameras (notice the different RefNum names ) and wired them into our new Background Loop VI.CameraBackground Loop: We had to create a second RefNum input for the second webcam and run two (2) Send2PC loops (one for each camera). Send2PC: It looks like you did the Send2PC perfectly. Just create controls for the port and the image name, and set them as inputs for the VI. DASHBOARD: DashboardMain: We had to do a bit of trial and error to get this to work correctly. We have a bit of code (highlighted in the orange box) that would "refresh" the feed and the port. Without that code, we would flip the camera switcher, but the image wouldn't update with the new camera unless we switch from Camera HW to Camera SW (or vice versa). So, this little block of code automatically switches from HW to SW (or vice versa) if the port changes. CameraRead_MJPG: This was a tricky VI because it was a clone and you can't edit a clone. The trick I found to edit a VI is:
Inside that VI, there is a "Get On PC" VI inside the "1, 2" case in the middle case-structure. We had to edit that too :-) Get on PC: Since this VI is also a clone, do the same steps as above with the MJPG VI, (but, obviously, look for the Get On PC instead )Moving on... All we had to add was a control for the camera port and make it an input for the VI. That's what we did. Let me know if you have any further questions at all. Thanks again Greg for getting us on the right foot ![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|