Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

smart camera 1742 selecting inspection by tcp/ip and labview

Solved!
Go to solution

Hello everybody!

 

I´m working with two smart cameras NI1742 where i have some inspection for different products, i´m trying via tcp/ip and lab view 2010 select the inspection for each product. i have configured the tcp/ip connection and test it with the vision builder ethernet terminal, this part works very good, but i can´t do this with Labview where i show images from the smart cameras via shared variables.

 

If someone know how can i do it? please, i will be thankful.

 

this is my code but there is something that is wrong.

 

thanks and regards

0 Kudos
Message 1 of 5
(5,210 Views)

Hello!

 

Just to be sure about the whole process, can you provide some more information:

 

- where are you writing to the shared variables?

- are you binding these variables to dome other variables in the project? 

- can you provide the entire project so I can take a look?

- Do you get an error code?

 

Here's a link about how we can use shared variables to communicate data from images 

 

Using Shared Variables with IMAQ images:

https://decibel.ni.com/content/docs/DOC-13027

 

Regards!

 

José Alberto G.
National Instruments
ELP Support Engineer
www.ni.com/soporte
0 Kudos
Message 2 of 5
(5,184 Views)

Hello Jose Alberto!

 

Thanks for your answer,well, i´ve been working two Smart cameras in Vision Builder 2010 where i have different inspections, in VBAI i share my variable of image,after read it in Labview, the code is simple, only a case structure, but i´m trying to make an user control where the user can enable and select the inspection that the user want to work through labview, here is the trouble i can´t do this, i´ve published my code. i hope to be clear.

 

thanks again.

 

Regards!

 

0 Kudos
Message 3 of 5
(5,174 Views)

You are already using the VBAI API in LabVIEW to start the inspection. Why don't use the Open Inspection VI to select which inspection to run and then you don't need a product select state and TCP commands? You can use the Get Target Inspections VI to list the paths to the inspections on your target since they are saved in numbered folders and it won't be obvious what the path is, but once you get the path, it is very simple to just keep one session open to the target and use the API to open inspections, run them, even get images instead of using the variables (you can use Get Inspection Image for the Image or just keep using your shared variable since it sounds like that works fine.).

 

There are two possibilities I can think of without more info on why your current setup doesn't work:

1. When you start the inspection using the API, I don't think product select works, since it is expected that you just use the API to switch inspections. You can test this out by commenting out your VBAI API calls in LV. Start the inspection from the VBAI executable when connected to the target and the Product Select is in use. Run your VI that sends a TCP command to switch to the other inspection and see if it works (you can reconnect from VBAI and see if it's running the new inspection).

2. There is an error with the TCP command...check the error out of your TCP VIs.

 

Again, instead of trying to get your current model working, I would switch to using the API for running inspections and selecting the inspections. If you do use the API, you don't need to stop the current inspection, when changing inspections. The Open Inspection VI will stop any current inspection before loading the new inspection. It will wait until the current iteration is done before stopping the current inspection, and the clean up state of that inspection will be called as well.

Hope this helps,

Brad

Message 4 of 5
(5,169 Views)
Solution
Accepted by topic author RAVENT

Hello! Brad

 

thanks, you have all the reason, i´ve tested it and works but also i need to send a command for running the selected inspection, isn´t it?.

 

yes, you´re awesome Brad, now i only have to organize all my code, thanks so much.

 

 

regards from Mexico

 

0 Kudos
Message 5 of 5
(5,160 Views)